:root{
  --bg0:#000000;
  --bg1:#020617;
  --bg2:#071227;

  --panel:#071227ee;
  --panel2:#0b2346f0;

  --white:#ffffff;
  --text:#f9fafb;
  --muted:#dbeafe;

  --gold-700:#8a6a12;
  --gold-600:#b3891a;
  --gold-500:#d4af37;
  --gold-400:#f2d06b;
  --gold-300:#ffe8a3;

  --blue-700:#1d4ed8;
  --blue-600:#2563eb;
  --blue-500:#3b82f6;
  --blue-400:#60a5fa;
  --blue-300:#93c5fd;

  --red-600:#dc2626;
  --red-500:#ef4444;
  --red-400:#f87171;

  --glow-gold: 0 0 0 1px rgba(212,175,55,.28), 0 0 22px rgba(212,175,55,.26), 0 18px 60px rgba(0,0,0,.72);
  --glow-blue: 0 0 0 1px rgba(96,165,250,.22), 0 0 26px rgba(59,130,246,.22), 0 18px 60px rgba(0,0,0,.72);
  --glow-red:  0 0 0 1px rgba(239,68,68,.22), 0 0 24px rgba(239,68,68,.18), 0 18px 60px rgba(0,0,0,.72);

  --shadow-deep: 0 26px 90px rgba(0,0,0,.78);

  --radius:16px;
  --radius2:14px;
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial;
  color:var(--text);
  -webkit-font-smoothing:antialiased;

  background:
    radial-gradient(1100px 600px at 50% -10%, rgba(59,130,246,.38), rgba(0,0,0,0) 65%),
    radial-gradient(900px 520px at 15% 20%, rgba(212,175,55,.22), rgba(0,0,0,0) 62%),
    radial-gradient(900px 520px at 85% 20%, rgba(239,68,68,.14), rgba(0,0,0,0) 65%),
    linear-gradient(180deg, var(--bg1), var(--bg0) 65%);
  background-attachment: fixed;
}

.topbar{
  position:sticky;
  top:0;
  z-index:10;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(2,6,23,.62);
  border-bottom: 1px solid rgba(212,175,55,.28);
}

.topbar--premium{
  background:
    radial-gradient(900px 240px at 50% 0%, rgba(212,175,55,.18), rgba(0,0,0,0) 60%),
    linear-gradient(180deg, rgba(2,6,23,.72), rgba(2,6,23,.50));
  border-bottom: 1px solid rgba(212,175,55,.34);
}

.topbar__inner{
  margin:0 auto;
  max-width: 860px;
  padding: 10px clamp(12px, 4vw, 18px) 8px;
}

.topbar__inner--premium{
  position: relative;
}

.topbar__inner--premium::before{
  content:"";
  position:absolute;
  inset: -1px 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg,
    rgba(212,175,55,0),
    rgba(212,175,55,.85),
    rgba(59,130,246,.55),
    rgba(212,175,55,.85),
    rgba(212,175,55,0)
  );
  opacity: .55;
  pointer-events:none;
}

.topbar__divider{
  height: 1px;
  width: min(560px, 92vw);
  margin: 10px auto 6px;
  background: linear-gradient(90deg,
    rgba(212,175,55,0),
    rgba(212,175,55,.35),
    rgba(59,130,246,.25),
    rgba(212,175,55,.35),
    rgba(212,175,55,0)
  );
  opacity: .9;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
}

