/* ============================================================
   RUTA — plantilla de courier USA→Perú
   Sistema de diseño
   ============================================================ */

:root{
  /* Color */
  --ink:            #12211D;
  --teal-900:       #0E3B35;
  --teal-800:       #124A42;
  --teal-700:       #176156;
  --teal-500:       #1E8677;
  --teal-100:       #E4F0EC;
  --coral:          #FF6F59;
  --coral-dark:     #E2513C;
  --gold:           #D9A441;
  --bg:             #F6F5F0;
  --surface:        #FFFFFF;
  --border:         #E2DFD3;
  --success:        #2F9E6E;
  --success-bg:     #E4F5EC;
  --warning-bg:     #FBF0DC;
  --danger:         #E14B4B;
  --danger-bg:      #FCE9E8;
  --muted:          #5C6B66;

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", serif;
  --font-body: "Public Sans", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", monospace;

  /* Radius / shadow */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(18,33,29,.06);
  --shadow-md: 0 8px 24px rgba(14,59,53,.10);
  --shadow-lg: 0 20px 48px rgba(14,59,53,.16);
}

*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  font-family:var(--font-body);
  color:var(--ink);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
  line-height:1.55;
}
img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
button{ font-family:inherit; cursor:pointer; }
input,select,textarea{ font-family:inherit; font-size:1rem; }
ul{ margin:0; padding:0; list-style:none; }
h1,h2,h3,h4{ font-family:var(--font-display); margin:0; font-weight:600; letter-spacing:-.01em; }
p{ margin:0; }

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

.container{
  width:100%;
  max-width:1160px;
  margin:0 auto;
  padding:0 24px;
}

.eyebrow{
  font-family:var(--font-mono);
  font-size:.72rem;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--teal-700);
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.eyebrow::before{
  content:"";
  width:16px; height:1px;
  background:var(--coral);
  display:inline-block;
}

