/* ============================================================
   assets/css/style.css  –  Global styles (dark-blue & white)
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --navy-900: #0a1628;
  --navy-800: #0d1f3c;
  --navy-700: #122348;
  --navy-600: #1a3260;
  --navy-500: #1e3a8a;
  --navy-400: #2563eb;
  --accent:   #3b82f6;
  --accent-h: #60a5fa;
  --white:    #ffffff;
  --off-white:#f0f4ff;
  --text-muted: #94a3b8;
  --border:   #1e3a8a;
  --success:  #22c55e;
  --danger:   #ef4444;
  --warning:  #f59e0b;

  --radius:   8px;
  --radius-lg:14px;
  --shadow:   0 4px 24px rgba(0,0,0,.45);
  --shadow-sm:0 2px 8px  rgba(0,0,0,.30);
  --transition: .25s ease;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--navy-900);
  color: var(--white);
  min-height: 100vh;
  line-height: 1.6;
}
a { color: var(--accent-h); text-decoration: none; }
a:hover { color: var(--white); }
img { max-width: 100%; }
ul { list-style: none; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar         { width: 6px; }
::-webkit-scrollbar-track   { background: var(--navy-800); }
::-webkit-scrollbar-thumb   { background: var(--navy-500); border-radius:3px; }

/* ── Typography ────────────────────────────────────────────── */
h1,h2,h3,h4,h5 { font-weight: 700; line-height: 1.3; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-sm { font-size: .875rem; }

/* ── Layout ─────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Card ──────────────────────────────────────────────────── */
.card {
  background: var(--navy-800);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}
.card-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}
.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-h);
}

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  background: var(--navy-800);
  border-bottom: 1px solid var(--border);
  padding: .85rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
}
.navbar-brand .logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--navy-500), var(--accent));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.navbar-right { display: flex; align-items: center; gap: 1rem; }
.user-badge {
  display: flex; align-items: center; gap: .5rem;
  background: var(--navy-700);
  border: 1px solid var(--border);
  padding: .4rem .85rem;
  border-radius: 50px;
  font-size: .875rem;
}
.user-badge .avatar {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.35rem;
  border-radius: var(--radius);
  font-size: .9rem; font-weight: 600;
  border: none; cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--navy-500); color: var(--white); }
.btn-primary:hover { background: var(--accent); color: var(--white); }
.btn-secondary { background: var(--navy-700); color: var(--white); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--navy-600); color: var(--white); }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { filter: brightness(1.1); }
.btn-danger  { background: var(--danger);  color: var(--white); }
.btn-danger:hover  { filter: brightness(1.1); }
.btn-outline {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent-h);
}
.btn-outline:hover { background: var(--accent); color: var(--white); }
.btn-sm { padding: .4rem .9rem; font-size: .8rem; }
.btn-lg { padding: .85rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .4rem; color: var(--off-white); }
.form-control {
  width: 100%;
  background: var(--navy-700);
  border: 1.5px solid var(--border);
  color: var(--white);
  padding: .6rem .9rem;
  border-radius: var(--radius);
  font-size: .9rem;
  transition: border-color var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--accent); }
.form-control::placeholder { color: var(--text-muted); }
.form-control:read-only { background: var(--navy-900); border-style: dashed; }
.form-control.is-invalid { border-color: var(--danger); }
.invalid-feedback { color: var(--danger); font-size: .8rem; margin-top: .25rem; }

.input-group { display: flex; gap: .5rem; }
.input-group .form-control { flex: 1; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; visibility: hidden;
  transition: all var(--transition);
}
.modal-backdrop.active { opacity: 1; visibility: visible; }
.modal {
  background: var(--navy-800);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 480px;
  transform: translateY(-20px) scale(.97);
  transition: transform var(--transition);
}
.modal-backdrop.active .modal { transform: translateY(0) scale(1); }
.modal-lg { max-width: 700px; }
.modal-xl { max-width: 900px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1.1rem; font-weight: 700; color: var(--accent-h); }
.modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.4rem; cursor: pointer; line-height: 1;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--white); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: .75rem;
}

