/* ============================================================
   auth2fa / style.css
   Paleta: slate-900 bg · white card · indigo-500 accent
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --bg:         #0f172a;
  --bg2:        #1e293b;
  --card:       #ffffff;
  --border:     #e2e8f0;
  --accent:     #6366f1;
  --accent-h:   #4f46e5;
  --accent-l:   #eef2ff;
  --text:       #1e293b;
  --muted:      #64748b;
  --danger:     #ef4444;
  --danger-l:   #fef2f2;
  --success:    #22c55e;
  --success-l:  #f0fdf4;
  --warn:       #f59e0b;
  --warn-l:     #fffbeb;
  --radius:     12px;
  --shadow:     0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --shadow-lg:  0 20px 25px -5px rgba(0,0,0,.25), 0 8px 10px -6px rgba(0,0,0,.1);
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* ---- Auth layout (login / 2FA) ---- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99,102,241,.18) 0%, transparent 60%),
    var(--bg);
}

.auth-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 2.5rem 2.25rem;
}

.auth-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}
.auth-logo .logo-icon {
  width: 52px; height: 52px;
  background: var(--accent);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .75rem;
}
.auth-logo .logo-icon svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 2; }
.auth-logo h1 { font-size: 1.35rem; font-weight: 700; color: var(--text); }
.auth-logo p  { font-size: .85rem; color: var(--muted); margin-top: .2rem; }

/* ---- Admin layout ---- */
.admin-wrap {
  display: flex;
  min-height: 100vh;
  background: #f1f5f9;
}

.sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--bg);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .5rem .75rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 1rem;
}
.sidebar-brand .b-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-brand .b-icon svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; }
.sidebar-brand span { font-weight: 700; color: #fff; font-size: .95rem; }

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .75rem;
  border-radius: 8px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
}
.sidebar nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar nav a:hover, .sidebar nav a.active {
  background: rgba(99,102,241,.25);
  color: #fff;
}
.sidebar nav a.active { color: #a5b4fc; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: .5rem;
  color: rgba(255,255,255,.5);
  text-decoration: none;
  font-size: .8rem;
  padding: .5rem .75rem;
  border-radius: 8px;
  transition: color .15s;
}
.sidebar-footer a:hover { color: #fff; }

.main-content {
  flex: 1;
  padding: 2rem 2.25rem;
  overflow-x: auto;
}
.page-header { margin-bottom: 1.75rem; }
.page-header h1 { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.page-header p  { color: var(--muted); font-size: .875rem; margin-top: .2rem; }

/* ---- Forms ---- */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .35rem;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.form-control {
  width: 100%;
  padding: .65rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .925rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .65rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; }

.btn-primary  { background: var(--accent);  color: #fff; width: 100%; padding: .75rem; font-size: .95rem; }
.btn-primary:hover  { background: var(--accent-h); }

.btn-danger   { background: var(--danger);  color: #fff; }
.btn-danger:hover   { background: #dc2626; }

.btn-secondary { background: #f1f5f9; color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: #e2e8f0; }

.btn-success  { background: var(--success); color: #fff; }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; border-radius: 6px; }

/* ---- Alerts ---- */
.alert {
  padding: .75rem 1rem;
  border-radius: 8px;
  font-size: .875rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.alert-danger  { background: var(--danger-l);  color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: var(--success-l); color: #15803d; border: 1px solid #bbf7d0; }
.alert-warn    { background: var(--warn-l);    color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: var(--accent-l);  color: #3730a3; border: 1px solid #c7d2fe; }

/* ---- Cards / Tables ---- */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
}
.card-header h2 { font-size: 1rem; font-weight: 600; }
.card-body { padding: 1.5rem; }

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
tbody td {
  padding: .85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: .875rem;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 600;
}
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-indigo { background: #e0e7ff; color: #4338ca; }
.badge-gray   { background: #f1f5f9; color: #64748b; }

/* ---- OTP Input ---- */
.otp-hint {
  text-align: center;
  font-size: .8rem;
  color: var(--muted);
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ---- Utility ---- */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.text-muted { color: var(--muted); font-size: .85rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.flex { display: flex; }
.gap-2 { gap: .5rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }

/* ---- QR setup ---- */
.qr-wrap {
  text-align: center;
  padding: 1.25rem;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px dashed var(--border);
}
.qr-wrap img { border-radius: 8px; }
.secret-code {
  font-family: 'Courier New', monospace;
  font-size: .95rem;
  letter-spacing: .15em;
  background: #f1f5f9;
  padding: .6rem 1rem;
  border-radius: 8px;
  text-align: center;
  color: var(--text);
  margin-top: .75rem;
  word-break: break-all;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .admin-wrap { flex-direction: column; }
  .sidebar { width: 100%; min-height: unset; }
  .main-content { padding: 1.25rem 1rem; }
  .auth-card { padding: 2rem 1.25rem; }
}
