:root {
  color-scheme: light;
  font-family: Inter, "Noto Sans Devanagari", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  background: #fff;
  color: #20242b;
  --canvas: #fff;
  --surface: #f5f6f8;
  --text: #20242b;
  --secondary: #626b77;
  --border: #e2e6eb;
  --accent: #1268b3;
  --accent-hover: #0c5799;
  --accent-tint: #ebf4fc;
  --focus: #0788d1;
  --card: #fff;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    background: #12161c;
    color: #f3f5f7;
    --canvas: #12161c;
    --surface: #1d232c;
    --text: #f3f5f7;
    --secondary: #aab5c2;
    --border: #343e4c;
    --accent: #82bef3;
    --accent-hover: #a1d0fa;
    --accent-tint: #1b3249;
    --card: #12161c;
  }
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--canvas); }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
}
button, input { font: inherit; }
button { color: inherit; }
a { color: var(--accent); text-underline-offset: 3px; }
[hidden] { display: none !important; }

.shell { display: flex; min-height: 100vh; flex-direction: column; width: min(100% - 48px, 440px); margin: 0 auto; padding: 28px 0 22px; }
.shell-wide { width: min(100% - 48px, 620px); }
.brand { display: inline-flex; min-height: 44px; align-items: center; gap: 12px; color: var(--text); font-size: 17px; font-weight: 600; text-decoration: none; }
.brand img { display: block; width: 44px; height: 34px; object-fit: contain; }
.brand b { color: var(--accent); font-weight: 600; }
.card { margin-top: clamp(40px, 9vh, 88px); border: 1px solid var(--border); border-radius: 16px; background: var(--card); }
.auth-card { padding: 32px; }
.profile-card { padding: 32px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .06em; }
h1, h2 { letter-spacing: -.025em; }
h1 { margin: 8px 0 5px; font-size: 28px; line-height: 1.2; font-weight: 600; }
h2 { margin: 0 0 10px; font-size: 20px; line-height: 1.3; font-weight: 600; }
.intro { margin: 0 0 25px; color: var(--secondary); line-height: 1.55; }
.social-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 12px; padding: 10px 16px; cursor: pointer; font-weight: 600; transition: background-color .15s ease, border-color .15s ease; }
.button:hover { border-color: var(--border); }
.button:focus-visible, input:focus-visible, .tab:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.button:disabled { cursor: wait; opacity: .65; }
.button-primary { width: 100%; margin-top: 20px; background: var(--accent); color: #fff; }
.button-primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.button-secondary { border-color: var(--border); background: var(--surface); color: var(--text); }
.button-secondary:hover { border-color: var(--accent); background: var(--accent-tint); }
.button-small { min-height: 44px; padding: 8px 13px; font-size: 14px; }
.resend-button { width: 100%; margin-top: 10px; }
.separator { display: flex; align-items: center; gap: 14px; margin: 23px 0; color: var(--secondary); font-size: 13px; }
.separator::before, .separator::after { height: 1px; flex: 1; background: var(--border); content: ""; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab { min-height: 44px; border: 0; border-bottom: 2px solid transparent; padding: 9px; background: transparent; color: var(--secondary); cursor: pointer; }
.tab.is-active { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); }
label { display: block; margin: 17px 0 7px; color: var(--text); font-size: 14px; font-weight: 500; }
input { width: 100%; min-height: 48px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 13px; background: var(--card); color: var(--text); }
input::placeholder { color: var(--secondary); }
input[readonly] { background: var(--surface); color: var(--secondary); }
.field-hint, .legal { color: var(--secondary); font-size: 13px; line-height: 1.55; }
.field-hint { margin: 8px 0 12px; }
.legal { margin: 22px 0 0; text-align: center; }
.notice { margin: 0 0 18px; border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; background: var(--surface); color: var(--text); font-size: 14px; line-height: 1.5; }
.notice[data-kind="error"] { border-color: #d6858c; background: #fff0f1; color: #7b1e28; }
.notice[data-kind="success"] { border-color: #6ab88e; background: #edfff4; color: #155b36; }
.captcha { min-height: 66px; margin-top: 15px; }
.profile-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.profile-heading h1 { margin-bottom: 0; }
.section-divider { height: 1px; margin: 28px 0; background: var(--border); }
footer { margin-top: auto; padding: 22px 0 0; color: var(--secondary); text-align: center; font-size: 13px; }
footer span { padding: 0 5px; color: var(--accent); }

@media (prefers-color-scheme: dark) {
  .notice[data-kind="error"] { border-color: #81434a; background: #321e22; color: #ffc7cb; }
  .notice[data-kind="success"] { border-color: #316f50; background: #172a20; color: #b5edca; }
}
@media (max-width: 480px) {
  .shell { width: min(100% - 32px, 440px); padding-top: 16px; }
  .shell-wide { width: min(100% - 32px, 620px); }
  .card { margin-top: 25px; }
  .auth-card, .profile-card { padding: 24px 20px; }
  .social-buttons { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
