/* =========================================================
   Austral Exchange — sistema de diseño compartido
   ========================================================= */

:root {
  /* superficies */
  --bg-0: #05070d;
  --bg-1: #0a1120;
  --panel: #0d1526;
  --panel-2: #0f1a30;
  --panel-3: #111d36;
  --input-bg: #0a1220;

  /* líneas */
  --line: rgba(120, 160, 220, 0.14);
  --line-strong: rgba(120, 170, 230, 0.28);

  /* texto */
  --text: #eef2f9;
  --muted: #7c8aa3;
  --muted-2: #566280;

  /* marca */
  --teal: #2be6a8;
  --teal-deep: #16b884;
  --blue: #2f8fe6;
  --blue-deep: #1c5fc7;
  --usdt: #26a17b;
  --gold: #f0c94a;
  --danger: #ff6b6b;
  --warn: #ffb648;
  --ok: #2be6a8;

  /* whatsapp */
  --wa-dark: #075e54;
  --wa-mid: #128c7e;
  --wa-bright: #25d366;
  --wa-brighter: #3fe883;

  /* geometría */
  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Space Grotesk", "Inter", sans-serif;

  --shadow-card: 0 30px 60px -24px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 12px 26px -12px rgba(47, 143, 230, 0.55);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg-0);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, .display { font-family: var(--display); letter-spacing: -0.01em; }
a { color: inherit; }
img, svg { max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

::selection { background: rgba(43, 230, 168, 0.28); }

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

/* ---------- utilidades ---------- */

.accent {
  background: linear-gradient(90deg, var(--teal), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mono-num { font-family: var(--display); font-variant-numeric: tabular-nums; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 480px) { .wrap { padding: 0 18px; } }

/* ---------- marca ---------- */

.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; }
.brand-lockup .mark { width: 40px; height: 40px; flex-shrink: 0; }
.brand-lockup .words { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand-lockup .name {
  font-family: var(--display); font-weight: 700; font-size: 16px;
  letter-spacing: 0.04em; white-space: nowrap;
}
.brand-lockup .tag {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted-2); margin-top: 3px; white-space: nowrap;
}

/* ---------- botones ---------- */

.btn {
  font-weight: 700; font-size: 14.5px; letter-spacing: 0.01em;
  padding: 13px 22px; border-radius: var(--r-md); border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  text-decoration: none; white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.18s ease, border-color 0.18s ease,
              background-position 0.35s ease, opacity 0.15s ease;
}
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { cursor: not-allowed; opacity: 0.55; }

.btn-primary {
  background: linear-gradient(90deg, var(--blue-deep), var(--blue) 55%, var(--teal));
  background-size: 170% 100%;
  color: #04101f;
  box-shadow: var(--shadow-glow);
}
.btn-primary:not([disabled]):hover { background-position: 100% 0%; }
.btn-primary[disabled] { background: linear-gradient(90deg, #2a3550, #33425f); color: var(--muted-2); box-shadow: none; }

.btn-ghost { background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--blue); }

.btn-danger { background: rgba(255, 107, 107, 0.1); border: 1px solid rgba(255, 107, 107, 0.35); color: #ff9d9d; }
.btn-danger:hover { background: rgba(255, 107, 107, 0.18); }

.btn-whatsapp {
  position: relative; color: #eafff3;
  background: linear-gradient(90deg, var(--wa-dark), var(--wa-mid) 55%, var(--wa-bright));
  box-shadow: 0 16px 32px -14px rgba(37, 211, 102, 0.5);
}
.btn-whatsapp::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: 0;
  background: linear-gradient(90deg, var(--wa-mid), var(--wa-bright) 45%, var(--wa-brighter));
  opacity: 0; transition: opacity 0.35s ease;
}
.btn-whatsapp:hover::before { opacity: 1; }
.btn-whatsapp > * { position: relative; z-index: 1; }
.btn-whatsapp svg { fill: currentColor; }

.btn-sm { padding: 9px 14px; font-size: 13px; border-radius: var(--r-sm); }
.btn-block { width: 100%; }

/* ---------- píldoras / chips ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.pill-live { color: var(--teal); background: rgba(43, 230, 168, 0.09); border: 1px solid rgba(43, 230, 168, 0.28); }
.pill-live .dot { animation: pulseDot 1.7s ease-in-out infinite; }
.pill-warn { color: var(--warn); background: rgba(255, 182, 72, 0.09); border: 1px solid rgba(255, 182, 72, 0.3); }
.pill-blue { color: #7fb6f5; background: rgba(47, 143, 230, 0.1); border: 1px solid rgba(47, 143, 230, 0.3); }
.pill-muted { color: var(--muted); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.pill-danger { color: #ff9d9d; background: rgba(255, 107, 107, 0.1); border: 1px solid rgba(255, 107, 107, 0.3); }

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(43, 230, 168, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(43, 230, 168, 0); }
}

/* ---------- tarjetas ---------- */

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(19, 30, 54, 0.9), rgba(10, 17, 32, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
}
.card-topline::before {
  content: ""; position: absolute; top: -1px; left: 18px; right: 18px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--teal), var(--blue), transparent);
  opacity: 0.75;
}

/* ---------- formularios ---------- */

.field { margin-bottom: 15px; }
.field > label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 7px;
}
.field input, .field select, .field textarea {
  width: 100%; background: var(--input-bg); border: 1px solid var(--line);
  color: var(--text); font-size: 14px; padding: 11px 13px; border-radius: var(--r-sm);
  outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 143, 230, 0.12);
}
.field select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237c8aa3' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.field textarea { resize: vertical; min-height: 62px; line-height: 1.5; }
.field .hint { font-size: 11.5px; color: var(--muted-2); margin-top: 6px; line-height: 1.5; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }

/* ---------- toast ---------- */

.toast-stack {
  position: fixed; right: 18px; bottom: 18px; z-index: 999;
  display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100vw - 36px));
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(13, 21, 38, 0.97); border: 1px solid var(--line-strong);
  border-left: 3px solid var(--teal);
  border-radius: var(--r-md); padding: 12px 14px; font-size: 13.5px;
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.8);
  animation: toastIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
.toast.out { animation: toastOut 0.25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* ---------- accesibilidad ---------- */

:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