/* ── Table ──────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.table th {
  background: var(--navy-700);
  color: var(--accent-h);
  padding: .75rem 1rem;
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .75rem;
  white-space: nowrap;
}
.table td {
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--navy-700);
  color: var(--off-white);
}
.table tbody tr:hover { background: var(--navy-700); }
.table tbody tr:last-child td { border-bottom: none; }

/* ── Badge ──────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: .25rem .65rem;
  border-radius: 50px; font-size: .75rem; font-weight: 700;
}
.badge-primary { background: var(--navy-500); color: var(--white); }
.badge-success { background: var(--success); color: var(--white); }
.badge-info    { background: var(--accent);  color: var(--white); }

/* ── Alert ──────────────────────────────────────────────────── */
.alert {
  padding: .85rem 1rem; border-radius: var(--radius);
  font-size: .875rem; margin-bottom: 1rem;
  border: 1px solid;
}
.alert-danger  { background: rgba(239,68,68,.15); border-color: var(--danger); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,.15); border-color: var(--success); color: #86efac; }
.alert-info    { background: rgba(59,130,246,.15); border-color: var(--accent); color: #93c5fd; }

/* ── Spinner ────────────────────────────────────────────────── */
.spinner {
  width: 40px; height: 40px;
  border: 4px solid var(--navy-600);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  display: none; position: absolute; inset: 0;
  background: rgba(10,22,40,.7); border-radius: var(--radius-lg);
  justify-content: center; align-items: center;
  z-index: 10;
}
.loading-overlay.active { display: flex; }

/* ── Area code grid ─────────────────────────────────────────── */
.area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .75rem;
}
.area-card {
  background: var(--navy-700);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.area-card:hover  { border-color: var(--accent); background: var(--navy-600); transform: translateY(-2px); }
.area-card.active { border-color: var(--accent); background: rgba(37,99,235,.2); }
.area-code-label { font-size: 1.5rem; font-weight: 800; color: var(--accent-h); }
.area-name-label { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }

/* ── Search bar ─────────────────────────────────────────────── */
.search-bar {
  background: var(--navy-800);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end;
}
.search-bar .form-group { flex: 1; min-width: 200px; margin-bottom: 0; }

/* ── Member details form ────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .detail-grid { grid-template-columns: 1fr; } }

/* ── Signature canvas ───────────────────────────────────────── */
#signatureCanvas {
  background: var(--white);
  border-radius: var(--radius);
  cursor: crosshair;
  display: block;
  width: 100%;
  touch-action: none;
}

/* ── Step indicator ─────────────────────────────────────────── */
.steps {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 2rem; flex-wrap: wrap;
}
.step {
  display: flex; align-items: center; gap: .5rem;
  font-size: .85rem; font-weight: 600;
  color: var(--text-muted);
  padding: .5rem .75rem;
  border-radius: 50px;
  transition: all var(--transition);
}
.step.active   { color: var(--accent-h); }
.step.complete { color: var(--success); }
.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--navy-700);
  border: 2px solid var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
}
.step.active   .step-num { background: var(--navy-500); border-color: var(--accent); color: var(--white); }
.step.complete .step-num { background: var(--success); border-color: var(--success); color: var(--white); }
.step-divider { flex: 1; height: 2px; background: var(--navy-700); min-width: 20px; }

/* ── Confirmation box ───────────────────────────────────────── */
.confirm-box {
  text-align: center; padding: 2rem 1.5rem;
}
.confirm-icon {
  width: 70px; height: 70px; border-radius: 50%;
  background: rgba(34,197,94,.15);
  border: 2px solid var(--success);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; margin: 0 auto 1.25rem;
}
.confirm-name { font-size: 1.4rem; font-weight: 800; color: var(--accent-h); margin-bottom: .5rem; }
.confirm-date { font-size: .9rem; color: var(--text-muted); }
.confirm-id   { font-size: .8rem; color: var(--text-muted); margin-top: .5rem; }

/* ── Toast notification ─────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  background: var(--navy-700);
  border: 1px solid var(--border);
  color: var(--white);
  padding: .85rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: .875rem;
  animation: slideIn .3s ease;
  display: flex; align-items: center; gap: .75rem;
  min-width: 280px;
}
.toast-success { border-left: 4px solid var(--success); }
.toast-error   { border-left: 4px solid var(--danger); }
.toast-info    { border-left: 4px solid var(--accent); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Misc ───────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.gap-1  { gap: .5rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar-brand span { display: none; }
  .search-bar { flex-direction: column; }
  .modal-footer { flex-direction: column; }
  .modal-footer .btn { width: 100%; justify-content: center; }
}

/* ── Login page ─────────────────────────────────────────────── */
.login-bg {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(37,99,235,.2) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 10%, rgba(30,58,138,.3) 0%, transparent 50%),
    var(--navy-900);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.login-card {
  background: var(--navy-800);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
}
.login-logo {
  text-align: center; margin-bottom: 2rem;
}
.login-logo .logo-circle {
  width: 70px; height: 70px;
  background: linear-gradient(135deg, var(--navy-500), var(--accent));
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin: 0 auto .75rem;
  box-shadow: 0 8px 24px rgba(37,99,235,.4);
}
.login-logo h1 { font-size: 1.3rem; }
.login-logo p  { color: var(--text-muted); font-size: .875rem; margin-top: .25rem; }

/* ── Page sections ──────────────────────────────────────────── */
.page-header {
  background: var(--navy-800);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-bottom: 2rem;
}
.page-title { font-size: 1.4rem; }
.page-subtitle { color: var(--text-muted); font-size: .875rem; margin-top: .25rem; }

.section-title {
  font-size: 1rem; font-weight: 700;
  color: var(--accent-h);
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: .5rem;
}
.section-title::after {
  content: ''; flex: 1; height: 1px;
  background: var(--border);
}

/* ── Pre-reg actions row ────────────────────────────────────── */
.pre-reg-actions {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
  margin-bottom: 1.5rem;
}
.selected-area-info {
  display: flex; align-items: center; gap: .75rem;
  background: var(--navy-700);
  border: 1px solid var(--accent);
  border-radius: 50px;
  padding: .5rem 1.25rem;
  font-size: .9rem;
}
