/* ==========================================================================
   VisaPro: client tracking page
   Mobile first. System fonts only (no external requests).
   ========================================================================== */

:root {
  --brand: #003B45;
  --brand-hover: #0B5563;
  --brand-tint: #E3EEEF;
  --accent: #FF8200;          /* from the logo's paper plane */
  --bg: #F2F5F5;
  --surface: #FFFFFF;
  --line: #D5DFE0;
  --text: #12292E;
  --muted: #56696D;
  --danger: #B3261E;
  --danger-tint: #FCE8E6;
  --wa: #1E7A4E;
  --focus: #F2A900;
  --radius-s: 8px;
  --radius-m: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 17px; line-height: 1.5;
  min-height: 100vh; display: flex; flex-direction: column;
}
h1, h2 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
#app:focus { outline: none; }
[hidden] { display: none !important; }

/* ---------- Header ---------- */
.t-header { background: var(--brand); padding-top: env(safe-area-inset-top, 0px); }
.t-header-inner {
  max-width: 640px; margin: 0 auto; padding: 0.8rem 1.1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.t-brand img { display: block; height: 38px; width: auto; }
.t-lang { display: flex; border: 1px solid rgba(255,255,255,0.45); border-radius: 999px; overflow: hidden; }
.t-lang button {
  font: inherit; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.04em;
  background: transparent; color: #fff; border: 0; padding: 0.4rem 0.8rem; min-width: 44px; min-height: 36px; cursor: pointer;
}
.t-lang button[aria-pressed="true"] { background: #fff; color: var(--brand); }

/* ---------- Layout ---------- */
.t-main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 1.25rem 1.1rem 2rem; }
.t-loading { color: var(--muted); }
.t-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-m); padding: 1.35rem; margin-bottom: 1rem;
}
.t-intro { color: var(--muted); }

/* ---------- Lookup form ---------- */
.t-field { margin-bottom: 1.1rem; }
.t-field > label, .t-legend { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.t-hint { font-size: 0.88rem; color: var(--muted); margin: 0.35rem 0 0; }
fieldset { border: 0; margin: 0 0 1.1rem; padding: 0; }
legend { padding: 0; }

input[type="text"], select {
  width: 100%; font: inherit; color: var(--text); background: #fff;
  border: 1px solid #B9C7C9; border-radius: var(--radius-s);
  padding: 0.7rem 0.75rem; min-height: 50px;
}
input:focus, select:focus { border-color: var(--brand); }
.t-code-input {
  font-size: 1.3rem !important; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.t-code-input::placeholder { font-weight: 400; letter-spacing: 0.04em; color: #9AABAE; }
.t-dob { display: grid; grid-template-columns: 1fr 1.6fr 1.2fr; gap: 0.5rem; }

.t-btn {
  font: inherit; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 50px; padding: 0.6rem 1.2rem; border-radius: var(--radius-s); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; width: 100%;
}
.t-btn:disabled { opacity: 0.6; cursor: progress; }
.t-btn-primary { background: var(--brand); color: #fff; }
.t-btn-primary:hover:not(:disabled) { background: var(--brand-hover); }
.t-btn-outline { background: #fff; color: var(--brand); border-color: var(--brand); }
.t-btn-outline:hover { background: var(--brand-tint); }
.t-btn-wa { background: var(--wa); color: #fff; }
.t-btn-wa:hover { background: #17633F; }
.t-btn-link { background: none; border: 0; padding: 0; color: var(--brand); text-decoration: underline; font: inherit; cursor: pointer; }

.t-alert { border-radius: var(--radius-s); padding: 0.8rem 0.9rem; margin-bottom: 1rem; background: var(--danger-tint); color: var(--danger); border: 1px solid #F1B8B3; }
.t-alert:empty { display: none; }
.t-privacy { font-size: 0.85rem; color: var(--muted); margin: 0.9rem 0 0; }

/* ---------- Result: current status (the one bold moment) ---------- */
.t-greeting { font-size: 1.05rem; margin: 0 0 0.2rem; }
.t-service { color: var(--muted); margin: 0 0 1rem; }
.t-status {
  background: var(--brand); color: #fff; border-radius: var(--radius-m);
  padding: 1.4rem 1.35rem 1.25rem; margin-bottom: 1rem; position: relative; overflow: hidden;
}
.t-status::after {               /* folded corner in the logo's orange */
  content: ""; position: absolute; right: 0; top: 0; width: 44px; height: 44px;
  background: var(--accent); clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.t-status-label { font-size: 0.9rem; opacity: 0.8; margin: 0 0 0.25rem; }
.t-status-name { font-size: clamp(1.45rem, 6vw, 1.85rem); font-weight: 750; line-height: 1.15; margin: 0 0 0.75rem; max-width: 92%; }
.t-status-msg { font-size: 1.02rem; margin: 0 0 1rem; opacity: 0.95; }
.t-status-date { font-size: 0.88rem; opacity: 0.75; margin: 0; }
.t-closed { background: rgba(255,255,255,0.15); border-radius: var(--radius-s); padding: 0.5rem 0.7rem; font-size: 0.92rem; margin: 0 0 0.9rem; }

/* ---------- Timeline ---------- */
.t-timeline { list-style: none; margin: 0; padding: 0; }
.t-step { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 0.75rem; padding-bottom: 1.15rem; }
.t-step:last-child { padding-bottom: 0; }
.t-step::before {                 /* connecting line */
  content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line);
}
.t-step:last-child::before { display: none; }
.t-step.done::before { background: var(--brand); }
.t-dot {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid #B9C7C9; background: #fff;
  display: flex; align-items: center; justify-content: center; position: relative; z-index: 1;
}
.t-step.done .t-dot { background: var(--brand); border-color: var(--brand); }
.t-step.done .t-dot::after {      /* check mark */
  content: ""; width: 7px; height: 12px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg);
}
.t-step.current .t-dot { border-color: var(--accent); border-width: 3px; }
.t-step.current .t-dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.t-step-name { margin: 0.15rem 0 0; font-weight: 600; }
.t-step.upcoming .t-step-name { color: var(--muted); font-weight: 400; }
.t-step.current .t-step-name { font-weight: 750; color: var(--brand); }
.t-step-date { margin: 0; font-size: 0.85rem; color: var(--muted); }

/* ---------- Help and disclaimer ---------- */
.t-help h2 { margin-bottom: 0.3rem; }
.t-contact { display: grid; gap: 0.6rem; margin-top: 0.9rem; }
@media (min-width: 520px) { .t-contact { grid-template-columns: 1fr 1fr; } }
.t-disclaimer { font-size: 0.88rem; color: var(--muted); margin: 0; }
.t-help .t-disclaimer-box { margin: 1rem 0 0; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.t-again { text-align: center; margin: 1.25rem 0 0; }

/* ---------- Footer ---------- */
.t-footer { text-align: center; font-size: 0.82rem; color: var(--muted); padding: 1rem 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px)); }
.t-footer a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
