/*
 * Shared design system for the TA Complaint site.
 * Mobile-first: base rules target small screens, min-width media queries
 * layer on enhancements for tablet/desktop. Built on top of Bootstrap 5
 * (loaded separately) — this file only adds the site's own look & feel.
 */

:root {
  --brand-primary: #0f5c8c;
  --brand-primary-dark: #0b4468;
  --brand-accent: #17a2b8;
  --brand-success: #1a8c4c;
  --brand-danger: #c0392b;
  --brand-warning: #d98b1f;
  --surface: #ffffff;
  --surface-muted: #f4f7f9;
  --text-primary: #1c2b36;
  --text-muted: #5b6b76;
  --border-color: #d8e0e5;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(16, 42, 67, 0.08);
  --shadow-md: 0 4px 16px rgba(16, 42, 67, 0.12);
}

* { box-sizing: border-box; }

body {
  background: var(--surface-muted);
  color: var(--text-primary);
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--brand-primary); }
a:hover { color: var(--brand-primary-dark); }

/* ---------- Layout shell ---------- */

.site-nav {
  background: var(--brand-primary);
  padding: 0.6rem 1rem;
}

.site-nav .navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
}

.site-nav .navbar-brand img { height: 32px; width: auto; }

.site-nav .nav-link {
  color: rgba(255,255,255,0.9) !important;
  font-weight: 500;
}

.site-nav .nav-link:hover { color: #fff !important; }

.page-shell {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem;
}

.page-shell.page-shell-wide { max-width: 1200px; }
.page-shell.page-shell-full { max-width: 100%; }

.page-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 1rem 0 1rem;
  color: var(--text-primary);
}

/* ---------- Cards / panels ---------- */

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.panel-header {
  background: var(--brand-primary);
  color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0.9rem 1.25rem;
  margin: -1.25rem -1.25rem 1.25rem;
  font-weight: 600;
}

/* ---------- Forms ---------- */

.form-field { margin-bottom: 1rem; }

.char-counter {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 0.25rem;
}

.char-counter-warn { color: var(--brand-danger); font-weight: 600; }

.form-field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.form-field .form-control,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--surface);
  min-height: 44px; /* touch target */
}

.form-field .form-control:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(15, 92, 140, 0.15);
}

.btn-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--brand-success);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.4rem;
  font-weight: 600;
  font-size: 1rem;
  min-height: 44px;
  cursor: pointer;
  width: 100%;
}

.btn-brand:hover { filter: brightness(0.95); color: #fff; }

.btn-brand-secondary {
  background: var(--brand-accent);
}

.btn-brand-outline {
  background: transparent;
  color: var(--brand-primary);
  border: 1px solid var(--brand-primary);
}

/* Stack action buttons full-width on phones, inline on larger screens */
.btn-row {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* ---------- Tables: horizontal scroll on small screens instead of squeeze ---------- */

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}

.table-scroll table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.table-scroll th,
.table-scroll td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
  text-align: left;
}

.table-scroll th {
  background: var(--surface-muted);
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Alerts / helper text ---------- */

.helper-banner {
  background: #fff7e6;
  border: 1px solid var(--brand-warning);
  color: #6b4b0f;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.status-banner {
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}
.status-banner-success { background: #eaf7ee; border-color: var(--brand-success); color: #14532d; }
.status-banner-error   { background: #fdecea; border-color: var(--brand-danger);  color: #7a271a; }

/* ---------- Tablet and up ---------- */
@media (min-width: 600px) {
  .page-shell { padding: 1.5rem; }
  .btn-row { flex-direction: row; }
  .btn-brand, .btn-brand-outline, .btn-brand-secondary { width: auto; }
  .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.25rem;
  }
}

/* ---------- Desktop and up ---------- */
@media (min-width: 992px) {
  .page-shell { padding: 2rem; }
  .panel { padding: 1.75rem; }
  .panel-header { margin: -1.75rem -1.75rem 1.5rem; padding: 1.1rem 1.75rem; }
}