.brand--stack{
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.logo{
  width:44px;
  height:44px;
  flex:0 0 auto;
  display:grid;
  place-items:center;
}

.logo svg{
  width:44px;
  height:44px;
  display:block;
  filter: drop-shadow(0 14px 30px rgba(0,0,0,.62));
}

.logo--xl{
  width:88px;
  height:88px;
}

.logo--xl svg{
  width:88px;
  height:88px;
}

.brand__text{min-width:0}
.brand__text--center{
  text-align:center;
  width:100%;
}

.title-main{
  font-weight: 1000;
  letter-spacing: .2px;
  font-size: 22px;
  line-height: 1.15;
  color: var(--white);
  text-shadow:
    0 0 18px rgba(255,255,255,.22),
    0 0 34px rgba(59,130,246,.14);
}

.title-sub{
  margin-top: 4px;
  font-weight: 950;
  font-size: 16px;
  color: var(--gold-400);
  line-height: 1.2;
  text-shadow:
    0 0 22px rgba(212,175,55,.38),
    0 0 44px rgba(212,175,55,.22);
}

/* Oculto pero el JS sigue escribiendo aquí */
.sub{
  margin-top:2px;
  font-size: 12px;
  color: rgba(255,255,255,.76);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(78vw, 760px);
  display:none;
}

.statusbar{
  margin-top: 6px;
  min-height: 16px;
  font-size: 12px;
  color: rgba(255,255,255,.78);
  text-shadow: 0 0 14px rgba(0,0,0,.35);
}
.statusbar--center{ text-align:center; }

.container{
  margin:0 auto;
  max-width: 860px;
  padding: 10px clamp(12px, 4vw, 18px) calc(84px + env(safe-area-inset-bottom));
}

.panel{
  border-radius: var(--radius);
  padding: 10px;

  background:
    radial-gradient(700px 220px at 50% 0%, rgba(212,175,55,.20), rgba(0,0,0,0) 62%),
    radial-gradient(800px 260px at 50% 0%, rgba(59,130,246,.14), rgba(0,0,0,0) 62%),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(7,18,39,.76));
  border: 1px solid rgba(212,175,55,.38);

  box-shadow: var(--glow-gold), var(--shadow-deep);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.form{display:grid; gap:10px}

/* details/summary: ocultar el marcador por defecto ("▶") */
details > summary{ list-style: none; }
details > summary::-webkit-details-marker{ display:none; }
details > summary::marker{ content: ""; }

.field{
  display:grid;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius2);

  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(2,6,23,.82));
  border: 1px solid rgba(212,175,55,.22);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}

.label{
  font-weight: 950;
  font-size: 13px;
  line-height: 1.25;
  color: rgba(255,255,255,.94);
  text-shadow: 0 0 14px rgba(255,255,255,.06);
}

.control{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap: wrap;
}

input[type="text"], input[type="number"], select, textarea{
  width: 100%;
  max-width: 720px;
  min-height: 44px;
  padding: 10px 12px;

  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(2,6,23,.92));
  border: 1px solid rgba(212,175,55,.24);
  border-radius: 12px;
  color: var(--text);

  outline: none;
  font-size: 16px;

  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
  transition: border-color .16s ease, box-shadow .16s ease, transform .12s ease, background-color .16s ease;
}

textarea{min-height: 88px; resize: vertical}

input:hover, select:hover, textarea:hover{
  border-color: rgba(96,165,250,.40);
}

input:focus, select:focus, textarea:focus{
  border-color: rgba(96,165,250,.78);
  box-shadow:
    0 0 0 2px rgba(96,165,250,.14),
    0 0 24px rgba(59,130,246,.18),
    inset 0 0 0 1px rgba(255,255,255,.08);
  transform: translateY(-1px);
}

.btn{
  border: 1px solid rgba(212,175,55,.24);
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 999px;
  cursor:pointer;

  color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.04);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);

  transition: transform .06s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease;
  font-weight: 950;
  font-size: 15px;
  flex: 1 1 auto;
}

.btn:active{transform: translateY(1px)}

.btn-primary{
  background: linear-gradient(135deg,
    var(--gold-400) 0%,
    #ffffff 22%,
    var(--blue-300) 52%,
    var(--gold-500) 100%);
  color: #071227;
  border: 1px solid rgba(255,255,255,.88);
  box-shadow: 0 24px 70px rgba(0,0,0,.72), 0 0 0 1px rgba(212,175,55,.32);
}

.btn-secondary{
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.22);
  color: rgba(255,255,255,.92);
}

.btn-secondary:hover{
  background: rgba(59,130,246,.10);
  border-color: rgba(96,165,250,.55);
  box-shadow: var(--glow-blue);
}

