/* ── AskAncients Auth Page ──
   Parchment-themed auth (login / signup / reset).
   Loads after shared.css.
*/

body.auth-body {
  background: #f7f0e3 url('../images/hub-bg.jpg') center / cover no-repeat fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-shell {
  max-width: 400px;
  width: 100%;
  text-shadow: 0 0 8px rgba(255, 248, 235, 0.6);
}

.auth-brand {
  text-align: center;
  margin-bottom: 32px;
}

.auth-brand-title {
  font-size: 24px;
  font-weight: 700;
  color: #3d3225;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.auth-brand-sub {
  font-size: 14px;
  color: rgba(61, 50, 37, 0.65);
  line-height: 1.5;
}

.auth-card {
  background: rgba(255, 250, 240, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(160, 140, 110, 0.25);
  border-radius: 14px;
  padding: 32px 28px;
}

/* Tab switcher */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(160, 140, 110, 0.2);
}

.auth-tab {
  flex: 1;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  color: rgba(61, 50, 37, 0.4);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s, border-color 0.2s;
  text-align: center;
}

.auth-tab:hover {
  color: rgba(61, 50, 37, 0.6);
}

.auth-tab.active {
  color: #8b6914;
  border-bottom-color: #b8860b;
}

/* Forms */
.auth-form {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.auth-form.active {
  display: flex;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(61, 50, 37, 0.65);
}

.auth-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(160, 140, 110, 0.3);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #3d3225;
  background: rgba(255, 255, 255, 0.6);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.auth-input:focus {
  outline: none;
  border-color: #b8860b;
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1);
}

.auth-input::placeholder {
  color: rgba(61, 50, 37, 0.35);
}

.auth-submit {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #b8860b 0%, #8b6914 100%);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  min-height: 44px;
}

.auth-submit:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.auth-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(61, 50, 37, 0.35);
  font-size: 12px;
  font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(160, 140, 110, 0.2);
}

/* Google button */
.auth-google-btn {
  width: 100%;
  padding: 11px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid rgba(160, 140, 110, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  color: #3d3225;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
}

.auth-google-btn:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(160, 140, 110, 0.4);
}

.auth-google-btn svg {
  flex-shrink: 0;
}

/* Error / success messages */
.auth-message {
  display: none;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 8px;
  text-align: center;
}

.auth-message.error {
  display: block;
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.auth-message.success {
  display: block;
  background: rgba(22, 163, 106, 0.08);
  color: #16a34a;
  border: 1px solid rgba(22, 163, 106, 0.2);
}

/* Forgot password link */
.auth-forgot {
  font-size: 12.5px;
  color: #8b6914;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
  text-align: right;
}

.auth-forgot:hover {
  text-decoration: underline;
}

/* Reset password form extras */
.auth-back-to-login {
  font-size: 13px;
  color: #8b6914;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
  text-align: center;
}

.auth-back-to-login:hover {
  text-decoration: underline;
}

/* Logout button (injected by auth-guard.js) */
.auth-logout-btn {
  font-size: 12px;
  font-weight: 500;
  color: rgba(61, 50, 37, 0.5);
  background: none;
  border: 1px solid rgba(160, 140, 110, 0.25);
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.auth-logout-btn:hover {
  color: rgba(61, 50, 37, 0.7);
  border-color: rgba(160, 140, 110, 0.4);
}

/* Password requirements hint */
.auth-hint {
  font-size: 11.5px;
  color: rgba(61, 50, 37, 0.4);
  line-height: 1.4;
}

/* Legal consent line */
.auth-legal-line {
  font-size: 12px;
  color: rgba(61, 50, 37, 0.45);
  text-align: center;
  line-height: 1.5;
  margin: 0;
}

.auth-legal-line a {
  color: #8b6914;
  text-decoration: none;
}

.auth-legal-line a:hover {
  text-decoration: underline;
}

/* Mobile */
@media (max-width: 480px) {
  .auth-card {
    padding: 24px 20px;
  }

  .auth-brand-title {
    font-size: 22px;
  }
}

/* ── Guest mode: "try as guest" CTA (auth card) ── */
.auth-guest-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.auth-guest-btn {
  width: 100%;
  padding: 11px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: 1px dashed rgba(160, 140, 110, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.35);
  color: #8b6914;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  min-height: 44px;
}

.auth-guest-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(160, 140, 110, 0.7);
}

.auth-guest-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-guest-note {
  font-size: 11.5px;
  color: rgba(61, 50, 37, 0.45);
  text-align: center;
  line-height: 1.4;
}

/* ── Guest mode: convert form (guest -> registered free) ── */
.auth-convert-intro {
  margin-bottom: 4px;
}

.auth-convert-title {
  font-size: 17px;
  font-weight: 700;
  color: #3d3225;
  margin-bottom: 6px;
}

.auth-convert-sub {
  font-size: 13px;
  color: rgba(61, 50, 37, 0.65);
  line-height: 1.5;
  margin: 0;
}

.auth-convert-existing {
  font-size: 12.5px;
  color: rgba(61, 50, 37, 0.55);
  text-align: center;
  line-height: 1.5;
  margin: 0;
}

.auth-inline-link {
  font-size: 12.5px;
  font-weight: 600;
  color: #8b6914;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
}

.auth-inline-link:hover {
  color: #6b5a3e;
}

.auth-convert-warn {
  color: rgba(61, 50, 37, 0.4);
}
