/*
 * Auth screen styles.
 * Aligned with the ChatBoba quiet-confidence visual system.
 */

/* ── Email verification banner ─────────────────────────────────────────────── */
.verification-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 14px;
  background: #2a2315;
  border-bottom: 1px solid #4a3b1a;
  font-family: Inter, system-ui, sans-serif;
  font-size: 13px;
  color: #c9a96a;
  line-height: 1.4;
}

.verification-banner[hidden] { display: none; }

.verification-banner-text {
  flex: 1;
  min-width: 0;
}

.verification-banner-resend {
  background: transparent;
  border: 1px solid #6b5129;
  border-radius: 999px;
  color: #c9a96a;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  padding: 3px 12px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s;
}

.verification-banner-resend:hover:not(:disabled) {
  background: #352a14;
  border-color: #9c7940;
}

.verification-banner-resend:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#auth-screen,
.reset-page {
  --auth-bg: #0f0f0e;
  --auth-bg-2: #151514;
  --auth-bg-3: #1b1a18;
  --auth-line: rgba(255, 255, 255, 0.07);
  --auth-line-faint: rgba(255, 255, 255, 0.045);
  --auth-fg: #f5efe6;
  --auth-fg-2: #c7bfb4;
  --auth-fg-3: #8b8379;
  --auth-fg-4: #5f5851;
  --auth-amber: #d8b66c;
  --auth-green: #7dc4a0;
  --auth-danger: #ff9d8f;
  color-scheme: dark;
}

#auth-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 28px 32px calc(24px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  background: var(--auth-bg);
  color: var(--auth-fg);
  font-family: Inter, system-ui, sans-serif;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 1000;
  -webkit-font-smoothing: antialiased;
  -webkit-overflow-scrolling: touch;
}
#auth-screen.hidden { display: none; }

.auth-brand,
.reset-brand {
  position: absolute;
  top: 28px;
  left: 32px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--auth-fg);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
}

.auth-brand .landing-cup,
.reset-brand .landing-cup {
  width: 48px;
  height: 42px;
  display: inline-flex;
  color: var(--auth-amber);
  flex: 0 0 auto;
  overflow: hidden;
  background: url("/assets/chatboba-icon.png") left center / auto 132% no-repeat;
}

.auth-brand .landing-cup svg,
.reset-brand .landing-cup svg {
  display: none;
  width: 100%;
  height: 100%;
}

.auth-brand .landing-cup path,
.auth-brand .landing-cup rect,
.reset-brand .landing-cup path,
.reset-brand .landing-cup rect {
  fill: var(--auth-bg-3);
  stroke: currentColor;
  stroke-width: 1.8;
}

.auth-brand .landing-cup .cup-straw,
.reset-brand .landing-cup .cup-straw {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.auth-brand .landing-cup circle,
.reset-brand .landing-cup circle {
  fill: var(--auth-fg-4);
}

#auth-box,
.reset-card {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 34px 32px 30px;
  box-sizing: border-box;
  border: 1px solid var(--auth-line-faint);
  border-radius: 14px;
  background: var(--auth-bg-2);
  box-shadow: none;
}

#auth-screen .auth-brand {
  position: static;
  align-self: flex-start;
  flex: 0 0 auto;
}

#auth-screen #auth-box {
  align-self: center;
  margin: clamp(34px, 8vh, 74px) auto clamp(30px, 6vh, 58px);
}

#auth-box > *,
.reset-card > * {
  flex: 0 0 auto;
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--auth-fg-3);
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.auth-kicker .landing-pearl {
  width: 6px;
  height: 6px;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--auth-amber);
  opacity: 0.72;
}

#auth-box h2,
.reset-card h1 {
  margin: 0;
  color: var(--auth-fg);
  font-size: clamp(31px, 4.5vw, 38px);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.auth-note,
.reset-card p {
  margin: -2px 0 8px;
  color: var(--auth-fg-2);
  font-size: 14px;
  line-height: 1.65;
}

.auth-note { display: block; }

#auth-box input,
.reset-card input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 239, 230, 0.14);
  border-radius: 10px;
  background: rgba(245, 239, 230, 0.045);
  color: var(--auth-fg);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.35;
  box-sizing: border-box;
  outline: none;
}

#auth-box input.hidden {
  display: none;
}

#auth-box input::placeholder,
.reset-card input::placeholder {
  color: rgba(199, 191, 180, 0.74);
}

#auth-box input:focus,
.reset-card input:focus {
  border-color: rgba(216, 182, 108, 0.72);
  background: rgba(245, 239, 230, 0.065);
}

