/**
 * Auth pages shared theme — CSS variables aligned with Asecond-web index.
 * Marketing nav styles: load site.css before this file (see render_auth_page_styles()).
 */
:root {
  --bg: #0b0d12;
  --card: #11141c;
  --line: #1f2430;
  --text: #e5e7eb;
  --muted: #9aa3b2;
  --accent: #4f7cff;
  --accent2: #22c55e;
  --danger: #f87171;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.auth-page {
  margin: 0;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
  background:
    radial-gradient(1200px 600px at 50% -200px, #14182a, #0b0d12);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

.auth-shell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 20px 56px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, #12162a, #0e111c);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px 26px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 1.65rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.auth-lead {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.input-wrap input {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  padding-right: 48px;
  border-radius: 12px;
  border: 1px solid rgba(154, 163, 178, 0.4);
  background: rgba(15, 19, 34, 0.65);
  color: var(--text);
  font-size: 0.9375rem;
  outline: none;
}

.input-wrap input:focus {
  border-color: rgba(79, 124, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.18);
}

.pw-toggle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 46px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border-radius: 0 12px 12px 0;
  flex-shrink: 0;
}

.pw-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pw-toggle:hover {
  color: var(--text);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 20px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
}

.checkbox-row input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.checkbox-row a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #4f7cff, #3b5bff);
  color: #fff;
  font-weight: 800;
  font-size: 0.9375rem;
  cursor: pointer;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.auth-footer-note {
  margin-top: 20px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}

.auth-footer-note a.link-accent {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.auth-footer-note a.link-accent:hover {
  text-decoration: underline;
}

.msg-error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.8125rem;
  color: #fecaca;
  margin-bottom: 16px;
}

.msg-errors ul {
  margin: 0;
  padding-left: 18px;
}

.social-placeholder {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(31, 36, 48, 0.85);
  text-align: center;
}

.social-placeholder button {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: not-allowed;
  opacity: 0.72;
}

/* Google OAuth 버튼 (Step 10) */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
  box-sizing: border-box;
}
.btn-google:hover,
.btn-google:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.34);
  outline: none;
}
[data-theme="light"] .btn-google {
  border-color: rgba(0, 0, 0, 0.18);
  color: var(--text);
}
[data-theme="light"] .btn-google:hover,
[data-theme="light"] .btn-google:focus-visible {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.32);
}

@media (max-width: 480px) {
  .auth-card {
    padding: 22px 18px;
  }

  .auth-card h1 {
    font-size: 1.45rem;
  }
}

/* ── Footer (billing.html / index.html inline style 동기화) ── */
.footer {
  border-top: 1px solid rgba(31, 36, 48, 0.75);
  padding: 26px 0 40px;
  color: var(--muted, #9aa3b2);
  font-size: 13px;
  line-height: 1.5;
  margin-top: auto;
  width: 100%;
  box-sizing: border-box;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer a {
  text-decoration: none;
  color: inherit;
}

.footer a:hover {
  color: var(--text, #e5e7eb);
}

/* ── Light mode (auth page content) ── */
:root[data-theme="light"] {
  --bg: #f0f2f7;
  --card: #ffffff;
  --line: #dde1ea;
  --text: #0f1117;
  --muted: #374151;
  --accent: #4f7cff;
  --accent2: #16a34a;
  --danger: #dc2626;
}

[data-theme="light"] body.auth-page {
  background: radial-gradient(1200px 600px at 50% -200px, #e4e9f8, #f0f2f7) !important;
}

[data-theme="light"] .auth-card {
  background: #ffffff !important;
  border-color: rgba(0,0,0,.1) !important;
  box-shadow: 0 18px 50px rgba(0,0,0,.1) !important;
}

[data-theme="light"] .input-wrap input {
  background: #ffffff !important;
  border-color: rgba(0,0,0,.22) !important;
  color: var(--text) !important;
}

[data-theme="light"] .input-wrap input:focus {
  border-color: rgba(79,124,255,.8) !important;
  box-shadow: 0 0 0 3px rgba(79,124,255,.15) !important;
}

[data-theme="light"] .msg-error {
  background: rgba(220,38,38,.08) !important;
  border-color: rgba(220,38,38,.3) !important;
  color: #991b1b !important;
}
