/* Portal de soporte para clientes: mismo lenguaje visual que el panel
   (vidrio líquido sobre negro profundo), autocontenido porque se sirve
   desde su propio dominio. */
:root {
  --bg: #05070a;
  --ink: #f5f7fa;
  --ink-2: rgba(236,241,246,.72);
  --ink-3: rgba(236,241,246,.52);
  --accent: #5ee6d6;
  --ok: #46d39a;  --warn: #f2b84b;  --crit: #ff6b7d;  --check: #a796ff;
  --hair: rgba(255,255,255,.07);
  --fill: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
  --edge: inset 0 1px 0 rgba(255,255,255,.12), inset 0 0 0 1px rgba(255,255,255,.03);
  --drop: 0 1px 2px rgba(0,0,0,.35), 0 30px 70px -30px rgba(0,0,0,.85);
  --rim: linear-gradient(155deg, rgba(255,255,255,.34), rgba(255,255,255,.07) 30%, rgba(255,255,255,0) 55%, rgba(255,255,255,.12));
  --ease: cubic-bezier(.22, 1, .36, 1);
  --sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh; font-family: var(--sans); font-size: 15px; line-height: 1.55; letter-spacing: -.006em;
  color: var(--ink); -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1000px 600px at 10% -15%, rgba(34,195,208,.14), transparent 62%),
    radial-gradient(900px 600px at 105% 0%, rgba(110,104,255,.09), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  padding: max(16px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
}
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .045; z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: rgba(94,230,214,.28); color: #fff; }
:focus-visible { outline: 2px solid rgba(94,230,214,.75); outline-offset: 2px; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); }

.shell { max-width: 640px; margin: 0 auto; }

/* Encabezado */
.marca { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 36px; }
.marca-logo { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; letter-spacing: -.04em; color: var(--ink); text-decoration: none; }
.marca-logo img { width: 34px; height: 34px; display: block; filter: drop-shadow(0 4px 14px rgba(18,182,201,.45)); }
.marca-tag {
  display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-2); padding: 6px 12px 6px 10px; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid var(--hair);
}
.marca-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(94,230,214,.15); }

h1 {
  font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.6rem); font-weight: 600; letter-spacing: -.045em; line-height: 1.06;
  background: linear-gradient(180deg, #fff 35%, rgba(255,255,255,.62)); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-wrap: balance;
}
.lead { margin-top: 12px; color: var(--ink-2); max-width: 52ch; }
.lead b { color: var(--ink); font-weight: 500; }

/* Tarjeta de vidrio */
.card {
  position: relative; margin-top: 28px; padding: 24px 20px; border-radius: 24px;
  background: var(--fill); border: 1px solid rgba(255,255,255,.04);
  -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%);
  box-shadow: var(--edge), var(--drop);
  animation: subir .7s var(--ease) backwards;
}
.card::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; background: var(--rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
@keyframes subir { from { opacity: 0; transform: translateY(10px); } }

/* Formulario */
.fila { display: grid; gap: 14px; }
.campo { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.campo label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.campo label small { color: var(--ink-3); font-weight: 400; }
.campo input, .campo textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); padding: 12px 14px; border-radius: 12px; outline: none;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.09); box-shadow: inset 0 1px 2px rgba(0,0,0,.25);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background-color .25s var(--ease);
}
.campo textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.campo input::placeholder, .campo textarea::placeholder { color: var(--ink-3); }
.campo input:focus, .campo textarea:focus { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.26); box-shadow: inset 0 1px 2px rgba(0,0,0,.25), 0 0 0 3px rgba(94,230,214,.16); }
.campo.con-error input, .campo.con-error textarea { border-color: rgba(255,107,125,.55); }
.error-campo { font-size: 12.5px; color: var(--crit); min-height: 0; }
.ayuda { font-size: 12.5px; color: var(--ink-3); }
.trampa { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Adjuntos */
.zona {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; padding: 14px;
  border-radius: 14px; border: 1px dashed rgba(255,255,255,.18); background: rgba(255,255,255,.025);
  color: var(--ink-2); font-size: 13.5px; cursor: pointer; text-align: center;
  transition: background .25s var(--ease), border-color .25s var(--ease);
}
.zona:hover, .zona.sobre { background: rgba(255,255,255,.05); border-color: rgba(94,230,214,.45); }
.zona svg { flex: none; color: var(--ink-3); }
.miniaturas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.mini { position: relative; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,.1); }
.mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini button {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}