#auth-box button,
.reset-card button,
.reset-card a.reset-button {
  min-height: 44px;
  padding: 10px 17px;
  border-radius: 999px;
  border: 1px solid var(--auth-line);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

#auth-submit,
#reset-submit,
.reset-button {
  margin-top: 8px;
  background: var(--auth-fg);
  color: var(--auth-bg);
  border-color: var(--auth-fg);
}
#auth-submit:hover,
#reset-submit:hover,
.reset-button:hover {
  background: #fff8ed;
  border-color: #fff8ed;
}

.auth-forgot {
  align-self: flex-end;
  min-height: 0 !important;
  margin: -4px 0 0;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--auth-fg-3) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  box-shadow: none !important;
}
.auth-forgot:hover {
  color: var(--auth-fg) !important;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.auth-forgot.hidden {
  display: none;
}

.auth-reset-panel {
  display: grid;
  gap: 12px;
  padding: 16px 0 2px;
  border-top: 1px solid var(--auth-line-faint);
  background: transparent;
}
.auth-reset-panel.hidden {
  display: none;
}
.auth-reset-panel p {
  margin: 0;
  color: var(--auth-fg-2);
  font-size: 14px;
  line-height: 1.6;
}
.auth-reset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
#auth-box .auth-reset-send {
  flex: 1 1 170px;
  min-height: 42px;
  background: rgba(216, 182, 108, 0.12);
  color: var(--auth-fg);
  border-color: rgba(216, 182, 108, 0.24);
}
#auth-box .auth-reset-send:hover {
  background: rgba(216, 182, 108, 0.18);
  border-color: rgba(216, 182, 108, 0.38);
}
#auth-box .auth-reset-cancel {
  flex: 0 0 auto;
  min-height: 42px;
  background: transparent;
  color: var(--auth-fg-3);
  border-color: var(--auth-line);
}
#auth-box .auth-reset-cancel:hover {
  color: var(--auth-fg);
  border-color: rgba(255, 255, 255, 0.14);
}
.auth-reset-status,
.reset-status {
  min-height: 18px;
  color: var(--auth-amber);
  font-size: 13px;
  line-height: 1.4;
}

.auth-switch {
  margin: 0;
  padding-top: 4px;
  color: var(--auth-fg-3);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}
.auth-switch.hidden {
  display: none;
}
#auth-toggle  {
  min-height: 0;
  padding: 0;
  margin-left: 5px;
  border: 0;
  background: transparent;
  color: var(--auth-fg);
  font-size: inherit;
  font-weight: 500;
  text-decoration: none;
}
#auth-toggle:hover  {
  color: var(--auth-amber);
  text-decoration: underline;
  text-underline-offset: 4px;
}
#auth-error {
  min-height: 18px;
  color: var(--auth-danger);
  font-size: 13px;
  line-height: 1.4;
}

.auth-pw-hint {
  margin: -6px 0 0;
  font-size: 12px;
  color: var(--auth-fg-4);
  line-height: 1.35;
  transition: color 0.15s;
}
.auth-pw-hint.hidden { display: none; }
.auth-pw-hint.warn   { color: var(--auth-amber); }
.auth-pw-hint.ok     { color: var(--auth-green); }

.reset-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--auth-bg);
  color: var(--auth-fg);
  font-family: Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.reset-shell {
  flex: 1 0 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 104px 24px 44px;
  box-sizing: border-box;
}

#reset-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#reset-submit:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.reset-status.is-error {
  color: var(--auth-danger);
}

.reset-button {
  width: min(300px, 100%);
  align-self: center;
  box-sizing: border-box;
  padding-block: 9px;
  text-align: center;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.user-bar-logout {
  font-size: 12px;
  padding: 3px 8px;
  background: transparent;
  border: 1px solid #374151;
  border-radius: 4px;
  color: #9ca3af;
  cursor: pointer;
}
.user-bar-logout:hover { color: #f3f4f6; border-color: #6b7280; }

@media (max-width: 520px) {
  #auth-screen {
    align-items: flex-start;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 18px 16px calc(22px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
  }

  #auth-screen .auth-brand {
    position: static;
    top: auto;
    left: auto;
  }

  .reset-brand {
    top: 18px;
    left: 18px;
  }

  .reset-shell {
    align-items: flex-start;
    min-height: 0;
    padding: 86px 16px 28px;
    overflow-y: visible;
  }

  #auth-box,
  .reset-card {
    width: 100%;
    max-width: 430px;
    max-height: none;
    margin: 28px auto 24px;
    padding: 28px 22px 24px;
    border-radius: 12px;
    overflow: visible;
  }

  #auth-screen #auth-box {
    margin: 28px auto 24px;
  }

  #auth-box h2,
  .reset-card h1 {
    font-size: 31px;
  }

  .auth-reset-actions {
    flex-direction: column;
  }

  #auth-box .auth-reset-send,
  #auth-box .auth-reset-cancel {
    flex-basis: auto;
    width: 100%;
  }
}
