/* ── Citizen Portal Styles ──────────────────────────────────── */
:root {
  --accent: #c2410c;
  --accent-dark: #9a3412;
  --accent-light: #fed7aa;
  --accent-bg: #fff7ed;
  --fg: #0f172a;
  --ink: #1e293b;
  --muted: #64748b;
  --border: #e2e0db;
  --surface: #ffffff;
  --surface-alt: #f5f4f0;
  --bg: #fafaf9;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --radius: 6px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Header ── */
.citizen-header {
  background: var(--fg);
  color: #fff;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.citizen-header .brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  text-decoration: none;
}
.brand-icon {
  width: 30px; height: 30px;
  background: var(--accent);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 800;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.header-nav a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 0.35rem 0.85rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.header-nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.header-nav a.active { background: var(--accent); color: #fff; }

/* ── Hero / Page Banner ── */
.page-hero {
  background: linear-gradient(135deg, var(--fg) 0%, #1e3a5f 100%);
  color: #fff;
  padding: 3rem 2rem;
  text-align: center;
}
.page-hero h1 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.page-hero p {
  font-size: 1.05rem;
  opacity: 0.8;
  max-width: 500px;
  margin: 0 auto;
}

/* ── Page Content ── */
.page-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* ── Wizard Progress ── */
.wizard-progress {
  display: flex;
  align-items: center;
  margin-bottom: 2.5rem;
  gap: 0;
}
.wizard-step {
  display: flex;
  align-items: center;
  flex: 1;
}
.wizard-step:last-child { flex: 0; }
.step-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-alt);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  flex-shrink: 0;
  transition: all 0.2s;
}
.step-label {
  display: none;
}
.wizard-step.active .step-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.wizard-step.completed .step-circle {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 0.5rem;
}
.wizard-step.completed + .wizard-step .step-line,
.wizard-step.active + .wizard-step .step-line {
  background: var(--accent);
}
@media (min-width: 600px) {
  .step-label {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    margin-left: 0.5rem;
    white-space: nowrap;
  }
  .wizard-step.active .step-label { color: var(--accent); font-weight: 600; }
  .wizard-step.completed .step-label { color: var(--success); }
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}
.card-header h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
}
.card-body { padding: 1.5rem; }

/* ── Form ── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.4rem;
}
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.25rem;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(194,65,12,0.1);
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-select { cursor: pointer; }

.form-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ── Errors Alert ── */
.alert {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.alert-danger {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}
.alert-success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #15803d;
}

/* ── Priority Selection ── */
.priority-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.priority-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.priority-option:hover { border-color: var(--accent); background: var(--accent-bg); }
.priority-option input[type="radio"] {
  margin-top: 0.2rem;
  accent-color: var(--accent);
  transform: scale(1.1);
}
.priority-option .priority-content { flex: 1; }
.priority-option .priority-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}
.priority-option .priority-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* ── File Upload ── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.upload-zone input[type="file"] { display: none; }
.upload-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.upload-zone h3 { font-size: 1rem; font-weight: 600; color: var(--ink); margin-bottom: 0.3rem; }
.upload-zone p { font-size: 0.85rem; color: var(--muted); }
.upload-zone .upload-formats { font-size: 0.78rem; color: var(--muted); margin-top: 0.5rem; }

.upload-file-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.uploaded-file {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
}
.uploaded-file .file-icon { font-size: 1.25rem; }
.uploaded-file .file-name { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploaded-file .file-size { color: var(--muted); font-size: 0.8rem; }
.uploaded-file .file-remove {
  background: none; border: none; cursor: pointer; color: var(--danger);
  font-size: 1.1rem; padding: 0.2rem;
}

/* ── Review Step ── */
.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.review-grid .full { grid-column: 1 / -1; }
.review-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.review-field span { font-size: 0.95rem; color: var(--ink); }
.review-field p { font-size: 0.95rem; color: var(--ink); line-height: 1.5; }
.review-description {
  background: var(--surface-alt);
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
}

/* ── Wizard Nav ── */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-secondary {
  background: var(--surface-alt);
  color: var(--ink);
  border: 1.5px solid var(--border);
}
.btn-outline {
  background: none;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Confirmation Page ── */
.confirmation-box {
  background: var(--surface);
  border: 2px solid var(--success);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
}
.confirmation-header {
  background: var(--success);
  color: #fff;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.confirmation-header h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
}
.confirmation-body { padding: 2rem; }

.ref-number-display {
  text-align: center;
  padding: 1.5rem;
  background: var(--accent-bg);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}
.ref-number-display .label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.ref-number-display .number {
  font-family: 'Courier New', monospace;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  margin-top: 0.5rem;
}
.copy-btn:hover { opacity: 0.8; }

.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.detail-row { display: flex; flex-direction: column; gap: 0.25rem; }
.detail-row .label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.detail-row .value { font-size: 0.95rem; color: var(--ink); font-weight: 500; }

.estimated-time {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.estimated-time .icon { font-size: 1.5rem; }
.estimated-time .label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.estimated-time .value { font-size: 0.95rem; font-weight: 600; color: var(--ink); }

.action-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* ── Tracking Page ── */
.tracking-form {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
}
.tracking-form h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--fg);
}
.tracking-form form { display: flex; gap: 0.75rem; }
.tracking-form .form-input { flex: 1; }
.tracking-form .form-input::placeholder { color: var(--muted); }

/* ── Tracking Result ── */
.tracking-result {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.tracking-result-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}
.tracking-result-header h3 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.5rem;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.85rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
}
.status-new { background: #eff6ff; color: #1e40af; }
.status-assigned { background: #f0fdf4; color: #15803d; }
.status-in_progress { background: #fffbeb; color: #b45309; }
.status-pending_info { background: #fdf4ff; color: #7e22ce; }
.status-resolved { background: #dcfce7; color: #166534; }
.status-closed { background: #f1f5f9; color: #475569; }
.status-rejected { background: #fef2f2; color: #dc2626; }

/* Progress bar */
.status-progress {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.progress-steps {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.4rem;
}
.progress-step.active { color: var(--accent); font-weight: 600; }
.progress-step.done { color: var(--success); }

/* Tracking details */
.tracking-body { padding: 1.5rem; }
.tracking-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Timeline */
.timeline { border-left: 2px solid var(--border); padding-left: 1.5rem; margin: 1rem 0; }
.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.6rem;
  top: 0.25rem;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
}
.timeline-item.status-change::before { background: var(--success); }
.timeline-item.note::before { background: var(--warning); }
.timeline-date {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.timeline-action {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}
.timeline-comment {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.2rem;
  line-height: 1.5;
}
.timeline-by { font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }

/* ── Footer ── */
.citizen-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}
.citizen-footer a { color: var(--accent); text-decoration: none; }
.citizen-footer a:hover { text-decoration: underline; }

/* ── Print styles ── */
@media print {
  .citizen-header, .wizard-nav, .header-nav, .action-buttons, .copy-btn, .citizen-footer { display: none !important; }
  body { background: #fff; color: #000; }
  .page-wrap { max-width: 100%; padding: 0; }
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .review-grid, .details-grid, .tracking-grid { grid-template-columns: 1fr; }
  .tracking-form form { flex-direction: column; }
  .action-buttons { flex-direction: column; }
  .action-buttons .btn { justify-content: center; }
}