/* ════════════════════════════════════════════════════════════
   MEA Link — shared/css/auth.css
   Shared styling untuk /auth/login/ dan /auth/register/
   ════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600&display=swap');

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

:root {
  --bg:        #0B111E;
  --surface:   #131C2E;
  --surface-2: #1A2540;
  --border:    rgba(255,255,255,0.08);
  --text:      #F0F4F8;
  --text-2:    #8A9AAD;
  --text-3:    #5A6A7D;
  --accent:    #81D4FA;
  --accent-10: color-mix(in srgb, var(--accent) 10%, transparent);
  --danger:    #EF5350;
  --danger-10: color-mix(in srgb, var(--danger) 12%, transparent);
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
}

/* ── Page layout ─────────────────────────────────────────── */
.auth-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute;
  top: -20%; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--accent-10), transparent 70%);
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  position: relative;
  z-index: 1;
}

/* ── Brand ───────────────────────────────────────────────── */
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 28px;
}

.auth-brand-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.04em;
}

.logo-glow {
  border-radius: 8px;
  filter: drop-shadow(0 0 10px var(--accent-10));
}

/* ── Headings ────────────────────────────────────────────── */
.auth-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: 0.03em;
  text-align: center;
  margin-bottom: 8px;
}

.auth-sub {
  font-size: 0.82rem;
  color: var(--text-2);
  text-align: center;
  line-height: 1.55;
  margin-bottom: 24px;
}

/* ── Error banner ────────────────────────────────────────── */
.error-banner {
  display: none;
  align-items: flex-start;
  gap: 8px;
  background: var(--danger-10);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  color: var(--danger);
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 0.78rem;
  line-height: 1.5;
  margin-bottom: 18px;
}

.error-banner.visible { display: flex; }
.error-banner svg { flex-shrink: 0; margin-top: 1px; }

/* ── Checkbox (ToS) ──────────────────────────────────────── */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 20px;
}

.checkbox-input {
  width: 17px; height: 17px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.checkbox-label {
  font-size: 0.76rem;
  color: var(--text-2);
  line-height: 1.55;
}

.checkbox-label a {
  color: var(--accent);
  text-decoration: none;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-google {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-google:not(:disabled):active {
  background: var(--surface-2);
}

.google-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--accent);
  color: #0B111E;
}

.btn-primary:not(:disabled):active {
  opacity: 0.85;
}

/* ── Spinner (inline button loading) ────────────────────── */
.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ──────────────────────────────────────────────── */
.auth-footer {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: 22px;
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* ── Field (untuk login form, jika perlu username/password) ─ */
.field-group {
  margin-bottom: 14px;
}

.field-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.field-input {
  width: 100%;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.86rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}

.field-input:focus {
  border-color: var(--accent);
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  font-size: 0.68rem;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

/* ── Loading screen (callback page) ─────────────────────── */
.auth-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.auth-loading p {
  font-size: 0.8rem;
  color: var(--text-2);
}

.auth-loading .spinner-lg {
  width: 30px; height: 30px;
  border: 2.5px solid var(--accent-10);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Responsive: desktop refinement ─────────────────────── */
@media (min-width: 768px) {
  .auth-card {
    max-width: 400px;
  }
  .auth-title {
    font-size: 2.3rem;
  }
}
