/* หน้า Login / จัดการบัญชี — token ชุดเดียวกับแดชบอร์ด (White / Neutral) */
:root {
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --surface-2: #FAFBFC;
  --surface-hover: #F3F5F8;
  --border: #E3E6EB;
  --border-soft: #EEF0F3;
  --border-strong: #D0D5DD;
  --ink: #101828;
  --ink-2: #344054;
  --ink-3: #475467;
  --muted: #667085;
  --faint: #98A2B3;
  --accent: #2A78D6;
  --accent-ring: rgba(42, 120, 214, 0.20);
  --brand: #0E2A5C;
  --brand-dk: #0A1F45;
  --brand-soft: #E8EEF8;
  --danger: #B91C1C;
  --danger-lt: #FEF2F2;
  --success: #15803D;
  --success-lt: #ECFDF3;
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.04);
  --font: 'Inter', 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Brand ── */
.brand { display: flex; align-items: center; gap: 11px; }
.brand-icon { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; mix-blend-mode: multiply; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-main { font-weight: 700; font-size: 0.9rem; letter-spacing: 1.6px; color: var(--brand); }
.brand-sub { font-size: 0.62rem; font-weight: 500; color: var(--muted); letter-spacing: 0.9px; text-transform: uppercase; }
.brand-full { justify-content: center; }
.brand-full img { width: 168px; height: 168px; object-fit: contain; display: block; mix-blend-mode: multiply; }

/* ── Login page ── */
.login-page {
  display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  background:
    radial-gradient(900px 480px at 50% -12%, rgba(42, 120, 214, 0.08) 0%, rgba(42, 120, 214, 0) 70%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px 28px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 24px 48px -12px rgba(16, 24, 40, 0.12);
}
.login-card .brand { margin-bottom: 18px; }
.login-card h1 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px; text-align: center; }
.login-card .lead { color: var(--muted); font-size: 0.85rem; margin-bottom: 24px; text-align: center; }
.login-footer { margin-top: 20px; text-align: center; font-size: 0.76rem; line-height: 1.7; color: var(--faint); }
.login-footer a { color: var(--accent); font-weight: 500; text-decoration: none; }
.login-footer a:hover { text-decoration: underline; }

/* ── Forms ── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.field input:hover, .field select:hover { border-color: var(--border-strong); }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.field .hint { font-size: 0.75rem; color: var(--muted); margin-top: 5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font: inherit; font-weight: 600; font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.08s;
}
.btn:hover { background: var(--brand-dk); border-color: var(--brand-dk); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.btn-block { width: 100%; margin-top: 6px; }
.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--border); font-weight: 500; box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--surface-hover); border-color: var(--border-strong); color: var(--ink); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 0.78rem; font-weight: 500; }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #FECACA; font-weight: 500; }
.btn-danger:hover { background: var(--danger-lt); border-color: #FCA5A5; color: var(--danger); }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 16px; }
.alert-error { background: var(--danger-lt); color: var(--danger); border: 1px solid #FECACA; }
.alert-success { background: var(--success-lt); color: var(--success); border: 1px solid #BBF7D0; }

/* ── Account page ── */
.account-page { padding: 0 0 48px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 64px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.container { max-width: 960px; margin: 0 auto; padding: 28px 16px 0; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.card h2 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 4px; }
.card .lead { color: var(--muted); font-size: 0.85rem; margin-bottom: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th { text-align: left; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; color: var(--ink-2); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
td strong { color: var(--ink); font-weight: 600; }
td .actions { display: flex; flex-wrap: wrap; gap: 6px; }
td form { display: inline-flex; align-items: center; gap: 6px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.badge-admin { background: var(--brand-soft); color: var(--brand); }
.badge-user { background: var(--surface-hover); color: var(--ink-3); }
.badge-manager { background: #FFF7ED; color: #C2410C; }
.badge-reservation { background: #E6EFFA; color: #2A78D6; }
.badge-rsvn-phuket, .badge-rsvn-khaolak, .badge-rsvn-riv { background: #E6EFFA; color: #2A78D6; }
.badge-viewer { background: #F1F5F9; color: #475569; }
.badge-sales-team { background: #ECFDF5; color: #047857; }
.badge-teacher { background: #F5F3FF; color: #6D28D9; }
.role-table td { vertical-align: top; }
.role-table td:first-child { white-space: nowrap; }
.role-notes { margin: 14px 0 0 18px; color: var(--muted); font-size: 0.8rem; line-height: 1.6; }
.role-select { margin-left: 6px; padding: 2px 6px; font-size: 0.78rem; }
.badge-off { background: var(--danger-lt); color: var(--danger); }
.muted { color: var(--muted); font-size: 0.8rem; }

.reset-row { display: flex; gap: 6px; }
.reset-row input { width: 140px; height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 7px; font: inherit; font-size: 0.8rem; }
.reset-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .login-card { padding: 26px 20px 22px; }
}

/* account.php › ธีมเทศกาล › ปุ่มทดสอบ */
.festive-test { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.festive-test h3 { font-size: 0.86rem; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.festive-test .hint { font-size: 0.75rem; color: var(--muted); margin-bottom: 10px; }
.festive-test-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.festive-test-btns .btn { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
