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

:root {
  --green:       #1D9E75;
  --green-dark:  #0F6E56;
  --green-light: #E1F5EE;
  --red:         #A32D2D;
  --amber:       #854F0B;
  --text:        #1a1a1a;
  --text-muted:  #5F5E5A;
  --border:      #D3D1C7;
  --bg:          #F8F7F4;
  --white:       #ffffff;
  --radius:      8px;
  --radius-lg:   12px;
}

body { font-family: system-ui, -apple-system, sans-serif; font-size: 15px; color: var(--text); background: var(--bg); line-height: 1.6; }

.container { max-width: 960px; margin: 0 auto; padding: 0 1rem; }
.narrow    { max-width: 600px; }

/* Header */
.site-header { background: var(--green); padding: 0.75rem 0; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-dot { width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,0.25); display: inline-block; }
.brand-name { display: block; font-size: 15px; font-weight: 600; color: #fff; }
.brand-sub  { display: block; font-size: 11px; color: rgba(255,255,255,0.75); }
.site-header nav { display: flex; align-items: center; gap: 1rem; }
.site-header nav a { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 14px; }
.site-header nav a:hover { color: #fff; }
.btn-nav { background: rgba(255,255,255,0.2); padding: 6px 14px; border-radius: 20px; }

/* Main */
main.container { padding-top: 2rem; padding-bottom: 3rem; }
.page-title { font-size: 22px; font-weight: 600; margin-bottom: 0.5rem; }
.page-sub   { color: var(--text-muted); margin-bottom: 1.5rem; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 1rem; font-size: 14px; }
.alert-error   { background: #FCEBEB; color: #791F1F; border: 0.5px solid #F09595; }
.alert-success { background: var(--green-light); color: var(--green-dark); border: 0.5px solid #5DCAA5; }

/* Anon notice */
.anon-notice { background: var(--green-light); border-radius: var(--radius); padding: 10px 14px; font-size: 13px; color: var(--green-dark); margin-bottom: 1.5rem; }
.anon-notice strong { font-weight: 600; }

/* Form */
.form-card { background: var(--white); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; }
fieldset { border: none; margin-bottom: 1.5rem; }
legend { font-size: 13px; font-weight: 600; color: var(--green-dark); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; display: block; }
.fieldset-note { font-size: 13px; color: var(--text-muted); margin-bottom: 1rem; }
.field { margin-bottom: 1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 5px; }
.req { color: var(--red); }
.opt { color: var(--text-muted); font-size: 12px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=password], select, textarea {
  width: 100%; padding: 9px 12px; border: 0.5px solid var(--border); border-radius: var(--radius);
  font-size: 14px; color: var(--text); background: var(--white); font-family: inherit; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-light); }
textarea { resize: vertical; }
.hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: block; }

/* Chips */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-label input { display: none; }
.chip-label span { display: inline-block; padding: 6px 14px; border: 0.5px solid var(--border); border-radius: 20px; font-size: 13px; cursor: pointer; color: var(--text-muted); }
.chip-label input:checked + span { background: var(--green-light); border-color: var(--green); color: var(--green-dark); font-weight: 500; }

/* Buttons */
.btn-primary { display: inline-block; background: var(--green); color: #fff; padding: 12px 24px; border-radius: var(--radius); font-size: 15px; font-weight: 500; border: none; cursor: pointer; text-decoration: none; font-family: inherit; }
.btn-primary:hover { background: var(--green-dark); }
.btn-outline { display: inline-block; background: transparent; color: var(--green); padding: 12px 24px; border-radius: var(--radius); font-size: 15px; border: 1px solid var(--green); cursor: pointer; text-decoration: none; font-family: inherit; }
.btn-full { width: 100%; text-align: center; }
.btn-sm { padding: 5px 12px; font-size: 13px; border: 0.5px solid var(--border); border-radius: var(--radius); background: transparent; cursor: pointer; color: var(--text); text-decoration: none; display: inline-block; font-family: inherit; }

/* Success card */
.success-card { background: var(--white); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 2.5rem; text-align: center; margin-top: 1rem; }
.success-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--green-light); display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; font-size: 24px; color: var(--green); }
.success-card h1 { font-size: 22px; margin-bottom: 0.5rem; }
.success-card p { color: var(--text-muted); margin-bottom: 1rem; }
.ref-box { background: var(--bg); border-radius: var(--radius); padding: 1rem; margin: 1.5rem 0; }
.ref-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.ref-code { font-size: 28px; font-weight: 700; letter-spacing: 0.1em; color: var(--text); }
.note { font-size: 13px; color: var(--text-muted); margin-bottom: 0.75rem; }
.success-actions { display: flex; gap: 1rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }

/* Track form */
.track-form { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; }
.track-form input { flex: 1; }

/* Case card */
.case-card { background: var(--white); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; margin-top: 1rem; }
.case-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; }
.case-ref  { font-size: 18px; font-weight: 700; }
.case-type { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.case-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 1rem; margin-bottom: 1.25rem; }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-step { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.tl-step:not(:last-child)::before { content: ''; position: absolute; left: 7px; top: 20px; bottom: 0; width: 1px; background: var(--border); }
.tl-dot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; margin-top: 2px; }
.tl-done .tl-dot    { background: var(--green); }
.tl-pending .tl-dot { background: var(--border); }
.tl-content strong { display: block; font-size: 14px; font-weight: 500; }
.tl-content span   { font-size: 12px; color: var(--text-muted); }

/* Status badges */
.status-badge { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.status-open      { background: #E6F1FB; color: #0C447C; }
.status-in_review { background: #FAEEDA; color: #633806; }
.status-resolved  { background: #EAF3DE; color: #27500A; }
.status-rejected  { background: #FCEBEB; color: #791F1F; }

/* Footer */
.site-footer { border-top: 0.5px solid var(--border); padding: 1.25rem 0; margin-top: 3rem; }
.site-footer p { font-size: 13px; color: var(--text-muted); }
.site-footer a { color: var(--green); text-decoration: none; }

@media (max-width: 600px) {
  .field-row { grid-template-columns: 1fr; }
  .track-form { flex-direction: column; }
  .success-actions { flex-direction: column; }
}
