:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color-scheme: light;
  /* Day colours match the learning pages (theme.css), so the whole site reads as one product. */
  --page: #f5f5f7;
  --surface: #fff;
  --text: #1d1d1f;
  --secondary: #636368;
  --muted: #636368;
  --line: #e0e0e0;
  --field: #fff;
  --wash: #f5f5f7;
  --accent: #0066cc;
  --accent-hover: #0058b0;
  --accent-soft: #eaf3fc;
  --focus: #0071e3;
  --notice: #f5f5f7;
  --error: #a13f43;
  --shadow: 0 12px 42px rgb(0 0 0 / 5%);
  --on-accent: #fff;
}
:root[data-theme="night"] {
  color-scheme: dark;
  --page: #171b27;
  --surface: #202637;
  --text: #eef2fc;
  --secondary: #b4bed3;
  --muted: #a8b4cc;
  --line: #384258;
  --field: #2a3247;
  --wash: #2a3247;
  --accent: #abb9ff;
  --accent-hover: #c1cbff;
  --accent-soft: #303e62;
  --focus: #b0bfff;
  --notice: #2a3247;
  --error: #edadb1;
  --shadow: none;
  --on-accent: #10182e;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--page); }
body { margin: 0; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; color: var(--text); background: var(--page); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
button, input, a { outline-offset: 4px; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--focus); }
button svg, .preview-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
[hidden] { display: none !important; }
.site-header { width: 100%; padding: 30px 44px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-size: 17px; font-weight: 650; letter-spacing: -.4px; }
.brand strong { font-weight: 750; }
.brand-icon { width: 30px; height: 30px; border-radius: 7px; flex: none; display: block; }
.brand-mark { width: 28px; height: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; transform: rotate(-4deg); }
.brand-mark i { border-radius: 4px; background: var(--accent); }
.brand-mark i:nth-child(2) { opacity: .4; }
.brand-mark i:nth-child(3) { opacity: .65; }
.theme-switch { display: inline-flex; align-items: center; gap: 3px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.theme-switch button { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 6px 9px; border: 0; border-radius: 8px; color: var(--secondary); background: transparent; font-size: 12px; white-space: nowrap; }
.theme-switch button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.theme-switch button:hover:not([aria-pressed="true"]) { background: var(--wash); color: var(--text); }
.document-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.login-main { flex: 1; display: grid; align-items: center; padding: 28px 24px 64px; }
.login-content { width: min(100%, 420px); margin: 0 auto; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 26px 32px 22px; box-shadow: var(--shadow); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 27px; background: var(--wash); border-radius: 10px; gap: 4px; }
.auth-tab { background: transparent; border: 0; border-radius: 7px; padding: 10px; color: var(--secondary); font-size: 14px; font-weight: 600; }
.auth-tab[aria-selected="true"] { color: var(--accent); background: var(--surface); box-shadow: 0 1px 5px rgb(20 35 80 / 7%); }
.auth-tab:hover:not([aria-selected="true"]) { color: var(--text); }
#form-title { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.45; letter-spacing: -.4px; }
.form-description { font-size: 13px; line-height: 1.7; margin: 8px 0 25px; color: var(--secondary); }
.field + .field { margin-top: 20px; }
.field > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 9px; }
.field input { display: block; width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--field); color: var(--text); height: 48px; padding: 0 14px; font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.field input::placeholder { color: var(--muted); font-size: 14px; opacity: 1; }
.field input:focus { outline: 0; border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input:disabled { opacity: .7; }
.field-hint { display: block; color: var(--secondary); font-size: 12px; line-height: 1.6; margin-top: 7px; }
#password-change-form { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 20px; }
#brand-label { overflow-wrap: anywhere; max-width: 40vw; }
.password-field { position: relative; }
.password-field input { padding-right: 48px; }
.password-toggle { position: absolute; inset: 4px 4px 4px auto; width: 40px; border: 0; border-radius: 7px; display: grid; place-items: center; background: transparent; color: var(--muted); }
.password-toggle:hover { color: var(--accent); background: var(--wash); }
.form-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 19px 0 25px; min-height: 26px; font-size: 12px; }
.remember { display: inline-flex; align-items: center; gap: 8px; color: var(--secondary); cursor: pointer; }
.remember input { margin: 0; width: 15px; height: 15px; accent-color: var(--accent); }
.text-button { border: 0; padding: 4px 0; color: var(--accent); background: transparent; font-size: 12px; line-height: 1.5; }
.text-button:hover { text-decoration: underline; text-underline-offset: 4px; }
.primary-button { display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--accent); color: #fff; width: 100%; border: 1px solid transparent; border-radius: 10px; min-height: 48px; padding: 13px 16px; font-size: 14px; font-weight: 650; transition: background .15s, transform .15s; }
:root[data-theme="night"] .primary-button { color: #10182e; }
.primary-button:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); }
.primary-button:active:not(:disabled) { transform: translateY(0); }
.primary-button:disabled { background: var(--wash); color: var(--muted); border-color: var(--line); }
.primary-button[aria-busy="true"] svg { display: none; }
.primary-button[aria-busy="true"]::after { content: ""; display: block; height: 14px; width: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .75s linear infinite; }
.notice { background: var(--notice); color: var(--secondary); border: 1px solid var(--line); border-radius: 9px; padding: 12px; font-size: 12px; line-height: 1.7; margin: -5px 0 18px; }
.form-status { font-size: 12px; line-height: 1.7; color: var(--secondary); overflow-wrap: anywhere; }
.form-status:not(:empty) { margin-top: 16px; }
.form-status[data-kind="error"] { color: var(--error); }
.retry-button { display: block; margin-top: 6px; }
.preview-section { margin: 23px 0 -2px; text-align: center; }
.preview-button { border: 0; padding: 5px 10px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--accent); background: transparent; font-size: 13px; font-weight: 600; border-radius: 6px; }
.preview-button:hover { background: var(--accent-soft); }
.preview-button:disabled { color: var(--muted); }
.preview-button svg { width: 16px; height: 16px; }
.preview-section p { color: var(--muted); font-size: 11px; margin: 5px 0 0; line-height: 1.6; }
.account-note { color: var(--muted); text-align: center; font-size: 11px; margin: 24px 0 0; line-height: 1.8; }
.security-note { color: var(--secondary); font-size: 12px; line-height: 1.7; margin: 16px 0; }
.session-section { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 20px; }
.section-heading, .session-row, .account-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading h2 { font-size: 14px; margin: 0; font-weight: 650; }
.session-row { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.session-row small { display: block; color: var(--secondary); font-size: 11px; line-height: 1.6; margin-top: 4px; }
.session-row > div { min-width: 0; overflow-wrap: anywhere; }
.session-row button { flex-shrink: 0; }
.session-empty { color: var(--secondary); font-size: 12px; line-height: 1.7; }
.account-actions { margin-top: 20px; }
.account-actions a { text-decoration: none; }
#account-panel .text-button { white-space: nowrap; }
#terms-option { display: flex; margin: 0 0 18px; }
#terms-option a { color: var(--accent); }
#password-hint { display: block; color: var(--secondary); font-size: 12px; line-height: 1.6; margin-top: 7px; }
.document-toolbar a { color: var(--accent); }
.site-footer { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px 22px; padding: 0 24px 24px; color: var(--muted); font-size: 12px; letter-spacing: .1px; }
.site-footer .icp-link { flex-basis: 100%; color: inherit; font-size: 12px; line-height: 1.6; text-align: center; text-decoration: none; }
.site-footer .icp-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.noscript-notice { position: fixed; bottom: 0; left: 0; width: 100%; padding: 15px; text-align: center; color: var(--text); background: var(--notice); border-top: 1px solid var(--line); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 540px) {
  .site-header { padding: 21px 22px; }
  .brand { font-size: 14px; gap: 9px; }
  .brand-mark { width: 23px; height: 23px; gap: 2px; }
  .brand-mark i { border-radius: 3px; }
  .theme-switch { border-radius: 11px; }
  .theme-switch button { min-width: 44px; min-height: 44px; padding-inline: 6px; }
  .theme-switch button svg { width: 18px; height: 18px; }
  .login-main { padding: 24px 22px 40px; }
  .auth-card { padding: 24px; border-radius: 19px; }
  .field input { font-size: 16px; }
  .site-footer { padding-bottom: 20px; }
}
@media (max-width: 350px) {
  .site-header { padding-inline: 15px; }
  .brand { font-size: 12px; gap: 6px; }
  .login-main { padding-inline: 15px; }
  .auth-card { padding: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* Password reset stays within the existing compact account card. */
.reset-methods { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 16px; }
.reset-methods .text-button { min-height:36px; padding:6px 12px; border:1px solid var(--line); border-radius:9px; }
.reset-methods .text-button[aria-pressed="true"] { color:var(--accent); background:var(--accent-soft); border-color:var(--accent); }
#send-reset-code { align-self:flex-start; min-height:40px; margin-top:8px; padding:6px 0; }
#reset-unavailable { margin:0 0 16px; }

#logout-button{color:#b42336}@media(prefers-color-scheme:dark){#logout-button{color:#ff949e}}

/* Round 10U2: phone polish for the public pages (home, sign-in, terms, privacy). */
@media (max-width: 767px) {
  .brand { flex: none; }
  .brand span, .brand strong { white-space: nowrap; }
  .site-header { gap: 8px; }
  .site-header .public-language-select, .document-toolbar .public-language-select { max-width: 112px; }
  .document-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
  .document-toolbar > a { flex-basis: 100%; display: inline-flex; align-items: center; min-height: 44px; }
  .document-toolbar > .theme-switch { margin-inline-start: auto; }
  body > main:has(> .document-toolbar) { margin-top: 8px !important; padding-top: 8px !important; }
  .site-footer a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
  input[type="checkbox"] { width: 20px; height: 20px; }
}
