/* Shared auth modal + header login-button styles.
   Uses the same CSS variables (--bg, --surface, --accent, etc.) defined
   in assets/legal.css so this module drops into any page that already
   includes legal.css. */

/* ── Header Login button ── */
.legal-header .nav-login {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #0d0d0d;
  font-family: 'DM Mono', ui-monospace, Menlo, monospace;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, transform .15s, box-shadow .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
  margin-left: 8px;
  white-space: nowrap;
}
.legal-header .nav-login:hover {
  background: #ffb627;
  border-color: #ffb627;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -6px rgba(240,165,0,.6);
}
.legal-header .nav-login:active {
  transform: translateY(0);
}
.legal-header .nav-login .hdr-lbl { font-size: inherit; }

/* Mobile: login button sits outside the hamburger panel, between the
   logo and the ☰ toggle. Tapping it opens the modal directly — without
   having to expand the nav first. Header HTML puts the button after
   <nav> so flex + margin-left:auto keeps it pinned to the right. */
@media (max-width: 900px) {
  .legal-header .nav-login {
    margin-left: auto;
    padding: 8px 14px;
    font-size: 13px;
  }
}

/* ── Modal overlay ── */
.sp-auth-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  z-index: 10000; padding: 20px;
  animation: spAuthFade .18s ease-out;
}
.sp-auth-overlay.active { display: flex; }
@keyframes spAuthFade { from { opacity: 0; } to { opacity: 1; } }

.sp-auth-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%; max-width: 440px;
  max-height: 92dvh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  animation: spAuthSlide .22s ease-out;
  color: var(--text);
  font-family: 'DM Mono', ui-monospace, Menlo, monospace;
}
@keyframes spAuthSlide {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.sp-auth-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--surface);
  border-radius: 14px 14px 0 0; z-index: 1;
}
.sp-auth-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 20px; letter-spacing: -.3px;
}
.sp-auth-title em { color: var(--accent); font-style: normal; }
.sp-auth-close {
  background: transparent; border: none;
  color: var(--muted); font-size: 20px; cursor: pointer;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: .15s;
}
.sp-auth-close:hover { background: var(--surface2); color: var(--text); }

.sp-auth-body { padding: 20px; }

/* ── Google Sign-In ── */
.sp-google-wrap {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.sp-google-btn {
  min-height: 44px;
  width: 100%;
  display: flex; justify-content: center;
}
/* Google's rendered iframe sits inside .sp-google-btn; GIS handles its own
   styling, we just make sure the container is sized right and centered. */
.sp-auth-divider {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase; letter-spacing: 1px;
}
.sp-auth-divider::before,
.sp-auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

/* ── Tabs ── */
.sp-auth-tabs {
  display: flex; gap: 4px;
  background: var(--surface2);
  border-radius: 8px; padding: 4px; margin-bottom: 16px;
}
.sp-auth-tab {
  flex: 1; padding: 9px; text-align: center;
  background: transparent; border: none;
  color: var(--muted);
  font-family: inherit; font-size: 13px;
  border-radius: 6px; cursor: pointer; transition: .15s;
}
.sp-auth-tab.active {
  background: var(--accent); color: #000; font-weight: 600;
}

/* ── Forms ── */
.sp-auth-form { display: block; }
.sp-field { margin-bottom: 12px; }
.sp-field label {
  display: block; font-size: 11px; color: var(--muted);
  margin-bottom: 6px; letter-spacing: .5px; text-transform: uppercase;
}
.sp-field input {
  width: 100%; padding: 11px 13px;
  background: var(--surface2);
  border: 1px solid var(--border); border-radius: 7px;
  color: var(--text);
  font-family: inherit; font-size: 13px;
  transition: .15s;
}
.sp-field input:focus {
  outline: none; border-color: var(--accent);
  background: var(--surface);
}

.sp-hint {
  font-size: 11px; color: var(--muted);
  margin: -4px 0 10px; line-height: 1.5;
}
.sp-otp-intro {
  background: var(--surface2);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 12px;
  font-size: 12px; line-height: 1.6; color: var(--muted);
}
.sp-otp-intro strong {
  color: var(--text); display: block; margin: 4px 0; word-break: break-all;
}
.sp-otp-timer {
  font-size: 11px; color: var(--muted);
  margin: -4px 0 8px;
}
.sp-otp-row { display: flex; gap: 8px; margin-top: 8px; }
.sp-otp-row .sp-btn { flex: 1; margin: 0; }

/* ── Buttons ── */
.sp-btn {
  width: 100%;
  padding: 11px 14px;
  border: none; border-radius: 8px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: .15s;
  margin-top: 4px;
}
.sp-btn:disabled { opacity: .6; cursor: not-allowed; }
.sp-btn-primary {
  background: var(--accent); color: #000;
}
.sp-btn-primary:hover:not(:disabled) {
  background: #ffc03a; transform: translateY(-1px);
}
.sp-btn-ghost {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border);
}
.sp-btn-ghost:hover:not(:disabled) {
  border-color: var(--accent); color: var(--accent);
}
.sp-btn-danger {
  background: transparent;
  color: #ff6b6b;
  border: 1px solid rgba(255,107,107,.35);
}
.sp-btn-danger:hover:not(:disabled) {
  background: rgba(255,107,107,.08);
  border-color: #ff6b6b;
}

.sp-auth-error {
  color: #ff6b6b;
  font-size: 12px;
  margin-top: 10px;
  min-height: 16px;
  line-height: 1.5;
}

/* ── Account modal info rows ── */
.sp-account-info {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 14px;
  margin-bottom: 14px;
}
.sp-account-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.sp-account-row:last-child { border-bottom: none; }
.sp-account-row span {
  color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px;
  font-size: 11px;
}
.sp-account-row strong {
  color: var(--text);
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}
.sp-account-row strong.sp-plan-name {
  color: var(--accent);
}

.sp-account-sep {
  margin: 18px 0 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Delete-account inline confirm pane */
.sp-account-confirm .sp-confirm-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 10px;
}
.sp-account-confirm .sp-confirm-body {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 14px;
}

@media (max-width: 420px) {
  .sp-auth-modal { max-width: 100%; }
  .sp-auth-body { padding: 16px; }
  .sp-auth-header { padding: 14px 16px; }
  .sp-auth-title { font-size: 18px; }
}

/* ── Toast ──
   Mirrors the passport-photo.html inline `.toast` so login/logout/account
   notifications look identical on the homepage + all legal pages. */
.sp-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 14px 22px;
  border-radius: 10px;
  font-family: 'DM Mono', ui-monospace, Menlo, monospace;
  font-size: 14px;
  line-height: 1.45;
  z-index: 10001;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  width: max-content;
  max-width: min(560px, calc(100vw - 24px));
  min-width: min(260px, calc(100vw - 24px));
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  opacity: 0;
  pointer-events: none;
  transition: transform .22s ease-out, opacity .22s ease-out;
}
.sp-toast.sp-toast-show {
  transform: translate(-50%, 0);
  opacity: 1;
}
