/* =====================================================================
   Soporte VIRAL — sistema visual
   ===================================================================== */
:root {
  --navy:        #0A0C28;
  --navy-600:    #2A2E6A;
  --orange:      #FC5A00;
  --orange-600:  #E24E00;
  --orange-tint: #FFF1E9;
  --lime:        #C7E70C;
  --cream:       #F7F6F2;
  --white:       #FFFFFF;
  --ink:         #14162E;
  --muted:       #6B6F80;
  --line:        #E8E5DD;
  --line-2:      #F0EDE6;

  --blue:   #2563EB;  --blue-t:  #EAF0FE;
  --amber:  #B45309;  --amber-t: #FDF3E3;
  --green:  #16A34A;  --green-t: #E7F6EC;
  --gray:   #6B7280;  --gray-t:  #EFEFF2;

  --radius:   18px;
  --radius-s: 12px;
  --shadow:   0 1px 2px rgba(10,12,40,.04), 0 8px 24px rgba(10,12,40,.06);
  --shadow-lg:0 12px 40px rgba(10,12,40,.12);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 16px; }

/* ── Header ─────────────────────────────────────────────── */
.hdr {
  position: sticky; top: 0; z-index: 20;
  background: rgba(247,246,242,.86);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.hdr-in {
  max-width: 720px; margin: 0 auto;
  padding: 14px 20px;
  display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; }
.brand img { height: 26px; width: auto; display: block; }
.brand .sub {
  font-size: 12px; font-weight: 700; color: var(--orange);
  text-transform: uppercase; letter-spacing: .08em;
  padding: 3px 8px; background: var(--orange-tint); border-radius: 999px;
}
.nav { margin-left: auto; display: flex; gap: 4px; background: var(--white);
  padding: 4px; border-radius: 999px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.nav button {
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  padding: 7px 14px; border-radius: 999px; transition: .18s;
  white-space: nowrap;
}
.nav button.on { background: var(--navy); color: #fff; }
.nav button:not(.on):hover { color: var(--ink); }

/* ── Layout ─────────────────────────────────────────────── */
.wrap { max-width: 720px; margin: 0 auto; padding: 32px 20px 80px; }
.view { animation: rise .35s cubic-bezier(.22,1,.36,1); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
[hidden] { display: none !important; }

.hero { text-align: center; margin-bottom: 26px; }
.hero h1 { font-size: clamp(26px, 6vw, 34px); font-weight: 800; letter-spacing: -.03em; color: var(--navy); text-wrap: balance; }
.hero p { color: var(--muted); margin-top: 8px; font-size: 15.5px; max-width: 46ch; margin-inline: auto; }

.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px;
}
@media (max-width: 480px) { .card { padding: 20px 16px; } .wrap { padding: 24px 14px 72px; } }

/* ── Form ───────────────────────────────────────────────── */
.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
.label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.label .req { color: var(--orange); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.input, .textarea {
  width: 100%; padding: 12px 14px;
  background: var(--white); border: 1.5px solid var(--line);
  border-radius: var(--radius-s); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus {
  outline: none; border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(252,90,0,.12);
}
.input::placeholder, .textarea::placeholder { color: #A7A9B4; }
.textarea { resize: vertical; min-height: 108px; line-height: 1.55; }
.input.err, .textarea.err { border-color: #DC2626; box-shadow: 0 0 0 4px rgba(220,38,38,.1); }

/* categoría chips */
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 480px) { .cats { grid-template-columns: repeat(2, 1fr); } }
.cat {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 14px 8px; border: 1.5px solid var(--line); border-radius: var(--radius-s);
  background: var(--white); color: var(--muted); font-size: 12.5px; font-weight: 600;
  text-align: center; transition: .16s;
}
.cat svg { width: 22px; height: 22px; stroke: currentColor; }
.cat:hover { border-color: #D6D2C7; color: var(--ink); }
.cat.on { border-color: var(--orange); background: var(--orange-tint); color: var(--orange-600); }

/* datos opcionales */
.optionals { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .optionals { grid-template-columns: 1fr; } }
.toggle-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--navy-600); margin-bottom: 4px; }
.toggle-opt svg { width: 15px; height: 15px; transition: transform .2s; }
.toggle-opt.open svg { transform: rotate(90deg); }

/* dropzone fotos */
.drop {
  border: 1.5px dashed var(--line); border-radius: var(--radius-s);
  padding: 22px; text-align: center; color: var(--muted);
  transition: .16s; background: var(--line-2);
}
.drop.hot { border-color: var(--orange); background: var(--orange-tint); color: var(--orange-600); }
.drop svg { width: 26px; height: 26px; stroke: currentColor; margin-bottom: 6px; }
.drop b { color: var(--ink); font-weight: 600; }
.drop .link { color: var(--orange-600); font-weight: 700; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.thumb { position: relative; width: 74px; height: 74px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px;
  background: rgba(10,12,40,.72); color: #fff; border-radius: 999px;
  display: grid; place-items: center; font-size: 12px; line-height: 1;
}

/* ── Botón ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 12px; font-weight: 700; font-size: 15px;
  background: var(--orange); color: #fff; transition: .16s; width: 100%;
  box-shadow: 0 6px 16px rgba(252,90,0,.28);
}
.btn:hover { background: var(--orange-600); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(252,90,0,.34); }
.btn:active { transform: none; }
.btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.btn svg { width: 18px; height: 18px; }
.btn.ghost { background: var(--white); color: var(--navy); border: 1.5px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--navy-600); background: var(--cream); }
.spinner { width: 17px; height: 17px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 999px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.formerr { background: #FEECEC; color: #B42318; border: 1px solid #F7C6C6; border-radius: 10px; padding: 10px 14px; font-size: 13.5px; font-weight: 500; margin-bottom: 16px; }

/* ── Éxito ──────────────────────────────────────────────── */
.done { text-align: center; padding: 8px 0; }
.done .check { width: 66px; height: 66px; border-radius: 999px; background: var(--green-t); display: grid; place-items: center; margin: 0 auto 18px; animation: pop .4s cubic-bezier(.22,1.4,.5,1); }
.done .check svg { width: 34px; height: 34px; stroke: var(--green); }
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.done h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--navy); }
.done p { color: var(--muted); margin: 8px auto 20px; max-width: 40ch; }
.folio-box { display: inline-flex; align-items: center; gap: 12px; background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 12px; margin-bottom: 22px; }
.folio-box .code { font-size: 20px; font-weight: 800; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.folio-box button { color: rgba(255,255,255,.75); display: grid; place-items: center; }
.folio-box button:hover { color: #fff; }
.folio-box button svg { width: 18px; height: 18px; stroke: currentColor; }

/* ── Estatus / timeline ─────────────────────────────────── */
.status-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.status-head .code { font-size: 20px; font-weight: 800; letter-spacing: .03em; color: var(--navy); }
.status-head .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.pill .dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.pill.nuevo { color: var(--orange-600); background: var(--orange-tint); }
.pill.en_proceso { color: var(--blue); background: var(--blue-t); }
.pill.esperando_cliente { color: var(--amber); background: var(--amber-t); }
.pill.resuelto { color: var(--green); background: var(--green-t); }
.pill.cerrado { color: var(--gray); background: var(--gray-t); }

.sec-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 22px 0 10px; }
.desc-box { background: var(--line-2); border-radius: var(--radius-s); padding: 14px 16px; font-size: 14.5px; color: var(--ink); white-space: pre-wrap; }
.photos { display: flex; flex-wrap: wrap; gap: 10px; }
.photos a { width: 90px; height: 90px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); display: block; }
.photos img { width: 100%; height: 100%; object-fit: cover; }

.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ''; position: absolute; left: -26px; top: 3px; width: 16px; height: 16px; border-radius: 999px; background: #fff; border: 3px solid var(--orange); }
.tl-item.soporte::before { border-color: var(--blue); }
.tl-item.sistema::before { border-color: var(--gray); }
.tl-item .when { font-size: 12px; color: var(--muted); }
.tl-item .what { font-size: 14px; margin-top: 2px; }
.tl-item .who { font-weight: 700; }

.center-note { text-align: center; color: var(--muted); font-size: 13.5px; margin-top: 18px; }
.center-note a { color: var(--orange-600); font-weight: 600; text-decoration: none; }
.foot { text-align: center; color: #A7A9B4; font-size: 12px; margin-top: 34px; }
