/* Deikno — auth modal, nav account state, credits page (BRIEF #86 §7).
 * Tokens follow site/css/plan.css so the flow reads as one product. */

:root {
  --auth-ink-strong: #26202f;
  --auth-ink: #374151;
  --auth-ink-muted: #6b7280;
  --auth-line: #e6e6e6;
  --auth-primary: #217580;
  --auth-primary-strong: #1a6370;
  --auth-primary-soft: #eaf6f7;
  --auth-negative: #a95745;
  --auth-negative-soft: #fbefec;
}

/* ---- Modal ---- */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(38, 32, 47, 0.55);
}
.auth-overlay[hidden] { display: none; }

.auth-modal {
  width: 100%;
  max-width: 380px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 24px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--auth-ink);
}

.auth-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.auth-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--auth-ink-strong);
}
.auth-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--auth-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--auth-ink-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.auth-close:hover { color: var(--auth-ink-strong); border-color: var(--auth-ink-muted); }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin-bottom: 16px;
  background: #f4f1ec;
  border-radius: 100px;
}
.auth-tab {
  min-height: 34px;
  border: none;
  border-radius: 100px;
  background: transparent;
  color: var(--auth-ink-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.auth-tab[aria-selected="true"] {
  background: #ffffff;
  color: var(--auth-primary-strong);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.auth-field { margin-bottom: 12px; }
.auth-label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 650;
  color: var(--auth-ink);
}
.auth-input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--auth-line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--auth-ink-strong);
  font-family: inherit;
  font-size: 14px;
}
.auth-input:focus-visible { outline: 2px solid var(--auth-primary); outline-offset: 1px; }

.auth-bonus {
  margin: 0 0 14px;
  padding: 9px 12px;
  background: var(--auth-primary-soft);
  border-left: 3px solid var(--auth-primary);
  border-radius: 0 8px 8px 0;
  font-size: 12px;
  color: var(--auth-ink);
}
.auth-bonus[hidden] { display: none; }

.auth-error {
  margin: 0 0 12px;
  padding: 9px 12px;
  background: var(--auth-negative-soft);
  border-radius: 8px;
  color: var(--auth-negative);
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.auth-error[hidden] { display: none; }

.auth-submit {
  width: 100%;
  min-height: 44px;
  border: none;
  border-radius: 100px;
  background: var(--auth-primary);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.auth-submit:hover:not(:disabled) { background: var(--auth-primary-strong); }
.auth-submit:disabled { background: #9ca3af; cursor: not-allowed; }

.auth-note {
  margin: 12px 0 0;
  font-size: 11px;
  color: var(--auth-ink-muted);
  line-height: 1.5;
}

/* ---- Nav account state ---- */
/* min-height reserves the row so swapping signed-out for signed-in does not
   shift the header once /api/auth/me answers. */
.nav-account {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
}
.nav-account[hidden] { display: none; }
.nav-account [hidden] { display: none; }

.nav-signin {
  border: 1px solid var(--auth-line);
  border-radius: 100px;
  padding: 8px 16px;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.nav-signin:hover { border-color: var(--auth-primary); color: var(--auth-primary); }

.nav-balance {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 100px;
  background: var(--auth-primary-soft);
  color: var(--auth-primary-strong);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.nav-account-menu { position: relative; }
.nav-avatar {
  width: 34px;
  height: 34px;
  border: 1px solid var(--auth-line);
  border-radius: 50%;
  background: #ffffff;
  color: var(--auth-primary-strong);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}
.nav-avatar:hover { border-color: var(--auth-primary); }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  min-width: 190px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}
.nav-dropdown[hidden] { display: none; }
.nav-dropdown-email {
  display: block;
  padding: 7px 10px 9px;
  border-bottom: 1px solid var(--auth-line);
  margin-bottom: 5px;
  color: var(--auth-ink-muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.nav-dropdown-item {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--auth-ink);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.nav-dropdown-item:hover { background: #f4f1ec; color: var(--auth-ink-strong); }

/* ---- Toast ---- */
.auth-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1100;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  border-radius: 100px;
  background: var(--auth-ink-strong);
  color: #ffffff;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.auth-toast[hidden] { display: none; }

@media (max-width: 480px) {
  .auth-modal { padding: 20px; }
  .nav-balance { font-size: 11px; padding: 4px 9px; }
}
