@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500&display=swap');

:root {
  /* Canvas & surfaces — porcelain, cool-bright */
  --bg:        #f3f6fc;
  --surface:   #ffffff;
  --border:    #e2e7f2;
  --border-soft: #ecf0f9;

  /* Text — ink navy, not flat black */
  --text:      #0d1526;
  --text-dim:  #5b6478;
  --text-faint:#94a0b8;

  /* Brand accent — "Verified Blue" (primary) */
  --accent:      #2f5fff;
  --accent-hover:#2347d9;
  --accent-soft: #eaf0ff;
  --accent-ring: rgba(47, 95, 255, 0.16);
  --accent-dark: #1b3aad;

  /* Secondary accent — "Pulse Pink", used sparingly in the signature gradient */
  --accent-2:    #ff3d77;
  --accent-2-soft: #ffe9f0;

  /* Bridge accent — used only inside the signature gradient */
  --accent-mid:  #8b5cf6;

  /* Signature gradient: Verified Blue -> Violet -> Pulse Pink */
  --gradient-signature: linear-gradient(120deg, var(--accent) 0%, var(--accent-mid) 55%, var(--accent-2) 100%);

  /* Status */
  --ok:      #0a7d47;
  --ok-bg:   #e8faf1;
  --ok-bd:   #a9edc7;
  --err:     #c8221b;
  --err-bg:  #fef1f0;
  --err-bd:  #f7bab6;

  --radius:  14px;
  --radius-sm: 9px;
  --shadow-card: 0 1px 2px rgba(13,21,38,0.04), 0 16px 36px -14px rgba(21,45,120,0.18);

  --font:       'Inter', -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', var(--font);
  --font-mono:  'JetBrains Mono', Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(900px 460px at 12% -8%, rgba(47,95,255,0.10) 0%, transparent 60%),
    radial-gradient(760px 420px at 108% 8%, rgba(255,61,119,0.08) 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  padding: 24px;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- Auth shell (login/register/forgot/active/reactive) ----------------
   Two-pane layout: a gradient brand panel on the left (hidden on narrow screens)
   plus the actual form card on the right. Falls back to a single centered card
   automatically if a page only renders .card without wrapping it. */
.auth-shell {
  width: 100%;
  max-width: 880px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.auth-side {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 34px;
  background: var(--gradient-signature);
  color: #fff;
  overflow: hidden;
}
.auth-side::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(360px 260px at 8% 100%, rgba(255,255,255,0.18) 0%, transparent 60%),
    radial-gradient(420px 300px at 100% 0%, rgba(255,255,255,0.14) 0%, transparent 55%);
  pointer-events: none;
}
.auth-side-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; }
.auth-side-top .brand-mark { box-shadow: 0 4px 14px -2px rgba(0,0,0,0.25); }
.auth-side-top .brand-name { color: #fff; }
.auth-side-mid { position: relative; z-index: 1; margin-top: auto; margin-bottom: auto; padding: 30px 0; }
.auth-side-mid h2 { font-family: var(--font-display); font-size: 22px; line-height: 1.35; margin: 0 0 12px; letter-spacing: -0.01em; }
.auth-side-mid p { font-size: 13.5px; line-height: 1.6; color: rgba(255,255,255,0.86); margin: 0; max-width: 320px; }
.auth-side-points { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 11px; }
.auth-side-points div { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.94); }
.auth-side-points span.dot {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center;
  font-size: 11px;
}
.auth-form-pane { display: flex; align-items: center; justify-content: center; padding: 40px 36px; }
.auth-shell .card {
  border: none; box-shadow: none; padding: 0; max-width: 340px; width: 100%;
}
@media (max-width: 760px) {
  .auth-shell { grid-template-columns: 1fr; max-width: 420px; }
  .auth-side { display: none; }
  .auth-form-pane { padding: 32px 26px; }
}

/* ---------------- Card (standalone fallback, e.g. active.php / 404s) ---------------- */

.card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow-card);
  position: relative;
}

/* ---------------- Brand mark ---------------- */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  background: var(--gradient-signature);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 10px -2px var(--accent-ring);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* ---------------- Headings ---------------- */

.card h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--text);
}

.card .subtitle {
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 26px;
}

/* ---------------- Form fields ---------------- */

.field { margin-bottom: 16px; }

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

.field input {
  width: 100%;
  padding: 10px 12px;
  background: #f8faff;
  border: 1px solid #d7deec;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.field input::placeholder { color: var(--text-faint); }

.field input:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

/* ---------------- Button ---------------- */

.btn {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  background-image: linear-gradient(120deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #fff;
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 6px 16px -6px var(--accent-ring);
  transition: box-shadow .15s, transform .05s, filter .15s;
}
.btn:hover   { filter: brightness(1.06); box-shadow: 0 8px 20px -6px var(--accent-ring); }
.btn:active  { transform: translateY(1px); }
.btn:focus-visible { box-shadow: 0 0 0 4px var(--accent-ring); }

/* ---------------- Links ---------------- */

.links {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
}
.links a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}
.links a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ---------------- Alerts ---------------- */

.alert {
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 20px;
  border: 1px solid transparent;
}
.alert-err { background: var(--err-bg); border-color: var(--err-bd); color: var(--err); }
.alert-ok  { background: var(--ok-bg);  border-color: var(--ok-bd);  color: var(--ok); }
.alert a   { color: inherit; text-decoration: underline; font-weight: 600; }

.g-recaptcha { margin-bottom: 20px; }

.center-text { text-align: center; }
.center-text .brand { justify-content: center; }

.mono { font-family: var(--font-mono); }

/* ---------------- Dashboard key-value rows (index.php) ---------------- */

.kv {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13.5px;
}
.kv:last-child { border-bottom: none; }
.kv span:first-child { color: var(--text-dim); }
.kv span:last-child   { font-family: var(--font-mono); font-size: 13px; color: var(--text); }
a {
    text-decoration: none;
}
/* ---------------- Field hint (kiểm tra trùng username/email AJAX) ---------------- */
.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  min-height: 16px;
}
.field-hint.hint-ok  { color: var(--ok); }
.field-hint.hint-err { color: var(--err); }
.field-hint.hint-checking { color: var(--text-dim); }

/* ---------------- Nút submit trạng thái loading (fetch AJAX) ---------------- */
.btn { position: relative; }
.btn .btn-spinner {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}
.btn.is-loading { color: transparent; pointer-events: none; }
.btn.is-loading .btn-spinner { display: inline-block; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