.btn-danger{
  color:#fff;
  background: linear-gradient(135deg,
    rgba(7,18,39,.98),
    rgba(220,38,38,.55),
    rgba(7,18,39,.98));
  border-color: rgba(212,175,55,.70);
  box-shadow: var(--glow-red);
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border-radius: 999px;

  background: rgba(212,175,55,.10);
  border: 1px solid rgba(212,175,55,.24);
  color: rgba(255,255,255,.92);
  font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}

.badge button{
  border: none;
  background: transparent;
  cursor:pointer;
  color: rgba(255,255,255,.78);
  font-weight: 1000;
  font-size: 16px;
  line-height: 1;
}
.badge button:hover{color: var(--white)}

.zipbox{display:grid; gap:10px; width:100%}
.zipinputrow{display:flex; gap:10px; align-items:center; width:100%}
.zipinputrow input{flex: 1 1 auto}
.zipchips{display:flex; gap: 8px; flex-wrap: wrap}

.actionsbar{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;

  padding: 10px clamp(12px, 4vw, 18px) calc(10px + env(safe-area-inset-bottom));
  background: rgba(2,6,23,.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(212,175,55,.28);

  display:flex;
  gap:10px;
  justify-content:space-between;
  z-index: 20;
}

.actionsbar--premium{
  background:
    radial-gradient(900px 220px at 50% 0%, rgba(59,130,246,.16), rgba(0,0,0,0) 65%),
    linear-gradient(180deg, rgba(2,6,23,.78), rgba(2,6,23,.62));
  border-top: 1px solid rgba(212,175,55,.32);
}

.btn-save{
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  border-color: rgba(255,255,255,.88);
  box-shadow:
    0 0 0 1px rgba(212,175,55,.26),
    0 0 34px rgba(212,175,55,.30),
    0 26px 70px rgba(0,0,0,.72);
}

.btn-save::before{
  content:"";
  position:absolute;
  inset:-40% -60%;
  background: linear-gradient(120deg,
    rgba(255,255,255,0) 30%,
    rgba(255,255,255,.26) 45%,
    rgba(255,255,255,0) 60%
  );
  transform: translateX(-25%);
  animation: btnShine 2.6s ease-in-out infinite;
  pointer-events:none;
}

@keyframes btnShine{
  0%{ transform: translateX(-35%) rotate(6deg); opacity:0; }
  22%{ opacity:.55; }
  55%{ transform: translateX(35%) rotate(6deg); opacity:0; }
  100%{ transform: translateX(35%) rotate(6deg); opacity:0; }
}

.btn-save:hover{
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(96,165,250,.18),
    0 0 40px rgba(212,175,55,.34),
    0 0 26px rgba(59,130,246,.18),
    0 30px 80px rgba(0,0,0,.78);
}

.btn-reload:hover{
  box-shadow:
    0 0 0 1px rgba(96,165,250,.22),
    0 0 28px rgba(59,130,246,.18),
    0 24px 70px rgba(0,0,0,.70);
}

.toast{
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  bottom: calc(72px + env(safe-area-inset-bottom));
  width: min(520px, calc(100vw - 24px));
  padding: 12px 12px;
  border-radius: 999px;

  border: 1px solid rgba(255,255,255,.22);
  background: rgba(7,18,39,.92);
  box-shadow: 0 24px 70px rgba(0,0,0,.72), 0 0 0 1px rgba(212,175,55,.18);

  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  font-size: 13px;
  color: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.ok{
  border-color: rgba(255,255,255,.88);
  background: linear-gradient(135deg,
    var(--gold-400) 0%,
    #ffffff 22%,
    var(--blue-300) 52%,
    var(--gold-500) 100%);
  color:#071227;
  box-shadow: var(--glow-gold), var(--shadow-deep);
}

.toast.err{
  color:#fff;
  background: linear-gradient(135deg,
    rgba(7,18,39,.98),
    rgba(220,38,38,.55),
    rgba(7,18,39,.98));
  border-color: rgba(212,175,55,.70);
  box-shadow: var(--glow-red), var(--shadow-deep);
}

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