:root {
  --blue: #0039a6;
  --blue-dark: #09275b;
  --red: #d52b1e;
  --ink: #16253d;
  --muted: #667085;
  --paper: #f6f8fc;
  --line: #d9e1ef;
  --green: #217348;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(circle at 12% 5%, #eaf1ff 0, transparent 26rem), linear-gradient(180deg, #fbfcff 0, var(--paper) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

body::before { content: ""; display: block; height: 6px; background: var(--red); }

.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 48px; }
.auth { width: min(456px, calc(100% - 32px)); margin: 32px auto 0; padding-top: 0; }

.hero {
  position: relative;
  overflow: hidden;
  min-height: 168px;
  padding: 24px 26px;
  border-radius: 24px;
  border-bottom: 4px solid var(--red);
  color: #fff;
  background: #073a8e url('/hero-fiesta-v2.png') center center / cover no-repeat;
  box-shadow: 0 18px 35px rgba(4, 40, 105, .20);
}

.auth-hero { min-height: 254px; padding: 38px 26px 22px; }

.hero > * { position: relative; z-index: 2; }
.top { display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.login-head { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.hero-copy { min-width: 0; }

.brand-lockup { display: grid; justify-items: start; width: max-content; max-width: 100%; }
.brand-logo-frame { display: block; width: 166px; height: 76px; overflow: hidden; }

.brand-logo {
  display: block;
  width: 218px;
  max-width: none;
  height: auto;
  transform: translate(-35px, -44px);
  filter: drop-shadow(0 3px 7px rgba(0,0,0,.28));
}

.brand-subtitle {
  margin: -4px 0 0 6px;
  color: rgba(255,255,255,.96);
  font-size: .52rem;
  font-weight: 800;
  letter-spacing: .13em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .28);
}

.hero h1 { margin: 10px 0 0; max-width: 285px; font-size: clamp(1.62rem, 5.5vw, 2.25rem); line-height: 1.12; letter-spacing: -.035em; text-shadow: 0 2px 6px rgba(0, 25, 72, .38); }
.hero p { margin: 8px 0 0; color: #edf5ff; font-size: .94rem; text-shadow: 0 1px 4px rgba(0, 25, 72, .45); }

.flag {
  display: block;
  width: 62px;
  height: auto;
  flex: 0 0 62px;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 5px;
  box-shadow: 0 3px 8px rgba(0,0,0,.2);
}

.hero-bunting { display: none; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: 0 10px 26px rgba(29, 55, 95, .07); }
.auth .card { position: relative; margin-top: 16px; border-top: 4px solid var(--red); }
h2, h3 { margin: 0; }
h2 { font-size: 1.38rem; letter-spacing: -.025em; }
h3 { font-size: 1rem; }
form { display: grid; gap: 14px; margin-top: 20px; }

.access-note { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 5px; }
.access-note p { margin: 0; }
.chupalla { width: 68px; height: 50px; flex: 0 0 68px; object-fit: contain; }

label { display: grid; gap: 7px; color: var(--blue-dark); font-size: .93rem; font-weight: 750; }
input, select, button { width: 100%; min-height: 52px; padding: 12px 14px; border: 1px solid #bdc9da; border-radius: 12px; font: inherit; }
input { color: var(--ink); background: #fff; }
input:focus { outline: 3px solid #b8ceff; border-color: var(--blue); }

button { border: 0; color: #fff; background: var(--blue); font-weight: 800; cursor: pointer; transition: transform .15s ease, filter .15s ease; }
button:hover { filter: brightness(1.08); }
button:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; opacity: .48; }
button.secondary { width: auto; min-height: 40px; padding: 8px 12px; color: var(--blue); background: #eaf1ff; }
button.danger { background: var(--red); }
button.green { background: var(--green); }

.muted { color: var(--muted); }
.small { font-size: .86rem; }
.switch { color: var(--blue); font-weight: 750; cursor: pointer; text-decoration: underline; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 16px; }
.product { border-top: 4px solid var(--blue); }
.product:nth-child(3n + 2) { border-top-color: var(--red); }
.product:nth-child(3n) { border-top-color: var(--green); }
.qty { margin: 8px 0 3px; color: var(--blue-dark); font-size: 1.85rem; font-weight: 850; }
.notice { margin: 14px 0; padding: 10px 12px; border-radius: 10px; color: #815800; background: #fff4d9; font-size: .9rem; }

.tabs { display: flex; gap: 9px; flex-wrap: wrap; margin: 18px 0; }
.tabs button { width: auto; min-height: 40px; padding: 8px 12px; color: var(--blue); background: #eaf1ff; }
.tabs button.active { color: #fff; background: var(--blue); }
.hidden { display: none !important; }

.tablewrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 9px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.table th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.tag { display: inline-block; padding: 5px 9px; border-radius: 999px; background: #edf2f8; font-size: .78rem; font-weight: 800; }
.tag.pending { color: #8b5a00; background: #fff2ce; }
.tag.delivered { color: #087151; background: #d9f4ea; }
.actions, .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions button { width: auto; min-height: 37px; padding: 7px 10px; font-size: .84rem; }
.spread { justify-content: space-between; }

.delivery-remaining { display: flex; gap: 6px; min-width: 210px; flex-wrap: wrap; }
.remaining-chip { display: inline-block; padding: 5px 8px; border: 1px solid #c8d8f4; border-radius: 999px; color: #113f87; background: #eef4ff; font-size: .76rem; font-weight: 750; }
.remaining-chip.done { border-color: #bee4d1; color: #13724b; background: #e7f8ee; }

.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(8, 27, 61, .53); }
.modal { width: min(100%, 500px); max-height: min(720px, calc(100vh - 40px)); overflow: auto; box-shadow: 0 24px 58px rgba(4, 17, 42, .32); }
.modal form { margin-top: 18px; }
.modal .actions { margin-top: 4px; }
.modal .actions button:first-child { min-width: 154px; }

#toast { position: fixed; right: 18px; bottom: 18px; z-index: 20; display: none; max-width: 340px; padding: 14px 16px; border-radius: 12px; color: #fff; background: var(--blue-dark); box-shadow: 0 8px 28px rgba(0,0,0,.25); }

/* Se eliminan las decoraciones que invadían los formularios. */
.fiesta-side { display: none !important; }

@media (max-width: 600px) {
  body::before { height: 5px; }
  .wrap { width: min(100% - 28px, 456px); padding: 18px 0 36px; }
  .auth { width: min(100% - 28px, 456px); margin-top: 22px; }
  .hero { min-height: 164px; padding: 20px; border-radius: 22px; }
  .auth-hero { min-height: 246px; padding: 35px 20px 19px; }
  .login-head { align-items: flex-start; }
  .brand-logo-frame { width: 151px; height: 72px; }
  .brand-logo { width: 199px; transform: translate(-32px, -40px); }
  .brand-subtitle { margin-top: -4px; margin-left: 5px; font-size: .47rem; }
  .hero h1 { margin-top: 11px; max-width: 245px; font-size: 1.88rem; }
  .hero p { max-width: 235px; font-size: .88rem; }
  .flag { width: 56px; flex-basis: 56px; }
  .card { border-radius: 19px; padding: 21px 18px; }
  .auth .card { margin-top: 15px; }
  input, select, button { min-height: 54px; }
  .top { align-items: flex-start; }
  .top > div { min-width: 0; }
  .top .brand-logo-frame { width: 150px; }
  .top h1 { font-size: 1.62rem; }
  .top p { display: none; }
  button.secondary { min-height: 38px; font-size: .83rem; }
  .chupalla { width: 65px; height: 48px; flex-basis: 65px; }
  .delivery-remaining { min-width: 185px; }
  .modal-backdrop { align-items: start; overflow: auto; padding: 14px; }
  .modal { margin: 22px 0; padding: 19px 16px; }
}
