/* Semantic colors: the original palette is the default for existing accounts. */
:root {
  --accent-hover: #d8ff91;
  --story: #222c1d;
  --story-line: #4b593f;
  --story-text: #b8c5ad;
  --input: #161c14;
  --input-border: #46513e;
  --input-hover: #778967;
  --sidebar: #171d15;
  --nav-text: #b5c0ad;
  --nav-active: #2e3a24;
  --banner-bg: #c8f76b;
  --banner-ink: #1a2510;
  --banner-muted: #415725;
  --banner-line: #99c04d;
  --card-start: #1e261b;
  --success-bg: #25331c;
  --success-text: #d7f5b1;
  --success-border: #719444;
  --error-bg: #39261f;
  --error-border: #7a4536;
}

:root[data-theme="night"] {
  color-scheme: dark;
  --bg: #080a0f;
  --panel: #11151d;
  --raised: #1a2230;
  --line: #303b4b;
  --text: #e6ecf5;
  --muted: #9caac0;
  --lime: #9fc5ff;
  --ink: #0c1d36;
  --accent-hover: #c3dbff;
  --story: #101a2a;
  --story-line: #344761;
  --story-text: #a5b8d3;
  --input: #0b1019;
  --input-border: #3c4960;
  --input-hover: #7791b3;
  --sidebar: #0c1017;
  --nav-text: #b6c4d9;
  --nav-active: #1b2a42;
  --banner-bg: #14243b;
  --banner-ink: #d9e8ff;
  --banner-muted: #b0c3df;
  --banner-line: #405c84;
  --card-start: #141d2b;
  --success-bg: #152c2d;
  --success-text: #aeebe0;
  --success-border: #4c8b83;
  --error: #ffb9b2;
  --error-bg: #301e25;
  --error-border: #885563;
}

:root[data-theme="day"] {
  color-scheme: light;
  --bg: #f4f6fa;
  --panel: #ffffff;
  --raised: #eaf0fc;
  --line: #c9d3e5;
  --text: #192642;
  --muted: #52627c;
  --lime: #3158c9;
  --ink: #ffffff;
  --accent-hover: #2345a7;
  --story: #e6edff;
  --story-line: #adbee8;
  --story-text: #465b83;
  --input: #ffffff;
  --input-border: #8c9dbc;
  --input-hover: #496da5;
  --sidebar: #ffffff;
  --nav-text: #45597b;
  --nav-active: #e8eeff;
  --banner-bg: #e4ecff;
  --banner-ink: #172b5d;
  --banner-muted: #465b83;
  --banner-line: #a9bce9;
  --card-start: #ffffff;
  --success-bg: #e6f5ed;
  --success-text: #21513e;
  --success-border: #75a88e;
  --error: #a12d26;
  --error-bg: #fff0ed;
  --error-border: #cb8c85;
}

:root[data-theme="astra"] {
  color-scheme: dark;
  --bg: #0c0a20;
  --panel: #17122d;
  --raised: #2a1f48;
  --line: #483761;
  --text: #f4efff;
  --muted: #b8abcf;
  --lime: #d0b6ff;
  --ink: #221039;
  --accent-hover: #e8d9ff;
  --story: #1b1038;
  --story-line: #5f4085;
  --story-text: #c5b3e2;
  --input: #100c22;
  --input-border: #695386;
  --input-hover: #b398d5;
  --sidebar: #100d23;
  --nav-text: #d3c4ea;
  --nav-active: #33214f;
  --banner-bg: #271641;
  --banner-ink: #f6eeff;
  --banner-muted: #d1bde9;
  --banner-line: #8362a5;
  --card-start: #201735;
  --success-bg: #152d38;
  --success-text: #b8f3f1;
  --success-border: #559aab;
  --error: #ffb6ce;
  --error-bg: #3c1835;
  --error-border: #b46189;
}

