/* auth-modal.css — Bottom-sheet auth modal for Anuenue
   [INIT-191][bd-191-b]
   Uses the same CSS custom properties as foreveriz.scss (--bg, --card, --accent, --text, --muted).
   Gold/dark-aware. */

/* ── Overlay ────────────────────────────────────────────────────── */

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  transition: background 0.3s ease;
}

.auth-overlay.auth-visible {
  background: rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

/* ── Sheet ───────────────────────────────────────────────────────── */

.auth-sheet {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--card, #1c1c28);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 24px 28px 32px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 40px rgba(0, 0, 0, 0.3);
}

.auth-visible .auth-sheet {
  transform: translateY(0);
}

/* ── Handle (drag indicator) ─────────────────────────────────────── */

.auth-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--muted, #9a9890);
  border-radius: 2px;
  margin: 0 auto 16px;
  opacity: 0.4;
}

/* ── Close button ────────────────────────────────────────────────── */

.auth-sheet-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: var(--muted, #9a9890);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
}

.auth-sheet-close:hover {
  color: var(--text, #e8e6e1);
}

/* ── Title / Subtitle ────────────────────────────────────────────── */

.auth-sheet-title {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent, #c4a04a);
  margin-bottom: 4px;
  text-align: center;
}

.auth-sheet-subtitle {
  font-size: 0.9rem;
  color: var(--muted, #9a9890);
  text-align: center;
  margin-bottom: 24px;
}

/* ── Form ────────────────────────────────────────────────────────── */

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

.auth-field label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #9a9890);
  margin-bottom: 6px;
}

.auth-field input {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  color: var(--text, #e8e6e1);
  background: var(--bg, #0a0a10);
  border: 1px solid rgba(196, 160, 74, 0.2);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.auth-field input:focus {
  border-color: var(--accent, #c4a04a);
  box-shadow: 0 0 0 2px rgba(196, 160, 74, 0.15);
}

.auth-field input::placeholder {
  color: var(--muted, #9a9890);
  opacity: 0.5;
}

/* ── Submit button ───────────────────────────────────────────────── */

.auth-sheet-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  color: #0a0a10;
  background: var(--accent, #c4a04a);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.auth-sheet-button:hover {
  background: #dfc87a;
  transform: translateY(-1px);
}

.auth-sheet-button:active {
  transform: translateY(0);
}

.auth-sheet-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-sheet-button.auth-loading {
  opacity: 0.7;
}

.auth-btn-icon {
  font-size: 1.1em;
}

/* ── Error message ───────────────────────────────────────────────── */

.auth-sheet-error {
  font-size: 0.85rem;
  color: #e05555;
  text-align: center;
  min-height: 1.2em;
}

.auth-sheet-error:empty {
  display: none;
}

/* ── Toggle (register/login switch) ──────────────────────────────── */

.auth-sheet-toggle {
  text-align: center;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--muted, #9a9890);
}

.auth-toggle-link {
  background: none;
  border: none;
  color: var(--accent, #c4a04a);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-family: inherit;
}

.auth-toggle-link:hover {
  color: #dfc87a;
}

/* ── Desktop: centered card instead of bottom-sheet ──────────────── */

@media (min-width: 601px) {
  .auth-overlay {
    align-items: center;
  }

  .auth-sheet {
    border-radius: 16px;
    max-width: 400px;
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease;
  }

  .auth-visible .auth-sheet {
    transform: translateY(0);
    opacity: 1;
  }

  .auth-sheet-handle {
    display: none;
  }
}
