/* ==========================================================
   Visita guiada a Qualium Lab · Registro
   ========================================================== */
:root {
    --teal-900: #163a36;
    --teal-800: #1f4f49;
    --teal-700: #2a655d;
    --teal-500: #4d8f84;
    --teal-300: #8cc0b5;
    --teal-50:  #eef6f4;
    --yellow:   #f4b400;
    --sky:      #8ec5e0;
    --ink:      #1b2523;
    --ink-2:    #4a5856;
    --ink-3:    #7b8886;
    --line:     #e1e8e6;
    --bg:       #f4f7f6;
    --card:     #ffffff;
    --danger:   #c8402f;
    --danger-bg:#fdf0ee;
    --warn:     #c98500;
    --radius:   16px;
    --radius-sm:10px;
    --shadow:   0 1px 2px rgba(22,58,54,.06), 0 8px 24px rgba(22,58,54,.07);
    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
svg { width: 1em; height: 1em; fill: currentColor; flex: none; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.muted { color: var(--ink-2); margin: 0; }
.small { font-size: .875rem; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.layout { min-height: 100vh; }

.hero {
    position: relative;
    color: #fff;
    overflow: hidden;
    isolation: isolate;
}
.hero-bg {
    position: absolute; inset: 0; z-index: -2;
    background-size: cover; background-position: 60% center;
    transform: scale(1.04);
}
.hero::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background:
        linear-gradient(160deg, rgba(22,58,54,.93) 0%, rgba(31,79,73,.86) 45%, rgba(42,101,93,.72) 100%);
}
.hero::after { /* banda de color de marca */
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
    background: linear-gradient(90deg, var(--yellow) 0 33%, var(--sky) 33% 66%, var(--teal-300) 66%);
}
.hero-inner {
    padding: 28px 20px 44px;
    max-width: 640px;
}
.hero-logo {
    width: 210px;
    background: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,.18);
    margin-bottom: 22px;
}
.hero-kicker {
    margin: 0 0 8px;
    font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
    color: var(--yellow);
}
.hero h1 {
    font-size: clamp(1.45rem, 5.4vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -.01em;
    text-wrap: balance;
}
.hero-sub {
    margin: 12px 0 0;
    font-size: clamp(.95rem, 3.4vw, 1.1rem);
    color: rgba(255,255,255,.85);
    text-wrap: balance;
}
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.22);
    backdrop-filter: blur(6px);
    font-size: .9rem; font-weight: 600;
}
.chip svg { color: var(--yellow); font-size: 1.05rem; }
.hero-foot { display: none; }

.content {
    padding: 0 14px 32px;
    margin-top: -18px;
    position: relative;
}

/* ---------- Cards ---------- */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 18px;
    margin-bottom: 16px;
    border: 1px solid rgba(22,58,54,.05);
}
.card-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.card-head h2 { font-size: 1.2rem; font-weight: 800; color: var(--teal-900); }
.card-head .muted { font-size: .9rem; margin-top: 2px; }
.step {
    flex: none;
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 10px;
    background: var(--teal-800); color: #fff;
    font-weight: 800;
}

/* ---------- Form fields ---------- */
.grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: .85rem; font-weight: 700; color: var(--ink-2); }