[data-theme="day"] .panel,
[data-theme="day"] .stat {
  box-shadow: 0 5px 25px #20335b08;
}
[data-theme="astra"] body {
  background: radial-gradient(ellipse at 95% 5%, #6836aa2e, transparent 45%),
              radial-gradient(ellipse at 65% 100%, #16bbc518, transparent 45%), var(--bg);
}
[data-theme="astra"] .auth-story {
  background: radial-gradient(ellipse at 0 70%, #38d8e523, transparent 60%),
              radial-gradient(ellipse at 90% 10%, #b95dfa40, transparent 65%), var(--story);
}
[data-theme="astra"] .goal-banner,
[data-theme="astra"] .lime-note {
  background: radial-gradient(ellipse at 100% 0, #6eecf32e, transparent 60%),
              linear-gradient(120deg, #331b59, #211633 60%, #17353e);
  border: 1px solid #9674c5;
  box-shadow: 0 8px 50px #b56aff15, inset 0 1px #ead8ff30;
}
[data-theme="astra"] .panel,
[data-theme="astra"] .stat {
  background: linear-gradient(130deg, #211536d9, #121324e8);
  box-shadow: inset 0 1px #e4c8ff0a, 0 12px 32px #08061530;
}
[data-theme="astra"] .topbar {
  background: #100d2399;
  backdrop-filter: blur(16px);
}
[data-theme="astra"] .button:not(.secondary) {
  background: linear-gradient(110deg, #d4b6ff, #a6e9f0);
  box-shadow: 0 0 24px #ba8aff18;
}
[data-theme="astra"] .button:not(.secondary):hover {
  background: linear-gradient(110deg, #ead7ff, #c9f8fc);
}
[data-theme="astra"] .brand-symbol,
[data-theme="astra"] .version-tag {
  color: #a6e9f0;
}

/* Each eye controls only its associated input. Hidden without JavaScript. */
.password-field { position: relative; }
.password-field input { padding-right: 56px !important; }
.password-toggle {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 44px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}
.password-toggle[hidden] { display: none; }
.password-toggle:hover { color: var(--text); background: var(--raised); }
.password-toggle .eye-slash { display: none; }
.password-toggle[aria-pressed="true"] .eye-slash { display: block; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.theme-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.theme-option {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--input-border);
  border-radius: 13px;
  cursor: pointer;
}
.theme-option:has(input:checked) {
  border-color: var(--lime);
  box-shadow: 0 0 0 1px var(--lime);
  background: var(--nav-active);
}
.theme-option:has(input:focus-visible) {
  outline: 3px solid var(--lime);
  outline-offset: 4px;
}
.theme-option > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.theme-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 14px 0 7px;
  font-size: 1rem;
  font-weight: 650;
}
.theme-check { visibility: hidden; color: var(--lime); }
input:checked ~ .theme-label .theme-check { visibility: visible; }
.theme-description { color: var(--muted); font-size: .875rem; line-height: 1.55; }
.theme-swatch {
  display: flex;
  gap: 10px;
  height: 90px;
  border: 1px solid #6f805066;
  border-radius: 7px;
  overflow: hidden;
  background: #121611;
  --swatch-side: #26311f;
  --swatch-accent: #c8f76b;
  --swatch-card: #2c3625;
}
.theme-swatch[data-swatch="night"] {
  background: #080a0f;
  border-color: #425470;
  --swatch-side: #1b2231;
  --swatch-accent: #6b90ca;
  --swatch-card: #202c3e;
}
.theme-swatch[data-swatch="day"] {
  background: #f4f6fa;
  border-color: #afbfdd;
  --swatch-side: #dbe4f5;
  --swatch-accent: #3158c9;
  --swatch-card: #d4def0;
}
.theme-swatch[data-swatch="astra"] {
  background: radial-gradient(ellipse at top right, #7235a9, #100d23 80%);
  border-color: #9674c5;
  --swatch-side: #40275e;
  --swatch-accent: linear-gradient(110deg, #d4b6ff, #a6e9f0);
  --swatch-card: #513e6a;
}
.swatch-nav { width: 22%; background: var(--swatch-side); }
.swatch-main { flex: 1; padding: 13px 10px 13px 0; }
.swatch-banner { display: block; height: 24px; border-radius: 4px; background: var(--swatch-accent); }
.swatch-cards { display: flex; gap: 5px; margin-top: 8px; }
.swatch-cards i { flex: 1; height: 24px; border-radius: 3px; background: var(--swatch-card); }
.theme-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; }
.theme-actions p { font-size: .875rem; }
.theme-actions .button { flex-shrink: 0; }
@media (max-width: 1100px) {
  .theme-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .theme-options { gap: 12px; }
  .theme-option { padding: 10px; }
  .theme-swatch { height: 78px; gap: 6px; }
  .theme-description { font-size: .8125rem; }
  .theme-actions { flex-direction: column; align-items: stretch; }
}
