:root {
  --bg: #f5f2ee;
  --card: #ffffff;
  --text: #1f1d1a;
  --muted: #847f78;
  --accent: #b5793b;
  --border: #e7e2da;
  --terracotta: #C4714A;
  --panel-bg: var(--bg);
}

html[data-theme="dark"] {
  --bg: #1a1814;
  --card: #2a2722;
  --text: #f0ece4;
  --muted: #888888;
  --border: #3a3631;
  --terracotta: #C4714A;
  --panel-bg: #221f1a;
}

* { box-sizing: border-box; }

html, body {
  transition: background-color 1.4s ease, color 1.4s ease;
}

*, *::before, *::after {
  transition: background-color 1.4s ease, color 1.4s ease, border-color 1.4s ease, fill 1.4s ease, stroke 1.4s ease;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
}

.layout {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  gap: 0;
  will-change: transform, opacity;
  transform-origin: center top;
}

.col-image {
  flex: 0 0 45%;
  max-width: 45%;
  height: 100vh;
  background: var(--panel-bg);
  line-height: 0;
  position: relative;
}

.col-image::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100%;
  background: linear-gradient(to right, transparent, var(--panel-bg));
  pointer-events: none;
}

.col-text {
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 0 64px 48px 112px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--panel-bg);
}

.content-middle {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.content-middle > * {
  margin: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  margin-left: -112px;
  margin-right: -64px;
  padding: 0 64px 0 112px;
  border-bottom: 1px solid var(--border);
}

.topbar-icons {
  display: flex;
  align-items: center;
  gap: 20px;
}

.theme-toggle {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--accent);
}

.theme-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.6s ease, opacity 0.6s ease, color 1.4s ease;
}

.theme-icon.hidden {
  display: none;
}

.theme-icon.spin-out {
  transform: rotate(180deg);
}

.user-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.user-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--terracotta);
}

.user-dot.hidden {
  display: none;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  min-width: 160px;
  z-index: 50;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.user-dropdown.hidden {
  display: none;
}

#dropdown-signed-in.hidden,
#dropdown-signed-out.hidden {
  display: none;
}

.user-dropdown.visible {
  opacity: 1;
  transform: translateY(0);
}