input[type=text], input[type=email], input[type=tel], input[type=date],
input[type=number], input[type=password], input[type=time], input[type=search], select {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    font: inherit;
    font-size: 16px; /* evita zoom en iOS */
    color: var(--ink);
    background: #fbfdfc;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
    -webkit-appearance: none; appearance: none;
}
input[type=date] { display: block; }
input::placeholder { color: #a7b2b0; }
input:hover, select:hover { border-color: #c9d5d2; }
input:focus, select:focus {
    border-color: var(--teal-500);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(77,143,132,.15);
}
.select { position: relative; }
.select::after {
    content: ""; position: absolute; right: 16px; top: 50%;
    width: 8px; height: 8px; margin-top: -6px;
    border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
    transform: rotate(45deg); pointer-events: none;
}
.select select { padding-right: 40px; }

.is-invalid input, .is-invalid select { border-color: var(--danger); background: var(--danger-bg); }
.field-error { color: var(--danger); font-size: .82rem; font-weight: 600; }

/* Segmented control (DNI / Pasaporte) */
.seg {
    display: grid; grid-template-columns: 1fr 1fr;
    padding: 4px; gap: 4px;
    background: var(--teal-50);
    border-radius: var(--radius-sm);
    min-height: 50px;
}
.seg-opt { position: relative; display: flex; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span {
    flex: 1; display: grid; place-items: center;
    border-radius: 7px;
    font-weight: 700; font-size: .95rem; color: var(--ink-2);
    cursor: pointer; transition: all .15s;
}
.seg-opt input:checked + span { background: #fff; color: var(--teal-800); box-shadow: 0 1px 4px rgba(22,58,54,.15); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--teal-500); outline-offset: 1px; }

/* ---------- Traslados ---------- */
.day { border: 0; margin: 0 0 22px; padding: 0; min-width: 0; }
.day:last-child { margin-bottom: 0; }
.day legend {
    display: flex; align-items: center; gap: 10px;
    padding: 0; margin-bottom: 12px;
}
.day-date {
    padding: 4px 10px;
    border-radius: 8px;
    background: var(--yellow); color: var(--teal-900);
    font-weight: 800; font-size: .9rem;
}
.day-name { font-weight: 700; color: var(--teal-900); }
.notice {
    margin: 0 0 10px; padding: 10px 12px; border-radius: var(--radius-sm);
    background: #fff7e3; color: #7a5300; font-size: .88rem; font-weight: 600;
}
.vans { display: grid; grid-template-columns: 1fr; gap: 10px; }
.van { position: relative; display: block; cursor: pointer; }
.van input { position: absolute; opacity: 0; pointer-events: none; }
.van-body {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "time name check" "time seats check";
    align-items: center;
    column-gap: 14px; row-gap: 6px;
    padding: 14px 16px;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s, background .15s, transform .1s;
}
.van:hover .van-body { border-color: var(--teal-300); }
.van:active .van-body { transform: scale(.99); }
.van-time {
    grid-area: time;
    font-size: 1.5rem; font-weight: 800; color: var(--teal-800);
    letter-spacing: -.02em;
    min-width: 76px;
}
.van-time small { font-size: .8rem; font-weight: 700; margin-left: 2px; color: var(--ink-3); }
.van-name { grid-area: name; font-weight: 700; }
.seats { grid-area: seats; display: flex; align-items: center; gap: 10px; font-size: .82rem; font-weight: 600; }
.bar { flex: 0 0 64px; height: 6px; border-radius: 99px; background: #e6ecea; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--teal-500); }
.seats-ok  .seats-txt { color: var(--teal-700); }
.seats-low .seats-txt { color: var(--warn); }
.seats-low .bar span { background: var(--yellow); }
.seats-full .seats-txt { color: var(--ink-3); }
.seats-full .bar span { background: #b9c3c1; }
.van-check {
    grid-area: check;
    width: 26px; height: 26px; border-radius: 50%;
    border: 2px solid #cdd7d5;
    display: grid; place-items: center;
    color: transparent;
    transition: all .15s;
}
.van-check svg { font-size: 16px; }
.van input:checked + .van-body {
    border-color: var(--teal-700);
    background: var(--teal-50);
    box-shadow: 0 0 0 3px rgba(42,101,93,.12);
}
.van input:checked + .van-body .van-check { background: var(--teal-700); border-color: var(--teal-700); color: #fff; }
.van input:focus-visible + .van-body { outline: 2px solid var(--teal-500); outline-offset: 2px; }
.van.is-full { cursor: not-allowed; }
.van.is-full .van-body { background: #f6f8f7; opacity: .7; }
.van.is-full .van-time { color: var(--ink-3); text-decoration: line-through; }
.visit.is-invalid .van-body { border-color: #e7b2aa; }
.visit > .field-error { display: block; margin-top: 12px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 46px; padding: 10px 20px;
    border: 0; border-radius: 12px;
    font: inherit; font-weight: 700; font-size: .95rem;
    cursor: pointer; text-decoration: none;
    transition: background .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal-800); color: #fff; box-shadow: 0 6px 18px rgba(31,79,73,.28); }
.btn-primary:hover { background: var(--teal-900); }
.btn-primary:disabled { opacity: .7; cursor: wait; }
.btn-lg { min-height: 56px; font-size: 1.05rem; padding: 14px 28px; width: 100%; }
.btn-ghost { background: var(--teal-50); color: var(--teal-800); }
.btn-ghost:hover { background: #e0eeea; }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: #f9e0dc; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .85rem; border-radius: 9px; }

.submit-bar {
    position: sticky; bottom: 0;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--bg) 70%, rgba(244,247,246,0));
    z-index: 5;
}

.alert {
    padding: 14px 16px; margin-bottom: 16px;
    border-radius: var(--radius-sm);
    background: var(--danger-bg); color: #8f2a1d;
    border: 1px solid #f1c9c2;
    font-size: .92rem;
}
.alert-ok { background: #e9f6ef; color: #1d6a43; border-color: #bfe3cf; }

/* ---------- Confirmación ---------- */
.success { text-align: center; padding: 34px 20px; }
.success-icon {
    width: 68px; height: 68px; margin: 0 auto 16px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--teal-50); color: var(--teal-700);
    font-size: 34px;
}
.success h2 { font-size: 1.5rem; font-weight: 800; color: var(--teal-900); margin-bottom: 6px; }
.summary {
    display: grid; grid-template-columns: 1fr; gap: 10px;
    text-align: left; margin: 24px 0;
}
.summary div { padding: 12px 14px; background: var(--bg); border-radius: var(--radius-sm); }
.summary dt { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.summary dd { margin: 2px 0 0; font-weight: 700; word-break: break-word; }
.summary-title { text-align: left; font-size: 1rem; margin-bottom: 10px; color: var(--teal-900); }
.trip-list { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 8px; text-align: left; }
.trip-list li {
    display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
    padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
}
.trip-day { font-weight: 700; }
.trip-van { color: var(--ink-2); font-size: .9rem; }
.trip-time { font-weight: 800; color: var(--teal-800); }
.success .btn { margin-top: 14px; }

.site-foot { text-align: center; padding: 20px 0 8px; color: var(--ink-3); font-size: .8rem; }
.site-foot img { width: 170px; margin: 0 auto 8px; opacity: .9; }

/* ---------- ≥ 600px ---------- */
@media (min-width: 600px) {
    .content { padding: 0 24px 40px; }
    .card { padding: 28px; }
    .grid { grid-template-columns: repeat(12, 1fr); gap: 18px; }
    .col-4 { grid-column: span 4; }
    .col-6 { grid-column: span 6; }
    .col-8 { grid-column: span 8; }
    .summary { grid-template-columns: 1fr 1fr; }
    .btn-lg { width: auto; }
    .submit-bar { display: flex; justify-content: flex-end; position: static; background: none; }
    .hero-inner { padding: 40px 32px 60px; }
}

/* ---------- ≥ 1024px: panel lateral fijo ---------- */
@media (min-width: 1024px) {
    .layout { display: grid; grid-template-columns: minmax(380px, 40%) 1fr; }
    .hero { position: sticky; top: 0; height: 100vh; }
    .hero::after { top: 0; bottom: 0; left: auto; right: 0; width: 5px; height: auto;
        background: linear-gradient(180deg, var(--yellow) 0 33%, var(--sky) 33% 66%, var(--teal-300) 66%); }
    .hero-inner {
        height: 100%;
        display: flex; flex-direction: column; justify-content: center;
        padding: 56px clamp(36px, 4vw, 64px);
        max-width: 620px; margin-left: auto;
    }
    .hero-logo { width: 270px; padding: 12px 16px; margin-bottom: 30px; }
    .hero-foot {
        display: flex; align-items: center; gap: 14px;
        margin-top: auto; padding-top: 40px;
        font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: rgba(255,255,255,.7);
    }
    .hero-foot img { width: 190px; background: #fff; padding: 10px 14px; border-radius: 10px; }
    .content { margin-top: 0; padding: 56px clamp(24px, 4vw, 64px) 40px; max-width: 880px; }
    .vans { grid-template-columns: repeat(3, 1fr); }
    .van-body {
        grid-template-columns: 1fr auto;
        grid-template-areas: "time check" "name name" "seats seats";
        padding: 16px;
    }
    .seats { flex-direction: column; align-items: stretch; gap: 6px; }
    .bar { flex-basis: auto; }
    .site-foot img { display: none; }
}

/* ==========================================================
   ADMIN
   ========================================================== */
.admin { background: var(--bg); }
.topbar {
    position: sticky; top: 0; z-index: 20;
    background: var(--teal-900); color: #fff;
}
.topbar-inner {
    max-width: 1280px; margin: 0 auto;
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 10px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; }
.brand img { height: 30px; background: #fff; padding: 4px 6px; border-radius: 6px; }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; }
.nav a {
    color: rgba(255,255,255,.78); text-decoration: none; font-weight: 600; font-size: .9rem;
    padding: 8px 12px; border-radius: 8px; white-space: nowrap;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a.active { color: var(--teal-900); background: var(--yellow); }
.wrap { max-width: 1280px; margin: 0 auto; padding: 24px 16px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 1.5rem; font-weight: 800; color: var(--teal-900); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border-radius: var(--radius-sm); padding: 14px 16px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.6rem; color: var(--teal-800); line-height: 1.1; }
.stat span { font-size: .8rem; color: var(--ink-3); font-weight: 600; }
@media (min-width: 800px) { .stats { grid-template-columns: repeat(4, 1fr); } }

.table-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); background: #fafcfb; white-space: nowrap; }
tbody tr:hover { background: #fafcfb; }
tbody tr:last-child td { border-bottom: 0; }
td.nowrap { white-space: nowrap; }
.tag {
    display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .78rem; font-weight: 700;
    background: var(--teal-50); color: var(--teal-800); white-space: nowrap; margin: 1px 0;
}
.tag-off { background: #eef0f0; color: var(--ink-3); }
.tag-full { background: var(--danger-bg); color: var(--danger); }
.empty { padding: 32px; text-align: center; color: var(--ink-3); }

/* Lista de inscriptos: sin scroll horizontal */
.table-wrap:has(.reg-table) { overflow-x: visible; }
.reg-table { table-layout: fixed; }
.reg-table th:nth-child(1) { width: 27%; }
.reg-table th:nth-child(2) { width: 25%; }
.reg-table th:nth-child(3) { width: 22%; }
.reg-table th:nth-child(4) { width: 17%; }
.reg-table th:nth-child(5) { width: 104px; }
.reg-table td { overflow-wrap: anywhere; }
.cell-main { font-weight: 700; color: var(--teal-900); }
.cell-sub { font-size: .8rem; color: var(--ink-3); margin-top: 2px; }
.visit-day { font-weight: 700; font-size: .88rem; margin-bottom: 3px; }
.cell-lab { font-size: .85rem; font-weight: 600; color: var(--teal-700); margin-top: 2px; }
.cell-break { overflow-wrap: anywhere; }
.mail-ok { color: #1d6a43; font-weight: 600; }
.mail-no { color: var(--danger); font-weight: 600; }
.trips { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.trips li { display: flex; align-items: center; gap: 6px; }
.trips-day { font-size: .75rem; font-weight: 800; color: var(--ink-3); width: 36px; flex: none; }
.cell-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.cell-actions .btn { width: 100%; }

@media (max-width: 900px) {
    .reg-table, .reg-table tbody, .reg-table tr, .reg-table td { display: block; width: 100%; }
    .reg-table thead { display: none; }
    .reg-table tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
    .reg-table td { border: 0; padding: 6px 0; }
    .reg-table td[data-label]::before {
        content: attr(data-label); display: block;
        font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3);
    }
    .reg-table td:first-child::before { display: none; }
    .cell-main { font-size: 1.05rem; }
    .cell-actions { flex-direction: row; padding-top: 10px !important; }
    .cell-actions form, .cell-actions .btn { flex: 1; }
}

.search { display: flex; gap: 8px; flex: 1; max-width: 420px; }
.search input { min-height: 42px; padding: 8px 12px; }

.manifest-day { margin-bottom: 28px; }
.manifest-day > h2 { font-size: 1.15rem; color: var(--teal-900); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.manifest-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 900px) { .manifest-grid { grid-template-columns: repeat(3, 1fr); } }
.manifest { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.manifest-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.manifest-head h3 { font-size: 1rem; }
.manifest-head .van-time { font-size: 1.25rem; min-width: 0; }
.manifest ol { margin: 0; padding: 8px 16px 12px 40px; font-size: .9rem; }
.manifest li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.manifest li:last-child { border-bottom: 0; }
.manifest li small { display: block; color: var(--ink-3); }
.manifest .empty { padding: 20px; font-size: .9rem; }
.cap { padding: 0 16px 14px; margin-top: auto; }
.cap .bar { height: 8px; }

.form-inline { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: end; }
@media (min-width: 800px) { .form-inline { grid-template-columns: 1.1fr 1.2fr .8fr .8fr auto auto; } }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; min-height: 50px; }
.check input { width: 20px; height: 20px; accent-color: var(--teal-700); }

.login {
    min-height: 100vh; display: grid; place-items: center; padding: 20px;
    background: linear-gradient(160deg, var(--teal-900), var(--teal-700));
}
.login .card { width: 100%; max-width: 380px; text-align: center; }
.login .card img { width: 180px; margin: 4px auto 18px; }
.login h1 { font-size: 1.2rem; margin-bottom: 18px; color: var(--teal-900); }
.login .btn { width: 100%; margin-top: 12px; }

.detail { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) { .detail { grid-template-columns: 1fr 1fr; } }

@media print {
    .topbar, .actions, .no-print { display: none !important; }
    .wrap { padding: 0; }
    .manifest, .table-wrap { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}
