*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: #0F172A url('/assets/vivacantus_loginimage2.webp') center center / cover no-repeat fixed;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* ── Top-right nav ── */
.login-nav {
  position: fixed;
  top: 20px;
  right: 24px;
  display: flex;
  gap: 10px;
  z-index: 10;
}

.login-nav-btn {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.88rem;
  font-family: inherit;
  padding: 8px 18px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.login-nav-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.login-nav-btn--primary {
  background: #FFD463;
  border-color: #FFD463;
  color: #0F172A;
  font-weight: 600;
}

.login-nav-btn--primary:hover {
  background: #FFD463;
  border-color: #FFD463;
}

/* ── Hero ── */
.login-outer {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.login-logo-above {
  display: block;
  width: clamp(90px, 20vw, 660px);
  height: auto;
  object-fit: contain;
  margin: 0 auto 48px;
}

.login-verse {
  text-align: center;
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.35;
  font-style: italic;
  max-width: 560px;
  margin: 0 auto 28px;
  text-wrap: balance;
}


.login-verse-ref {
  display: block;
  margin-top: 8px;
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  font-style: italic;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
}

/* ── Auth modal ── */
.auth-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

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

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

.login-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: #0F172A;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  padding: 40px 36px 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
  transition: color 0.15s;
}

.auth-modal-close:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* ── Tabs ── */

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

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

.auth-form label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 6px;
}

.auth-form input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.95rem;
  font-family: inherit;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s;
}

.auth-form input:focus {
  border-color: rgba(201,162,39,0.6);
}

.auth-error {
  font-size: 0.82rem;
  color: #e07070;
  min-height: 1.1em;
  margin-top: 2px;
}

.auth-submit {
  margin-top: 10px;
  background: #FFD463;
  color: #0F172A;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 600;
  padding: 11px;
  cursor: pointer;
  transition: background 0.15s;
}

.auth-submit:hover {
  background: #e8c059;
}

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

.auth-switch {
  margin-top: 14px;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
}
.auth-switch-btn {
  background: none;
  border: none;
  color: #FFD463;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.auth-switch-btn:hover { opacity: 0.8; }

/* ── Light theme ── */
[data-theme="light"] .login-nav-btn--primary {
  background: #dfc25a;
  border-color: #dfc25a;
  color: #0F172A;
}
[data-theme="light"] .login-nav-btn--primary:hover {
  background: #ccad47;
  border-color: #ccad47;
}
[data-theme="light"] .auth-form input:focus {
  border-color: rgba(186, 12, 31, 0.6);
}
[data-theme="light"] .login-card {
  background: #451d2a;
  border-color: rgba(223, 193, 89, 0.18);
}
[data-theme="light"] .auth-submit {
  background: #dfc159;
  color: #2a1208;
}
[data-theme="light"] .auth-submit:hover {
  background: #cead47;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  body {
    padding-bottom: 84px; /* shifts flex-centered content upward, clears footer */
  }
  .login-logo-above {
    width: min(88vw, 480px);
    margin-bottom: 32px;
  }
  .login-verse {
    padding: 0 28px;
  }
  .login-nav {
    position: static;
    margin-top: 32px;
  }
  .login-nav-btn {
    padding: 13px 48px;
    font-size: 0.95rem;
    border-radius: 8px;
  }
  .login-copyright {
    white-space: nowrap;
  }

  /* ── Auth: bottom sheet instead of centred modal ── */

  /* Keep modal rendered when hidden so the slide-out transition plays */
  .auth-modal.hidden {
    display: flex;
    pointer-events: none;
  }
  .auth-modal.hidden .auth-modal-backdrop {
    opacity: 0;
    pointer-events: none;
  }
  .auth-modal.hidden .login-card {
    transform: translateY(110%);
  }

  /* Sheet container — anchored to bottom */
  .auth-modal {
    align-items: flex-end;
    padding: 0;
  }

  /* Blurred backdrop */
  .auth-modal-backdrop {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 1;
    transition: opacity 0.3s ease;
  }

  /* Sheet card */
  .login-card {
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    border: none;
    padding: 12px 24px calc(36px + env(safe-area-inset-bottom));
    background: #152236;
    transform: translateY(0);
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  }

  /* Drag-handle indicator */
  .login-card::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.18);
    margin: 0 auto 20px;
  }

  /* Light mode sheet colour */
  [data-theme="light"] .login-card {
    background: #451d2a;
  }
  [data-theme="light"] .login-card::before {
    background: rgba(255, 255, 255, 0.22);
  }
}

/* ── Legal footer: links row + copyright stacked ── */
.legal-footer {
  position: fixed;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 10;
}
.legal-links-row {
  display: flex;
  gap: 12px;
}
.legal-link {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.90);
  text-decoration: none;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  letter-spacing: 0.04em;
  transition: color 0.15s;
}
.legal-link:hover { color: #fff; }
[data-theme="light"] .legal-link { color: rgba(255, 255, 255, 0.90); }
[data-theme="light"] .legal-link:hover { color: #fff; }
.login-copyright {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.90);
  letter-spacing: 0.04em;
  text-align: right;
}
