/* ============================================================
   Amy — APD Legal Portal
   Dark Navy Theme
   ============================================================ */

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

:root {
  --bg:           #0a1628;
  --card:         #0d1b3e;
  --accent:       #1e3a5f;
  --accent-light: #2c4f7a;
  --blue:         #2563eb;
  --blue-hover:   #1d4ed8;
  --text:         #ffffff;
  --text-muted:   #e2e8f0;
  --text-subtle:  #94a3b8;
  --text-dim:     #64748b;
  --text-faint:   #475569;
  --border:       #1e3a5f;
  --shadow:       0 4px 24px rgba(0, 0, 0, 0.4);
  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    16px;
}

/* ── Base ── */

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text-muted);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  line-height: 1.3;
}

/* ── Utilities ── */

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.text-center { text-align: center; }
.text-muted   { color: var(--text-muted); }
.text-subtle  { color: var(--text-subtle); }
.text-dim     { color: var(--text-dim); }

/* ── Cards ── */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card-lg {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
}

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease, border-color 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: var(--blue);
  color: var(--text);
  border-color: var(--blue);
}

.btn-primary:hover {
  background: var(--blue-hover);
  border-color: var(--blue-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--text-subtle);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--blue);
  color: var(--text-muted);
}

.btn-sm {
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

/* ── Form Elements ── */

.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  outline: none;
  transition: border-color 0.2s ease;
  font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* ── Badges & Pills ── */

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  background: var(--accent);
  color: var(--text-subtle);
}

.badge-blue {
  background: rgba(37, 99, 235, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.badge-green {
  background: rgba(20, 83, 45, 0.3);
  color: #86efac;
  border: 1px solid rgba(20, 83, 45, 0.5);
}

.badge-amber {
  background: rgba(146, 64, 14, 0.3);
  color: #fbbf24;
  border: 1px solid rgba(146, 64, 14, 0.5);
}

.badge-red {
  background: rgba(127, 29, 29, 0.3);
  color: #fca5a5;
  border: 1px solid rgba(127, 29, 29, 0.5);
}

/* ── Dividers ── */

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* ── Alerts ── */

.alert {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  border: 1px solid;
}

.alert-info {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.3);
  color: #93c5fd;
}

.alert-warning {
  background: rgba(146, 64, 14, 0.15);
  border-color: rgba(217, 119, 6, 0.4);
  color: #fbbf24;
}

.alert-danger {
  background: rgba(127, 29, 29, 0.2);
  border-color: rgba(185, 28, 28, 0.4);
  color: #fca5a5;
}

.alert-success {
  background: rgba(20, 83, 45, 0.2);
  border-color: rgba(21, 128, 61, 0.4);
  color: #86efac;
}

/* ── Scrollbar (Webkit) ── */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-light);
}

/* ── Responsive ── */

@media (max-width: 640px) {
  .container {
    padding: 0 1rem;
  }

  .card, .card-lg {
    border-radius: var(--radius-sm);
    padding: 1.25rem;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.2rem; }
}
