/* ============================================================
   Family Registry System — Professional Dashboard Theme
   Government LGU / Barangay Information System
   ============================================================ */

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

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Primary palette */
  --primary:       #0f172a;
  --primary-light: #1e293b;
  --primary-mid:   #334155;
  --accent:        #3b82f6;
  --accent-dark:   #2563eb;
  --accent-light:  #60a5fa;
  --accent-bg:     #eff6ff;

  /* Semantic */
  --success:       #10b981;
  --success-bg:    #ecfdf5;
  --danger:        #ef4444;
  --danger-bg:     #fef2f2;
  --warning:       #f59e0b;
  --warning-bg:    #fffbeb;
  --info:          #6366f1;
  --info-bg:       #eef2ff;

  /* Surfaces */
  --bg:            #f1f5f9;
  --bg-subtle:     #f8fafc;
  --card-bg:       #ffffff;
  --text:          #0f172a;
  --text-secondary:#475569;
  --text-muted:    #94a3b8;
  --border:        #e2e8f0;
  --border-light:  #f1f5f9;

  /* Effects */
  --radius:        10px;
  --radius-lg:     14px;
  --radius-sm:     6px;
  --shadow-sm:     0 1px 2px rgba(0,0,0,0.05);
  --shadow:        0 1px 3px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md:     0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg:     0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);

  /* Transitions */
  --transition:    0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-light); text-decoration: none; }

/* ── Login Page ────────────────────────────────────────────── */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  background-color: var(--primary);
  background-image: url('../images/Background.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.login-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 420px;
  padding: 2.5rem 2rem 2rem;
  border: 1px solid rgba(255,255,255,0.1);
}

.login-card__header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-card__logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  display: block;
  object-fit: contain;
  border-radius: 16px;
}

.login-card__title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.login-card__subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  font-weight: 500;
}

/* ── Form Elements ─────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-size: 0.88rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  font-family: inherit;
}

.form-control:hover {
  border-color: #cbd5e1;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
  background: #fff;
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--border-light);
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8.825a.5.5 0 01-.354-.146l-4-4a.5.5 0 01.708-.708L6 7.617l3.646-3.646a.5.5 0 01.708.708l-4 4A.5.5 0 016 8.825z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  letter-spacing: 0.01em;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
  box-shadow: 0 1px 3px rgba(59,130,246,0.3);
}

.btn-primary:hover {
  background: var(--accent-dark);
  box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.btn-primary:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 1px 3px rgba(239,68,68,0.3);
}

.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 1px 3px rgba(16,185,129,0.3);
}

.btn-success:hover {
  background: #059669;
  box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}

.btn-outline {
  background: #fff;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}

.btn-outline:hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
  color: var(--text);
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

/* ── Alert Messages ────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  display: none;
  line-height: 1.5;
}

.alert.show { display: block; }

.alert-error {
  background: var(--danger-bg);
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.alert-success {
  background: var(--success-bg);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-warning {
  background: var(--warning-bg);
  color: #92400e;
  border: 1px solid #fde68a;
}

/* ── Loading Spinner ───────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ── Top Navbar ────────────────────────────────────────────── */
.navbar {
  background: var(--primary);
  color: #fff;
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.navbar__brand {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  letter-spacing: -0.01em;
}

.navbar__brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: contain;
}

.navbar__user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.navbar__nav-link {
  color: rgba(255,255,255,0.65);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.navbar__nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
  text-decoration: none;
}

.navbar__user-info {
  text-align: right;
  line-height: 1.35;
  padding: 0 0.5rem;
  border-left: 1px solid rgba(255,255,255,0.1);
  margin-left: 0.25rem;
  padding-left: 0.75rem;
}

.navbar__user-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.navbar__user-role {
  font-size: 0.68rem;
  opacity: 0.55;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.navbar__logout {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.75);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.navbar__logout:hover {
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
  border-color: rgba(239,68,68,0.25);
}

/* ── Dashboard Layout ──────────────────────────────────────── */
.dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.dashboard__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ── Stat Cards ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.stat-card__label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.stat-card__value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-card--accent::before { background: var(--accent); }
.stat-card--accent .stat-card__value { color: #1d4ed8; }
.stat-card--success::before { background: var(--success); }
.stat-card--success .stat-card__value { color: #059669; }
.stat-card--warning::before { background: var(--warning); }
.stat-card--warning .stat-card__value { color: #d97706; }
.stat-card--danger::before { background: var(--danger); }
.stat-card--danger .stat-card__value { color: #dc2626; }
.stat-card--info::before { background: var(--info); }
.stat-card--info .stat-card__value { color: #4f46e5; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-light);
}

.card__title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* ── Tables ────────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

thead th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: var(--accent-bg);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ── Password Toggle ───────────────────────────────────────── */
.password-wrapper {
  position: relative;
}

.password-wrapper .form-control {
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.2rem;
  transition: color var(--transition);
}

.password-toggle:hover { color: var(--text); }

/* ── Card Footer (login/register links) ────────────────────── */
.login-card__footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.login-card__footer a {
  font-weight: 600;
  color: var(--accent);
}

/* ── Password Strength Hint ────────────────────────────────── */
.form-hint {
  font-size: 0.78rem;
  margin-top: 0.35rem;
  min-height: 1rem;
  font-weight: 500;
}

.form-hint--weak   { color: var(--danger); }
.form-hint--good   { color: var(--warning); }
.form-hint--strong { color: var(--success); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; height: 56px; }
  .navbar__user { gap: 0.35rem; }
  .navbar__user-info { display: none; }
  .dashboard { padding: 1.25rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .login-card { padding: 2rem 1.25rem 1.5rem; }
  .dashboard { padding: 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .stat-card__value { font-size: 1.35rem; }
  .stat-card { padding: 1rem; }
}