.section{ padding:88px 0; }
.section-head{
  max-width:640px;
  margin-bottom:44px;
}
.section-head h2{
  font-size:clamp(1.7rem,3vw,2.4rem);
  margin-top:12px;
}
.section-head p{
  color:var(--muted);
  margin-top:14px;
  font-size:1.03rem;
}
.section-alt{ background:var(--surface); border-top:1px solid var(--border); border-bottom:1px solid var(--border); }
.section-dark{ background:var(--teal-900); color:#F2F7F5; }
.section-dark .eyebrow{ color:#9FD6C7; }
.section-dark .eyebrow::before{ background:var(--coral); }
.section-dark .muted{ color:#B7CFC8; }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:13px 24px;
  border-radius:100px;
  font-weight:600;
  font-size:.95rem;
  border:1px solid transparent;
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space:nowrap;
}
.btn:active{ transform:translateY(1px); }
.btn-coral{ background:var(--coral); color:#fff; box-shadow:0 10px 24px rgba(255,111,89,.35); }
.btn-coral:hover{ background:var(--coral-dark); }
.btn-teal{ background:var(--teal-900); color:#fff; }
.btn-teal:hover{ background:var(--teal-800); }
.btn-outline{ background:transparent; border-color:var(--border); color:var(--ink); }
.btn-outline:hover{ border-color:var(--teal-700); color:var(--teal-700); }
.btn-ghost-light{ background:rgba(255,255,255,.08); border-color:rgba(255,255,255,.28); color:#fff; }
.btn-ghost-light:hover{ background:rgba(255,255,255,.16); }
.btn-block{ width:100%; }
.btn-sm{ padding:9px 16px; font-size:.85rem; }

/* ---------- Header / Nav ---------- */
.site-header{
  position:sticky; top:0; z-index:40;
  background:var(--teal-900);
  color:#fff;
}
.nav{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 0;
}
.brand{ display:flex; align-items:center; gap:10px; font-family:var(--font-display); font-size:1.3rem; font-weight:700; color:#fff; }
.brand-mark{
  width:34px;height:34px;border-radius:9px;
  background:linear-gradient(145deg,var(--coral),var(--gold));
  display:flex;align-items:center;justify-content:center;
  font-family:var(--font-mono); font-weight:700; color:#0E1F1B; font-size:.95rem;
}
.nav-links{ display:flex; align-items:center; gap:30px; }
.nav-links a{ font-size:.92rem; color:#D9E8E3; transition:color .15s ease; }
.nav-links a:hover{ color:#fff; }
.nav-cta{ display:flex; align-items:center; gap:12px; }
.nav-toggle{ display:none; background:none; border:1px solid rgba(255,255,255,.3); border-radius:8px; padding:8px 10px; color:#fff; }

.promo-bar{
  background:var(--coral);
  color:#fff;
  font-size:.86rem;
  text-align:center;
  padding:9px 16px;
}
.promo-bar b{ font-weight:700; }

/* ---------- Hero ---------- */
.hero{
  background:
    radial-gradient(circle at 85% 15%, rgba(255,111,89,.18), transparent 45%),
    var(--teal-900);
  color:#fff;
  padding:64px 0 90px;
  position:relative;
  overflow:hidden;
}
.hero-grid{
  display:grid;
  grid-template-columns:1.05fr .95fr;
  gap:56px;
  align-items:center;
}
.hero-badge{
  display:inline-flex; align-items:center; gap:8px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.18);
  padding:7px 14px; border-radius:100px;
  font-family:var(--font-mono); font-size:.72rem; letter-spacing:.08em; text-transform:uppercase;
  color:#BFE3D9;
  margin-bottom:22px;
}
.hero-badge .dot{ width:7px; height:7px; border-radius:50%; background:var(--coral); }
.hero h1{
  font-size:clamp(2.4rem,4.6vw,3.6rem);
  line-height:1.04;
  color:#fff;
}
.hero h1 em{ font-style:normal; color:var(--coral); }
.hero p.lead{
  margin-top:20px;
  font-size:1.1rem;
  color:#C7DED8;
  max-width:520px;
}
.hero-actions{ display:flex; gap:14px; margin-top:32px; flex-wrap:wrap; }
.hero-stats{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:18px;
  margin-top:56px;
  padding-top:28px;
  border-top:1px solid rgba(255,255,255,.14);
}
.hero-stats div b{ display:block; font-family:var(--font-display); font-size:1.5rem; color:#fff; }
.hero-stats div span{ font-size:.78rem; color:#9FBDB5; }

/* route illustration */
.route-card{
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.14);
  border-radius:var(--r-lg);
  padding:26px;
  backdrop-filter:blur(6px);
}
.route-card svg{ width:100%; height:auto; }
.route-label{ font-family:var(--font-mono); font-size:.72rem; color:#9FBDB5; letter-spacing:.06em; }

/* ---------- Feature grid ---------- */
.grid-4{ display:grid; grid-template-columns:repeat(4,1fr); gap:20px; }
.grid-3{ display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.grid-2{ display:grid; grid-template-columns:repeat(2,1fr); gap:20px; }

.feature-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r-md);
  padding:26px;
  transition:box-shadow .2s ease, transform .2s ease;
}
.feature-card:hover{ box-shadow:var(--shadow-md); transform:translateY(-2px); }
.feature-icon{
  width:42px;height:42px;border-radius:11px;
  background:var(--teal-100); color:var(--teal-700);
  display:flex;align-items:center;justify-content:center;
  margin-bottom:16px;
}
.feature-card h3{ font-size:1.05rem; margin-bottom:8px; }
.feature-card p{ color:var(--muted); font-size:.92rem; }

/* ---------- Steps ---------- */
.steps{ display:grid; grid-template-columns:repeat(4,1fr); gap:0; counter-reset:step; position:relative; }
.step{ position:relative; padding:0 20px 0 0; }
.step:not(:last-child)::after{
  content:""; position:absolute; top:22px; right:-10px; width:20px; height:1px;
  border-top:2px dashed var(--border);
}
.step-num{
  font-family:var(--font-mono); font-size:.78rem; color:var(--coral);
  border:1px solid var(--coral); width:44px; height:44px; border-radius:50%;
  display:flex; align-items:center; justify-content:center; margin-bottom:16px;
}
.step h3{ font-size:1.02rem; margin-bottom:6px; }
.step p{ color:var(--muted); font-size:.9rem; }

/* ---------- Calculator ---------- */
.calc-panel{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r-lg);
  padding:38px;
  box-shadow:var(--shadow-md);
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:36px;
}
.calc-field{ margin-bottom:18px; }
.calc-field label{ display:block; font-size:.85rem; color:var(--muted); margin-bottom:8px; }
.calc-field input{
  width:100%; padding:13px 14px; border:1px solid var(--border); border-radius:var(--r-sm);
  font-size:1rem; background:var(--bg);
}
.calc-field input:focus{ outline:none; border-color:var(--teal-500); background:#fff; }
.calc-result{
  background:var(--teal-900); color:#fff; border-radius:var(--r-md);
  padding:28px; display:flex; flex-direction:column; justify-content:center;
}
.calc-result .amount{ font-family:var(--font-display); font-size:2.6rem; color:#fff; }
.calc-result .tax-pill{
  display:inline-flex; align-items:center; gap:8px; margin-top:14px;
  padding:6px 12px; border-radius:100px; font-size:.82rem; font-family:var(--font-mono);
}
.tax-pill.no-tax{ background:rgba(47,158,110,.2); color:#8FE3B6; }
.tax-pill.has-tax{ background:rgba(217,164,65,.22); color:#F1CE86; }
.calc-note{ font-size:.78rem; color:#9FBDB5; margin-top:16px; }
.rate-line{ font-size:.85rem; color:var(--muted); margin-top:20px; }
.rate-line b{ color:var(--ink); }

/* ---------- Category grid ---------- */
.cat-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
.cat-card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md);
  padding:22px 18px; text-align:center;
}
.cat-card .ic{ font-size:1.6rem; margin-bottom:10px; }
.cat-card span{ font-size:.88rem; font-weight:600; }

.callout{
  margin-top:36px;
  background:var(--teal-100);
  border:1px solid #CBE6DD;
  border-radius:var(--r-md);
  padding:26px 30px;
  display:flex; align-items:center; justify-content:space-between; gap:24px; flex-wrap:wrap;
}
.callout p{ color:var(--teal-900); max-width:560px; font-size:.94rem; }
.callout h4{ font-size:1.1rem; margin-bottom:6px; }

/* ---------- Register CTA band ---------- */
.register-band{
  background:linear-gradient(120deg,var(--teal-900),var(--teal-700));
  color:#fff; border-radius:var(--r-lg); padding:52px; overflow:hidden; position:relative;
  display:grid; grid-template-columns:1.2fr .8fr; gap:40px; align-items:center;
}
.register-band h2{ color:#fff; font-size:clamp(1.5rem,2.6vw,2.1rem); }
.register-band p{ color:#C7DED8; margin-top:12px; }
.register-perks{ display:flex; flex-direction:column; gap:14px; }
.register-perks li{ display:flex; gap:10px; align-items:flex-start; font-size:.92rem; color:#E4F0EC; }
.register-perks li::before{ content:"✓"; color:var(--coral); font-weight:700; }

/* ---------- FAQ ---------- */
.faq-item{ border-bottom:1px solid var(--border); padding:20px 0; }
.faq-q{ display:flex; align-items:center; justify-content:space-between; cursor:pointer; gap:20px; }
.faq-q h4{ font-size:1rem; font-weight:600; }
.faq-q .chev{ transition:transform .2s ease; color:var(--coral); flex:none; }
.faq-item.open .faq-q .chev{ transform:rotate(45deg); }
.faq-a{ max-height:0; overflow:hidden; transition:max-height .25s ease; }
.faq-a p{ color:var(--muted); font-size:.92rem; padding-top:14px; }
.faq-item.open .faq-a{ max-height:400px; }

/* ---------- Footer ---------- */
.site-footer{ background:var(--teal-900); color:#C7DED8; padding:64px 0 26px; }
.footer-grid{ display:grid; grid-template-columns:1.6fr 1fr 1fr 1.1fr; gap:36px; margin-bottom:48px; }
.footer-grid h5{ color:#fff; font-size:.82rem; letter-spacing:.06em; text-transform:uppercase; margin-bottom:16px; font-family:var(--font-mono); font-weight:600; }
.footer-grid a{ display:block; font-size:.9rem; color:#B7CFC8; margin-bottom:10px; }
.footer-grid a:hover{ color:#fff; }
.footer-bottom{ border-top:1px solid rgba(255,255,255,.12); padding-top:22px; display:flex; justify-content:space-between; font-size:.82rem; color:#8AAAA1; flex-wrap:wrap; gap:10px; }

/* ================= AUTH PAGES ================= */
.auth-wrap{
  min-height:100vh; display:flex;
  background:var(--teal-900);
}
.auth-visual{
  flex:1; position:relative; overflow:hidden;
  display:flex; align-items:flex-end; padding:48px;
  background:radial-gradient(circle at 30% 20%, rgba(255,111,89,.22), transparent 50%), var(--teal-900);
}
.auth-visual-inner{ color:#fff; max-width:420px; }
.auth-visual-inner .eyebrow{ color:#9FD6C7; }
.auth-visual-inner h2{ color:#fff; font-size:1.9rem; margin-top:14px; }
.auth-visual-inner p{ color:#C7DED8; margin-top:12px; font-size:.95rem; }
.auth-form-side{
  width:460px; background:var(--bg); display:flex; align-items:center; justify-content:center; padding:40px;
}
.auth-card{ width:100%; max-width:360px; }
.auth-card .brand{ color:var(--ink); margin-bottom:36px; }
.auth-card .brand-mark{ background:linear-gradient(145deg,var(--coral),var(--gold)); }
.auth-card h1{ font-size:1.6rem; margin-bottom:8px; }
.auth-card .sub{ color:var(--muted); font-size:.9rem; margin-bottom:28px; }
.field{ margin-bottom:16px; }
.field label{ display:block; font-size:.83rem; font-weight:600; margin-bottom:7px; color:var(--ink); }
.field input, .field select, .field textarea{
  width:100%; padding:12px 14px; border:1px solid var(--border); border-radius:var(--r-sm); background:#fff;
}
.field input:focus, .field select:focus, .field textarea:focus{ outline:none; border-color:var(--teal-500); }
.field-row{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.field-hint{ font-size:.78rem; color:var(--muted); margin-top:6px; }
.field-error{ font-size:.78rem; color:var(--danger); margin-top:6px; display:none; }
.field.invalid input{ border-color:var(--danger); }
.field.invalid .field-error{ display:block; }
.auth-foot{ text-align:center; margin-top:22px; font-size:.88rem; color:var(--muted); }
.demo-hint{
  margin-top:22px; background:var(--teal-100); border:1px solid #CBE6DD; border-radius:var(--r-sm);
  padding:12px 14px; font-size:.8rem; color:var(--teal-900); font-family:var(--font-mono);
}
.toast{
  position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(20px);
  background:var(--ink); color:#fff; padding:13px 22px; border-radius:100px; font-size:.88rem;
  opacity:0; pointer-events:none; transition:all .25s ease; z-index:200; box-shadow:var(--shadow-lg);
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
.toast.success{ background:var(--success); }

/* ================= DASHBOARD ================= */
.dash{ display:flex; min-height:100vh; background:var(--bg); }
.dash-sidebar{
  width:250px; background:var(--teal-900); color:#fff; padding:26px 18px; flex:none;
  display:flex; flex-direction:column; position:sticky; top:0; height:100vh;
}
.dash-sidebar .brand{ color:#fff; padding:0 8px; margin-bottom:34px; }
.dash-nav a{
  display:flex; align-items:center; gap:12px; padding:11px 12px; border-radius:var(--r-sm);
  color:#B7CFC8; font-size:.9rem; margin-bottom:4px; transition:background .15s ease,color .15s ease;
}
.dash-nav a svg{ flex:none; }
.dash-nav a:hover{ background:rgba(255,255,255,.06); color:#fff; }
.dash-nav a.active{ background:rgba(255,255,255,.1); color:#fff; font-weight:600; }
.dash-sidebar .spacer{ flex:1; }
.dash-user{
  display:flex; align-items:center; gap:10px; padding:12px; border-radius:var(--r-sm);
  background:rgba(255,255,255,.06); font-size:.85rem;
}
.dash-user .av{
  width:34px;height:34px;border-radius:50%; background:linear-gradient(145deg,var(--coral),var(--gold));
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:.8rem; color:#12211D; flex:none;
}
.dash-main{ flex:1; padding:32px 40px; min-width:0; }
.dash-topbar{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:28px; flex-wrap:wrap; gap:16px; }
.dash-topbar h1{ font-size:1.7rem; }
.dash-topbar p{ color:var(--muted); margin-top:6px; font-size:.92rem; }

.stat-row{ display:grid; grid-template-columns:repeat(4,1fr); gap:18px; margin-bottom:30px; }
.stat-card{ background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md); padding:20px; }
.stat-card .label{ font-size:.78rem; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; font-family:var(--font-mono); }
.stat-card .value{ font-family:var(--font-display); font-size:1.9rem; margin-top:8px; }
.stat-card .delta{ font-size:.78rem; margin-top:6px; }
.stat-card .delta.up{ color:var(--success); }
.stat-card .delta.flat{ color:var(--muted); }

.panel{ background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md); overflow:hidden; }
.panel-head{ display:flex; justify-content:space-between; align-items:center; padding:20px 22px; border-bottom:1px solid var(--border); }
.panel-head h3{ font-size:1.05rem; }

table.orders{ width:100%; border-collapse:collapse; font-size:.88rem; }
table.orders th{
  text-align:left; padding:12px 22px; font-size:.72rem; text-transform:uppercase; letter-spacing:.05em;
  color:var(--muted); font-family:var(--font-mono); border-bottom:1px solid var(--border); background:#FAFAF7;
}
table.orders td{ padding:14px 22px; border-bottom:1px solid var(--border); vertical-align:middle; }
table.orders tbody tr{ cursor:pointer; transition:background .12s ease; }
table.orders tbody tr:hover{ background:#FAFAF7; }
table.orders tbody tr:last-child td{ border-bottom:none; }
.order-code{ font-family:var(--font-mono); font-size:.82rem; color:var(--teal-700); }

.badge{ display:inline-flex; align-items:center; gap:6px; padding:5px 11px; border-radius:100px; font-size:.76rem; font-weight:600; }
.badge::before{ content:""; width:6px;height:6px;border-radius:50%; }
.badge.b-transito{ background:var(--warning-bg); color:#946200; }
.badge.b-transito::before{ background:var(--gold); }
.badge.b-entregado{ background:var(--success-bg); color:#1E7A50; }
.badge.b-entregado::before{ background:var(--success); }
.badge.b-recibido{ background:var(--teal-100); color:var(--teal-700); }
.badge.b-recibido::before{ background:var(--teal-500); }
.badge.b-aduana{ background:var(--danger-bg); color:#B23A3A; }
.badge.b-aduana::before{ background:var(--danger); }
.badge.b-pendiente{ background:#EFEDE3; color:#6B6656; }
.badge.b-pendiente::before{ background:#A8A290; }

/* Modal */
.modal-overlay{
  position:fixed; inset:0; background:rgba(14,29,25,.55); display:none;
  align-items:flex-start; justify-content:center; padding:60px 20px; z-index:100; overflow-y:auto;
}
.modal-overlay.show{ display:flex; }
.modal{ background:#fff; border-radius:var(--r-lg); max-width:600px; width:100%; padding:34px; box-shadow:var(--shadow-lg); }
.modal-head{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:22px; }
.modal-head h3{ font-size:1.25rem; }
.modal-close{ background:none; border:none; font-size:1.3rem; color:var(--muted); line-height:1; }

.tracking-steps{ list-style:none; margin:0; padding:0; }
.tracking-steps li{ display:flex; gap:14px; padding-bottom:22px; position:relative; }
.tracking-steps li:not(:last-child)::before{
  content:""; position:absolute; left:11px; top:26px; bottom:0; width:1px; background:var(--border);
}
.tracking-steps .dot{
  width:24px;height:24px;border-radius:50%; background:#EFEDE3; color:#A8A290;
  display:flex; align-items:center; justify-content:center; flex:none; font-size:.7rem; margin-top:2px;
}
.tracking-steps li.done .dot{ background:var(--success); color:#fff; }
.tracking-steps li.current .dot{ background:var(--coral); color:#fff; }
.tracking-steps .t-title{ font-weight:600; font-size:.9rem; }
.tracking-steps .t-date{ font-size:.78rem; color:var(--muted); margin-top:2px; font-family:var(--font-mono); }

/* Utility */
.mt-8{ margin-top:8px; } .mt-16{ margin-top:16px; } .mt-24{ margin-top:24px; } .mt-32{ margin-top:32px; }
.flex{ display:flex; } .items-center{ align-items:center; } .justify-between{ justify-content:space-between; } .gap-8{gap:8px;} .gap-12{gap:12px;}
.text-muted{ color:var(--muted); }
.hidden{ display:none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 980px){
  .nav-links{ display:none; }
  .nav-toggle{ display:inline-flex; }
  .hero-grid{ grid-template-columns:1fr; }
  .hero-stats{ grid-template-columns:repeat(2,1fr); }
  .grid-4,.grid-3,.cat-grid,.steps{ grid-template-columns:repeat(2,1fr); }
  .steps .step::after{ display:none; }
  .calc-panel{ grid-template-columns:1fr; }
  .register-band{ grid-template-columns:1fr; padding:34px; }
  .footer-grid{ grid-template-columns:1fr 1fr; }
  .auth-visual{ display:none; }
  .auth-form-side{ width:100%; }
  .dash-sidebar{ display:none; }
  .dash-main{ padding:24px; }
  .stat-row{ grid-template-columns:repeat(2,1fr); }
}
@media (max-width: 560px){
  .grid-4,.grid-3,.cat-grid,.steps,.hero-stats{ grid-template-columns:1fr 1fr; }
  .section{ padding:56px 0; }
  .field-row{ grid-template-columns:1fr; }
  table.orders{ font-size:.8rem; }
  table.orders th, table.orders td{ padding:10px 12px; }
}