.user-dropdown-item {
  display: block;
  width: 100%;
  border: none;
  background: none;
  padding: 12px 16px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.user-dropdown-item:hover {
  background: rgba(196, 113, 74, 0.08);
  color: var(--terracotta);
}

.user-dropdown-email {
  margin: 0;
  padding: 12px 16px 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-modal.hidden {
  display: none;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.auth-modal-card {
  position: relative;
  background: var(--card);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.auth-modal-close:hover {
  color: var(--text);
}

.auth-modal-title {
  margin: 0 0 24px;
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

.my-words-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 360px;
  overflow-y: auto;
}

.my-words-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.my-words-word {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  color: var(--terracotta);
  text-transform: lowercase;
}

.my-words-date {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

.my-words-empty {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* ── Profile preference cards ──────────────────────────────────────────────── */

.pref-section {
  margin-bottom: 36px;
}

.pref-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

.pref-grid {
  display: grid;
  gap: 10px;
  width: 100%;
}

.pref-grid-2 { grid-template-columns: repeat(2, 1fr); }
.pref-grid-3 { grid-template-columns: repeat(3, 1fr); }

.pref-card {
  position: relative;
  padding: 14px 14px 14px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.18s, background 0.18s;
  background: var(--bg);
}

.pref-card:hover {
  border-color: rgba(196, 113, 74, 0.4);
}

.pref-card.selected {
  border-color: #C4714A;
  background: rgba(196, 113, 74, 0.06);
}

.pref-card-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, border-color 0.18s;
  flex-shrink: 0;
}

.pref-card.selected .pref-card-check {
  background: #C4714A;
  border-color: #C4714A;
}

.pref-card-check svg {
  width: 9px;
  height: 7px;
  opacity: 0;
  transition: opacity 0.18s;
}

.pref-card.selected .pref-card-check svg {
  opacity: 1;
}

.pref-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0 22px 3px 0;
  color: var(--text);
}

.pref-card-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

.pref-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.pref-save-btn {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 28px;
  background: #C4714A;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.pref-save-btn:hover { opacity: 0.85; }
.pref-save-btn:disabled { opacity: 0.5; cursor: default; }

.pref-save-status {
  font-size: 0.85rem;
  margin: 0;
}

/* ── Settings list ──────────────────────────────────────────────────────────── */

.settings-list {
  display: flex;
  flex-direction: column;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.settings-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-row:first-child {
  padding-top: 0;
}

.settings-label {
  font-size: 14px;
  color: var(--text);
}

.toggle-switch {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 20px;
  border: none;
  border-radius: 999px;
  background: var(--border);
  cursor: pointer;
  padding: 0;
  transition: background-color 0.25s ease;
}

.toggle-switch[aria-checked="true"] {
  background: var(--terracotta);
}

.toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s ease;
}

.toggle-switch[aria-checked="true"] .toggle-knob {
  transform: translateX(16px);
}

body.compact-view .in-the-wild,
body.compact-view .pronunciation,
body.compact-view .hear-it {
  display: none;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-input {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  width: 100%;
  box-sizing: border-box;
}

.auth-input:focus {
  outline: none;
  border-color: var(--terracotta);
}

.auth-password-wrap {
  position: relative;
}

.auth-password-wrap .auth-input {
  padding-right: 42px;
}

.auth-eye-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  border: none;
  background: none;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
}

.eye-icon {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.eye-icon.hidden {
  display: none;
}

.auth-error {
  font-size: 13px;
  color: var(--terracotta);
  margin: 0;
  opacity: 0;
}

.auth-error.hidden {
  display: none;
}

.auth-error.fade-in {
  animation: authErrorIn 0.3s ease forwards;
}

.auth-submit {
  position: relative;
  overflow: hidden;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--terracotta);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.3s ease, background-color 0.3s ease;
}

.auth-submit:hover:not(:disabled) {
  opacity: 0.9;
}

.auth-submit:disabled {
  cursor: default;
}

/* Loading */
.auth-submit.loading {
  pointer-events: none;
}

.auth-submit.loading .btn-text {
  opacity: 0;
}

.auth-submit.loading .btn-spinner {
  opacity: 1;
}

/* Success */
.auth-submit.success {
  background: #9e5428;
  pointer-events: none;
}

.auth-submit.success .btn-text,
.auth-submit.success .btn-spinner {
  opacity: 0;
}

.auth-submit.success .btn-checkmark {
  opacity: 1;
}

/* Shake */
.auth-submit.shake {
  animation: authShake 0.4s ease;
}

.btn-text {
  transition: opacity 0.3s ease;
}

.btn-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-spinner::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-checkmark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-checkmark svg {
  width: 18px;
  height: 18px;
}

/* Field states */
.auth-input {
  transition: border-color 0.3s ease, opacity 0.3s ease;
}

.auth-input.field-muted {
  opacity: 0.45;
}

.auth-input.field-error {
  border-color: #c4554d;
}

/* Inline form error */
.login-form-error {
  font-size: 13px;
  color: var(--terracotta);
  margin: 6px 0 0;
  min-height: 1.3em;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.login-form-error.visible {
  opacity: 1;
  transform: translateY(0);
}

.auth-toast {
  position: fixed;
  top: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  padding: 14px 24px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: var(--text);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.auth-toast.hidden {
  display: none;
}

.auth-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.label {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #999;
  font-weight: 500;
}

.masthead {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.masthead-word {
  font-weight: 800;
  color: var(--terracotta);
  margin-right: 0.4em;
}

.masthead-rest {
  font-weight: 400;
  color: #1a1a1a;
}

html[data-theme="dark"] .masthead-rest {
  color: #888;
}

.masthead-logo-link {
  display: flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
}

.masthead-logo {
  height: 52px;
  width: auto;
  flex-shrink: 0;
  display: block;
}

.masthead-line {
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

html[data-theme="dark"] .masthead-line {
  background: #333;
}

.accent-bar {
  width: 40px;
  height: 3px;
  background: var(--terracotta);
  margin: 10px 0 8px 0;
}

.word-image {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  outline: none;
  box-shadow: none;
  vertical-align: top;
  transition: filter 0.6s ease;
}


.word-image.loaded {
  display: inline-block;
}

#word {
  font-family: 'Fraunces', serif;
  font-size: clamp(4.5rem, 9vw, 6rem);
  font-weight: 700;
  text-transform: lowercase;
  line-height: 1.05;
  color: #1a1a1a;
  margin-bottom: 16px;
}

html[data-theme="dark"] #word {
  color: #f0ece4;
}

.ipa {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 300;
  font-size: 15px;
  color: #aaa;
  letter-spacing: 0.02em;
}

.pos {
  color: var(--muted);
  font-style: italic;
  font-size: 12px;
}

.definition {
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.7;
}

.divider {
  border: none;
  border-top: 1px solid #eee;
}

.etymology {
  border-left: 2px solid var(--terracotta);
  padding: 0 0 0 16px;
  text-align: left;
}

.etymology-label {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.etymology-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.example {
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  font-style: italic;
}

.example::before, .example::after {
  content: '"';
}

.source {
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}

.date {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.date::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 2px;
  background: #C4714A;
  flex-shrink: 0;
}

.error {
  color: #c4554d;
}

.in-the-wild {
  width: 100%;
  padding: 64px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

.section-label {
  margin: 0 0 48px;
  text-align: center;
}

.section-rule {
  border: none;
  border-top: 1px solid var(--border);
  width: 100%;
  max-width: 1200px;
  margin: 0 0 48px;
}

.in-the-wild .section-rule:last-child {
  margin: 48px 0 0;
}

.wild-cards {
  display: flex;
  gap: 48px;
  max-width: 1200px;
  width: 100%;
}

.wild-card {
  flex: 1;
  padding: 0 0 0 48px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 20px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.wild-card:first-child {
  padding-left: 0;
  border-left: none;
}

.wild-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.wild-pub {
  margin: 0;
  font-family: 'Fraunces', serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.wild-excerpt {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  font-style: italic;
  color: var(--text);
  flex: 1;
}

.wild-excerpt em {
  font-style: italic;
  font-weight: 600;
}

.wild-source {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.pronunciation {
  width: 100%;
  padding: 0 64px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

.pronunciation .section-label {
  width: 100%;
  max-width: 800px;
  text-align: left;
}

.pronunciation.hidden {
  display: none;
}

.pronunciation-row {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 800px;
}

.audio-player {
  display: flex;
  align-items: center;
  gap: 20px;
}

.rating-spacer {
  flex: 1;
}

.rating {
  display: flex;
  align-items: flex-start;
  gap: 28px;
}

.rating-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.thumb-btn {
  border: none;
  background: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.thumb-btn svg {
  width: 20px;
  height: 20px;
}

.thumb-btn.active,
.thumb-btn:hover {
  color: var(--terracotta);
}

.rating-count {
  font-size: 11px;
  color: var(--muted);
}

.pronunciation-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--terracotta);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(196, 113, 74, 0.35);
}

.pronunciation-btn:hover {
  transform: scale(1.05);
}

.pronunciation-btn .icon {
  width: 18px;
  height: 18px;
}

.pronunciation-btn .icon.hidden {
  display: none;
}

.waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 40px;
}

.waveform .bar {
  width: 3px;
  border-radius: 2px;
  --fill: 0;
  background: linear-gradient(to top, var(--terracotta) calc(var(--fill) * 100%), var(--border) calc(var(--fill) * 100%));
}

.hear-it {
  width: 100%;
  padding: 0 64px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

.hear-it.hidden {
  display: none;
}

#youglish-widget {
  width: 100%;
  max-width: 800px;
}

#main-content.hidden {
  display: none;
}

.subpage {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.subpage.hidden {
  display: none;
}

.subpage-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 28px 48px;
  border-bottom: 1px solid var(--border);
}

.subpage-back {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.subpage-back:hover {
  color: var(--terracotta);
}

.subpage-back svg {
  width: 22px;
  height: 22px;
}

.subpage-logo {
  height: 44px;
  width: auto;
}

.subpage-title {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
}

.subpage-body {
  padding: 48px;
  max-width: 600px;
  width: 100%;
}

@media (max-width: 820px) {
  .layout { height: auto; flex-direction: column; padding: 48px 0; gap: 0; }
  .col-image, .col-text { max-width: 100%; flex: 1 1 auto; }
  .col-text { height: auto; }
  #word { font-size: 3rem; }
  .in-the-wild { padding: 64px 24px; }
  .wild-cards { flex-direction: column; }
}

/* === Premium auth animations === */

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-5px); }
  80%       { transform: translateX(5px); }
}

@keyframes authErrorIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes checkmarkCircle {
  from { stroke-dashoffset: 157; }
  to   { stroke-dashoffset: 0; }
}

@keyframes checkmarkFill {
  0%, 50% { opacity: 0; }
  100%    { opacity: 1; }
}

@keyframes checkmarkTick {
  from { stroke-dashoffset: 42; }
  to   { stroke-dashoffset: 0; }
}

.auth-modal-card.shake {
  animation: authShake 0.4s ease;
}

.auth-modal-title,
.auth-form {
  transition: opacity 0.3s ease;
}

.auth-success-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: var(--card);
}

.auth-success-icon.visible {
  opacity: 1;
}

.checkmark-svg {
  width: 84px;
  height: 84px;
  overflow: visible;
}

.checkmark-fill {
  opacity: 0;
}

.checkmark-fill.animate {
  animation: checkmarkFill 0.85s ease forwards;
}

.checkmark-circle {
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  transform-origin: 26px 26px;
  transform: rotate(-90deg);
}

.checkmark-circle.animate {
  animation: checkmarkCircle 0.5s ease forwards;
}

.checkmark-tick {
  stroke-dasharray: 42;
  stroke-dashoffset: 42;
}

.checkmark-tick.animate {
  animation: checkmarkTick 0.38s ease forwards 0.48s;
}

/* Premium top-right toast */
.premium-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
  padding: 14px 20px;
  font-family: 'Fraunces', serif;
  font-size: 14px;
  color: var(--text);
  z-index: 300;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
  max-width: 320px;
  line-height: 1.5;
}

.premium-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* CTA banner */
.cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-left: -112px;
  margin-right: -64px;
  padding: 0 64px 0 112px;
  height: 44px;
  background: rgba(196, 113, 74, 0.12);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.cta-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cta-icon {
  width: 16px;
  height: 16px;
  color: var(--terracotta);
  flex-shrink: 0;
}

.cta-banner.hidden {
  display: none;
}

.cta-banner.visible {
  opacity: 1;
}

.cta-text {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: 'Inter', system-ui, sans-serif;
  font-style: normal;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cta-btn {
  flex-shrink: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 18px;
  background: #C4714A;
  color: #fff;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: opacity 0.2s ease;
}

.cta-btn:hover {
  opacity: 0.85;
}

/* Signup standalone page */
.signup-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  transition: background-color 1.4s ease;
}

.signup-card {
  position: relative;
  background: var(--card);
  border-radius: 16px;
  padding: 48px 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  transition: background-color 1.4s ease;
}

.signup-masthead {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-bottom: 36px;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: opacity 0.3s ease;
}

.signup-title {
  font-family: 'Fraunces', serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  margin: 0 0 28px;
  transition: opacity 0.3s ease, color 1.4s ease;
}

.signup-signin-link {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin: 20px 0 0;
  transition: opacity 0.3s ease;
}

.signup-signin-link a {
  color: var(--terracotta);
  text-decoration: none;
  font-weight: 500;
}

.signup-signin-link a:hover {
  text-decoration: underline;
}

/* === Auth split pages (login.html / signup.html) === */

.auth-page-wrapper {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
  transition: background-color 1.4s ease;
}

.auth-split-left {
  position: relative;
  flex: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 48px;
  background: var(--bg);
  transition: background-color 1.4s ease;
}

.auth-split-left .auth-success-icon {
  background: var(--bg);
  border-radius: 0;
  transition: opacity 0.3s ease, background-color 1.4s ease;
}

.auth-split-left-inner {
  width: 100%;
  max-width: 360px;
  transition: opacity 0.3s ease;
}

.auth-split-right {
  flex: 0 0 50%;
  min-height: 100vh;
  background: linear-gradient(150deg, #cd7a52 0%, #7e3916 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 64px;
}

.auth-split-right-inner {
  max-width: 340px;
  width: 100%;
}

/* Theme toggle on auth pages */
.auth-theme-toggle {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 20;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: color 0.2s ease;
}

.auth-theme-toggle:hover { color: var(--text); }

.auth-theme-toggle .theme-icon { width: 18px; height: 18px; }

/* Logo on auth pages */
.auth-logo {
  display: block;
  text-decoration: none;
  margin-bottom: 36px;
}

.auth-logo .masthead-rest {
  color: var(--muted);
  transition: color 1.4s ease;
}

/* Headlines */
.auth-headline {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 28px;
  line-height: 1.2;
  transition: opacity 0.3s ease, color 1.4s ease;
}

/* Switch link (already have account / no account yet) */
.auth-switch-link {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin: 20px 0 0;
  transition: opacity 0.3s ease;
}

.auth-switch-link a {
  color: var(--terracotta);
  text-decoration: none;
  font-weight: 500;
}

.auth-switch-link a:hover { text-decoration: underline; }

/* Right panel */
.auth-right-eyebrow {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 248, 240, 0.5);
  margin: 0 0 12px;
}

.auth-right-headline {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: rgba(255, 248, 240, 0.97);
  margin: 0 0 40px;
  line-height: 1.3;
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.auth-feature {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.auth-feature-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

.auth-feature-text {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 248, 240, 0.88);
  line-height: 1.45;
}

/* Numbered steps */
.auth-steps {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 36px;
}

.auth-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.auth-step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 248, 240, 0.15);
  border: 1px solid rgba(255, 248, 240, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 248, 240, 0.95);
  margin-top: 1px;
}

.auth-step-text {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  color: rgba(255, 248, 240, 0.82);
  line-height: 1.55;
  padding-top: 3px;
}

/* Streak mockup */
.streak-mockup {
  background: rgba(255, 248, 240, 0.08);
  border: 1px solid rgba(255, 248, 240, 0.18);
  border-radius: 12px;
  padding: 18px 22px;
}

.streak-mockup-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 248, 240, 0.45);
  margin: 0 0 12px;
}

.streak-dots {
  display: flex;
  gap: 7px;
  align-items: center;
}

.streak-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 248, 240, 0.1);
  border: 1px solid rgba(255, 248, 240, 0.2);
}

.streak-dot.done {
  background: rgba(255, 248, 240, 0.88);
  border-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #9b4e2a;
  font-weight: 700;
}

.streak-day-labels {
  display: flex;
  gap: 7px;
  margin-top: 7px;
}

.streak-day-label {
  width: 30px;
  text-align: center;
  font-size: 10px;
  color: rgba(255, 248, 240, 0.38);
  font-family: 'Inter', system-ui, sans-serif;
}

@media (max-width: 768px) {
  .auth-split-right { display: none; }
  .auth-split-left { padding: 40px 24px; }
}

.auth-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 28px;
  transition: color 0.2s ease;
}

.auth-back-btn:hover {
  color: var(--text);
}

.auth-back-btn svg {
  width: 15px;
  height: 15px;
}