/* Botones */
.acciones { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.btn {
  font: inherit; font-size: 15px; font-weight: 600; letter-spacing: -.01em; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 12px;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .25s var(--ease), opacity .2s;
}
.btn-primario {
  color: #07090c; background: linear-gradient(180deg, #fff, #e4e8ec); border: 1px solid rgba(255,255,255,.85);
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -12px rgba(255,255,255,.28);
}
.btn-primario:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 #fff, 0 2px 4px rgba(0,0,0,.4), 0 14px 34px -12px rgba(255,255,255,.4); }
.btn-primario:disabled { opacity: .55; cursor: progress; transform: none; }
.btn-secundario { color: var(--ink); background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.btn-secundario:hover { background: rgba(255,255,255,.09); }
.btn:active { transform: scale(.98); }
.btn-ancho { width: 100%; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(0,0,0,.2); border-top-color: #07090c; animation: girar .7s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

.aviso { padding: 12px 14px; border-radius: 12px; font-size: 13.5px; margin-bottom: 16px; }
.aviso-error { color: #ffd3d9; background: rgba(255,107,125,.1); border: 1px solid rgba(255,107,125,.28); }
.aviso-info { color: var(--ink-2); background: rgba(255,255,255,.04); border: 1px solid var(--hair); }

/* Estados de pantalla completa (cargando, link inválido, éxito) */
.estado { text-align: center; padding: 36px 8px 12px; }
.estado-ic {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 20px; display: grid; place-items: center;
  background: var(--fill); border: 1px solid rgba(255,255,255,.08); box-shadow: var(--edge);
}
.estado-ic.ok { color: var(--ok); box-shadow: var(--edge), 0 0 40px -10px rgba(70,211,154,.6); }
.estado h2 { font-size: 22px; font-weight: 600; letter-spacing: -.03em; }
.estado p { color: var(--ink-2); margin: 8px auto 0; max-width: 44ch; }
.estado .acciones { justify-content: center; margin-top: 24px; }
.numero-grande { font-family: var(--mono); font-size: 13px; color: var(--ink-3); letter-spacing: .04em; margin-bottom: 6px; }
.esqueleto { height: 14px; border-radius: 7px; margin: 10px auto; max-width: 70%; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.1), rgba(255,255,255,.04)); background-size: 200% 100%; animation: brillo 1.4s ease-in-out infinite; }
@keyframes brillo { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Seguimiento */
.tk-cabecera { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; padding: 4px 11px 4px 10px; border-radius: 999px;
  border: 1px solid transparent;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.pill.abierto { color: var(--accent); background: rgba(94,230,214,.1); border-color: rgba(94,230,214,.24); }
.pill.proceso { color: var(--warn); background: rgba(242,184,75,.1); border-color: rgba(242,184,75,.26); }
.pill.cerrado { color: var(--ok); background: rgba(70,211,154,.1); border-color: rgba(70,211,154,.24); }
.meta { font-size: 13px; color: var(--ink-3); }
.meta b { color: var(--ink-2); font-weight: 500; }

.pasos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 22px 0 6px; }
.paso { font-size: 12px; color: var(--ink-3); }
.paso::before { content: ""; display: block; height: 3px; border-radius: 3px; margin-bottom: 8px; background: rgba(255,255,255,.08); transition: background .5s var(--ease); }
.paso.hecho { color: var(--ink-2); }
.paso.hecho::before { background: var(--accent); box-shadow: 0 0 12px rgba(94,230,214,.5); }

.hilo { list-style: none; display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.msg { display: flex; gap: 12px; }
.msg-av {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600;
  color: var(--ink-2); background: rgba(255,255,255,.07); border: 1px solid var(--hair);
}
.msg.equipo .msg-av { color: #06110f; background: linear-gradient(135deg, #a2f3e9, #3cbfd0); border-color: transparent; }
.msg-cuerpo { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 4px 16px 16px 16px; background: rgba(255,255,255,.04); border: 1px solid var(--hair); }
.msg.equipo .msg-cuerpo { background: linear-gradient(180deg, rgba(94,230,214,.09), rgba(94,230,214,.04)); border-color: rgba(94,230,214,.18); }
.msg-cab { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; margin-bottom: 4px; font-size: 13px; }
.msg-cab b { font-weight: 600; }
.msg-cab time { color: var(--ink-3); font-size: 12px; }
.msg-texto { white-space: pre-wrap; word-break: break-word; color: var(--ink-2); font-size: 14.5px; }
.msg-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.msg-imgs img { max-width: 180px; max-height: 140px; border-radius: 10px; border: 1px solid var(--hair); cursor: zoom-in; display: block; }
.separador { height: 1px; background: var(--hair); margin: 22px 0; }
.respuesta textarea { min-height: 96px; }
.visor { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(3,5,8,.9); cursor: zoom-out; }
.visor img { max-width: 100%; max-height: 100%; border-radius: 12px; }

.pie { margin-top: 28px; text-align: center; font-size: 12.5px; color: var(--ink-3); }
.pie a { color: var(--ink-2); }

@media (min-width: 600px) {
  body { padding-top: 40px; }
  .card { padding: 32px 30px; border-radius: 28px; }
  .fila.dos { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card { background: #11151c; }
}
