/* auth-modal.css — the one site-wide Sign in / Sign up popup overlay.
   Opens over any page from any [data-auth-open] trigger. Abyss + gold theme,
   matches the standalone sign-up page so the form looks identical in the popup. */

:root {
  --am-abyss: #0B1B2B;
  --am-abyss-deep: #070F18;
  --am-abyss-veil: #162536;
  --am-abyss-line: #1F3F5A;
  --am-gold: #C9A449;
  --am-gold-soft: #B8923C;
  --am-light: #D8E8F4;
  --am-muted: #9DB3C8;
  --am-danger: #E07A5F;
  --am-success: #7AC97D;
}

/* Backdrop */
#abzu-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 48px 16px;
  background: rgba(7, 15, 24, 0.82);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
#abzu-auth-overlay.open { display: flex; }

/* Card */
.abzu-auth-modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--am-abyss);
  border: 1px solid var(--am-abyss-line);
  border-radius: 8px;
  padding: 30px 26px 28px;
  box-shadow: 0 16px 56px rgba(0,0,0,0.55);
  color: var(--am-light);
  font-family: 'Lora', Georgia, serif;
  line-height: 1.6;
}
.abzu-auth-close {
  position: absolute;
  top: 12px; right: 14px;
  background: transparent;
  border: none;
  color: var(--am-muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.abzu-auth-close:hover { color: var(--am-gold); }

.abzu-auth-head { text-align: center; margin-bottom: 20px; }
.abzu-auth-head .abzu-auth-logo {
  color: var(--am-gold);
  font-family: 'Georgia', serif;
  font-size: 22px;
  letter-spacing: 0.12em;
}
.abzu-auth-head .abzu-auth-sub {
  display: block;
  color: var(--am-muted);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 6px;
}

/* Sign in / Sign up toggle */
.abzu-auth-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 22px;
  border: 1px solid var(--am-abyss-line);
  border-radius: 4px;
  overflow: hidden;
}
.abzu-auth-toggle button {
  flex: 1;
  background: var(--am-abyss-veil);
  color: var(--am-muted);
  border: none;
  padding: 10px 8px;
  font-size: 12px;
  font-family: inherit;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.abzu-auth-toggle button.active {
  background: var(--am-gold);
  color: var(--am-abyss-deep);
  font-weight: 600;
}

.abzu-auth-pane { display: none; }
.abzu-auth-pane.active { display: block; }

/* Reused form atoms (scoped to the modal) */
.abzu-auth-modal .oauth-btn {
  width: 100%;
  background: var(--am-abyss-veil);
  color: var(--am-light);
  border: 1px solid var(--am-abyss-line);
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
  transition: border-color 0.2s, background 0.2s;
}
.abzu-auth-modal .oauth-btn:hover { border-color: var(--am-gold-soft); background: rgba(201,164,73,0.06); }
.abzu-auth-modal .oauth-btn svg { width: 18px; height: 18px; }

.abzu-auth-modal .divider {
  display: flex; align-items: center;
  color: var(--am-muted); font-size: 12px; letter-spacing: 0.15em;
  margin: 16px 0 20px;
}
.abzu-auth-modal .divider::before, .abzu-auth-modal .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--am-abyss-line);
}
.abzu-auth-modal .divider::before { margin-right: 14px; }
.abzu-auth-modal .divider::after { margin-left: 14px; }

.abzu-auth-modal .field { margin-bottom: 16px; }
.abzu-auth-modal .req { display:inline-block; font-size:10px; font-weight:600; letter-spacing:1px; text-transform:uppercase; color:var(--am-gold); margin-left:6px; vertical-align:middle; opacity:0.9; }
.abzu-auth-modal .field-err { display:none; margin-top:6px; font-size:12.5px; color:var(--am-danger); }
.abzu-auth-modal .field-err.show { display:block; }
.abzu-auth-modal input.invalid, .abzu-auth-modal select.invalid { border-color:var(--am-danger) !important; }
.abzu-auth-modal .field label {
  display: block; color: var(--am-light); font-size: 13px;
  letter-spacing: 0.04em; margin-bottom: 6px; font-weight: 500;
}
.abzu-auth-modal .field input[type="text"],
.abzu-auth-modal .field input[type="email"],
.abzu-auth-modal .field input[type="password"],
.abzu-auth-modal .field select {
  width: 100%;
  background: var(--am-abyss-veil);
  color: var(--am-light);
  border: 1px solid var(--am-abyss-line);
  border-radius: 3px;
  padding: 11px 14px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s;
}
.abzu-auth-modal .field input:focus, .abzu-auth-modal .field select:focus { outline: none; border-color: var(--am-gold); }
.abzu-auth-modal .field-help { color: var(--am-muted); font-size: 12px; margin-top: 4px; line-height: 1.5; }
.abzu-auth-modal .field-help.match-ok { color: var(--am-success); }
.abzu-auth-modal .field-help.match-bad { color: var(--am-danger); }

.abzu-auth-modal .check {
  display: flex; gap: 10px; padding: 11px 13px;
  background: var(--am-abyss-veil); border: 1px solid var(--am-abyss-line);
  border-radius: 3px; cursor: pointer; margin-bottom: 16px;
}
.abzu-auth-modal .check input { margin-top: 3px; cursor: pointer; }
.abzu-auth-modal .check-text { font-size: 13.5px; color: var(--am-light); line-height: 1.5; }
.abzu-auth-modal .check-text strong { color: var(--am-gold); font-weight: 500; display: block; margin-bottom: 2px; }
.abzu-auth-modal .check-text .check-note { color: var(--am-muted); font-size: 12px; }

.abzu-auth-modal .btn-primary {
  width: 100%;
  background: var(--am-gold);
  color: var(--am-abyss-deep);
  border: none; border-radius: 3px;
  padding: 13px 16px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer; font-family: inherit;
}
.abzu-auth-modal .btn-primary:hover { background: var(--am-gold-soft); }
.abzu-auth-modal .btn-primary:disabled { background: var(--am-abyss-line); color: var(--am-muted); cursor: not-allowed; }

.abzu-auth-modal .form-error {
  background: rgba(224, 122, 95, 0.1);
  border: 1px solid rgba(224, 122, 95, 0.3);
  color: var(--am-danger);
  padding: 10px 14px; border-radius: 3px;
  font-size: 13px; margin-bottom: 16px; display: none;
}
.abzu-auth-modal .form-error.show { display: block; }

.abzu-auth-modal .pw-wrap { position: relative; }
.abzu-auth-modal .pw-eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; color: var(--am-muted); cursor: pointer; padding: 6px; display: flex;
}
.abzu-auth-modal .pw-eye:hover { color: var(--am-gold); }
.abzu-auth-modal .pw-eye svg { width: 18px; height: 18px; }
.abzu-auth-modal .pw-wrap input { padding-right: 40px; }

.abzu-auth-modal .code-field input {
  text-align: center; font-size: 22px; letter-spacing: 0.4em;
  font-family: 'Courier New', monospace; padding: 14px;
}

.abzu-auth-step-indicator {
  text-align: center; color: var(--am-muted); font-size: 12px;
  letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 18px;
}
.abzu-auth-modal .am-foot {
  margin-top: 18px; text-align: center; color: var(--am-muted); font-size: 13px;
}
.abzu-auth-modal .am-foot a { color: var(--am-gold); text-decoration: none; cursor: pointer; }
.abzu-auth-modal .am-foot a:hover { text-decoration: underline; }
.abzu-auth-substep { display: none; }
.abzu-auth-substep.active { display: block; }
