/* ==================================================================
   AEC Glasgow 2026 — Visitor Registration
   Public styles + badge + print
   ================================================================== */
:root {
    --pink: #e0186f;
    --pink-dark: #b80f57;
    --orange: #f7941d;
    --cream: #fdf6ea;
    --ink: #3a2b3f;
    --muted: #8a7a90;
    --line: #e9dbe4;
    --danger: #d33131;
    --ok: #0d7a45;
    --grad: linear-gradient(135deg, #e0186f 0%, #f7941d 100%);
    --shadow: 0 20px 50px rgba(90, 30, 60, 0.28);
    --radius: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

html, body { max-width: 100%; overflow-x: hidden; }

body {
    font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
    color: var(--ink);
    background: var(--cream);
    min-height: 100vh;
}

/* Responsive event background */
body.public-bg {
    background: url('../../images/bg_laptop.jpeg') no-repeat center center fixed;
    background-size: cover;
}
@media (max-width: 768px) {
    body.public-bg {
        /* 'scroll' instead of 'fixed': fixed backgrounds are buggy on mobile */
        background: url('../../images/bg_mobile.jpeg') no-repeat center top scroll;
        background-size: cover;
    }
}

.page-wrap {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px 70px;
}

.desktop-only { display: block; }
.mobile-only  { display: none; }
@media (max-width: 900px) {
    .desktop-only { display: none; }
    .mobile-only  { display: block; }
}

/* ------------------------------------------------------------------
   Registration hero: poster card (left) + floating form card (right)
   ------------------------------------------------------------------ */
.hero-wrap { align-items: center; }

.hero-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 42px;
    width: 100%;
    max-width: 1150px;
}

.poster-card {
    flex: 0 0 400px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--cream);
}
.poster-card img {
    display: block;
    width: 100%;
    height: auto;
}

.form-card {
    flex: 0 1 640px;
    min-width: 0;
    background: #fff;
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 38px 46px 32px;
}

.mobile-banner {
    display: none;
    width: 100%;
    border-radius: 14px;
    margin-bottom: 20px;
}

/* Heading like the reference: icon + bold title + accent underline */
.form-head { text-align: center; margin-bottom: 24px; }
.form-head h1 {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: .8px;
    color: var(--ink);
}
.head-ico { font-size: 22px; margin-right: 6px; }
.head-underline {
    width: 74px;
    height: 4px;
    border-radius: 99px;
    background: var(--grad);
    margin: 10px auto 12px;
}
.form-sub {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
}

/* ------------------------------------------------------------------
   Form controls
   ------------------------------------------------------------------ */
.form-group { margin-bottom: 16px; min-width: 0; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}
.req { color: var(--pink); }
.label-ico { font-size: 13px; }

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.label-row label { margin-bottom: 6px; }
.change-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--pink);
    text-decoration: none;
    white-space: nowrap;
}
.change-link:hover { text-decoration: underline; }

.input-ctl {
    width: 100%;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 14px;
    color: var(--ink);
    background: #fbf8f4;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}
.input-ctl:focus {
    border-color: var(--pink);
    box-shadow: 0 0 0 3px rgba(224, 24, 111, 0.12);
}
select.input-ctl { cursor: pointer; }

/* Mobile number: joined gradient prefix + input */
.mobile-wrap { display: flex; }
.mobile-wrap .mobile-code {
    flex: 0 0 150px;
    min-width: 0;
    background: var(--grad);
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 12px 0 0 12px;
}
.mobile-wrap .mobile-code option { color: var(--ink); background: #fff; }
.mobile-wrap input {
    flex: 1;
    min-width: 0;
    border-radius: 0 12px 12px 0;
    border-left: none;
}

.mobile-code.locked { pointer-events: none; opacity: .8; }
.locked-input { background: #f3ece6; color: #6d5f72; }

.mobile-note { font-size: 12.5px; margin-top: 7px; line-height: 1.5; }
.mobile-note.ok { color: var(--ok); font-weight: 600; }
.mobile-note.warn { color: var(--danger); font-weight: 500; }
.mobile-note a { color: var(--pink); font-weight: 700; }

/* Step 2 hidden until the mobile number is verified */
.step-hidden { display: none; }
#step2Fields {
    border-top: 1.5px dashed var(--line);
    margin-top: 20px;
    padding-top: 20px;
}

/* Visit date checkboxes */
.dates-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.date-check {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    font-weight: 500;
    padding: 11px 13px;
    background: #fbf8f4;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    margin-bottom: 0;
}
.date-check:hover { border-color: var(--orange); }
.date-check input {
    width: 17px;
    height: 17px;
    accent-color: var(--pink);
    flex: 0 0 auto;
}
.date-check-text { min-width: 0; }
.date-check-label { display: block; line-height: 1.3; }
.date-check-time {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    margin-top: 2px;
    line-height: 1.35;
}
.date-check:has(input:checked) .date-check-time { color: var(--pink-dark); }
.date-check:has(input:checked) {
    border-color: var(--pink);
    background: #fff3f8;
}

/* Validation errors */
label.error-msg, .error-msg {
    display: block;
    color: var(--danger);
    font-size: 12px;
    font-weight: 500;
    margin-top: 5px;
}
.input-ctl.input-error { border-color: var(--danger); }

/* Buttons */
.btn {
    display: inline-block;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    padding: 13px 28px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: transform .15s, box-shadow .15s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .65; cursor: not-allowed; }

.btn-primary {
    background: var(--grad);
    color: #fff;
    box-shadow: 0 10px 24px rgba(224, 24, 111, 0.32);
}
.btn-primary:hover { box-shadow: 0 12px 30px rgba(224, 24, 111, 0.45); }

.btn-outline {
    background: #fff;
    color: var(--pink);
    border: 1.5px solid var(--pink);
}
.btn-outline:hover { background: #fff3f8; }

.btn-block { width: 100%; margin-top: 8px; }

.form-note {
    font-size: 11.5px;
    color: var(--muted);
    text-align: center;
    margin-top: 14px;
}

/* ------------------------------------------------------------------
   Confirmation page — one cohesive card:
   success + details (left) | badge on gradient panel (right)
   ------------------------------------------------------------------ */
.confirm-wrap { align-items: center; padding-top: 24px; padding-bottom: 36px; }

.confirm-card {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(380px, 440px);
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "intro   side"
        "details side";
    width: 100%;
    max-width: 1080px;
    background: #fff;
    border-radius: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.confirm-intro {
    grid-area: intro;
    padding: 28px 34px 4px 36px;
    min-width: 0;
}
.confirm-details-block {
    grid-area: details;
    padding: 12px 34px 26px 36px;
    min-width: 0;
}
.confirm-side {
    grid-area: side;
    background: var(--grad);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 36px 28px;
}

.confirm-head-row {
    display: flex;
    align-items: center;
    gap: 16px;
}
.confirm-check {
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--grad);
    color: #fff;
    font-size: 26px;
    line-height: 54px;
    text-align: center;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(224, 24, 111, 0.35);
}
.confirm-head-text { min-width: 0; }
.confirm-head-text h1 {
    font-size: 22px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.confirm-head-text p {
    font-size: 13px;
    color: var(--muted);
    margin-top: 3px;
    line-height: 1.55;
}

.confirm-email-note {
    margin-top: 16px;
    background: #fff5f9;
    border: 1.5px dashed #f7cfe0;
    border-radius: 12px;
    padding: 11px 15px;
    font-size: 12.5px;
    color: var(--ink);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.details-heading {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}
.details-heading::after {
    content: '';
    display: block;
    width: 46px;
    height: 3px;
    border-radius: 99px;
    background: var(--grad);
    margin: 7px 0 10px;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.details-table td {
    padding: 7px 6px;
    border-bottom: 1px solid #f6ecf1;
    vertical-align: top;
}
.details-table tr:last-child td { border-bottom: none; }
.details-table td:first-child {
    color: var(--muted);
    width: 40%;
    font-weight: 500;
}
.code-text { color: var(--pink); letter-spacing: .5px; }

.confirm-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.confirm-venue-note {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 16px;
}

.badge-side-label {
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 4px;
}
.badge-side-note {
    color: rgba(255, 255, 255, 0.92);
    font-size: 12px;
    text-align: center;
    max-width: 280px;
    line-height: 1.5;
}
.confirm-side .badge-card {
    border: none;
    box-shadow: 0 22px 50px rgba(90, 10, 45, 0.4);
}

/* ------------------------------------------------------------------
   Visitor badge
   ------------------------------------------------------------------ */
.badge-card {
    width: 360px;
    max-width: 100%;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid #f4e3d7;
}

.badge-head {
    background: var(--grad);
    color: #fff;
    text-align: center;
    padding: 20px 18px 26px;
}
.badge-event {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
}
.badge-edition {
    font-size: 10.5px;
    opacity: .92;
    margin-top: 4px;
    letter-spacing: .4px;
}

.badge-type {
    background: var(--ink);
    color: #fff;
    text-align: center;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 6px;
    padding: 8px 0;
}

.badge-body {
    padding: 22px 24px 18px;
    text-align: center;
}
.badge-name {
    font-size: 21px;
    font-weight: 700;
    line-height: 1.25;
    word-wrap: break-word;
}
.badge-org {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 4px;
    word-wrap: break-word;
}
.badge-meta {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.badge-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 14px 0 4px;
}
.badge-date-chip {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--pink-dark);
    background: #fdeef5;
    border: 1px solid #f7cfe0;
    border-radius: 999px;
    padding: 4px 10px;
}

.badge-code-box {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 2px dashed var(--pink);
    background: #fff5f9;
    border-radius: 14px;
    padding: 11px 12px;
    margin: 14px 0 10px;
}
.badge-qr {
    flex: 0 0 auto;
    width: 84px;
    height: 84px;
    background: #fff;
    border: 1px solid #f7cfe0;
    border-radius: 8px;
    padding: 5px;
}
.badge-qr img, .badge-qr canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}
/* Confirmation page shows a 40% smaller QR (print badge keeps the big one) */
.confirm-side .badge-qr {
    width: 50px;
    height: 50px;
    padding: 3px;
}
.badge-code-info { flex: 1; min-width: 0; text-align: center; }
.badge-code-label {
    font-size: 9.5px;
    letter-spacing: 3px;
    color: var(--muted);
    font-weight: 600;
}
.badge-code {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--pink);
    margin-top: 4px;
    white-space: nowrap;
}

.badge-visitors {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 2px;
}
.badge-visitors-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--muted);
}
.badge-visitors-num {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    color: var(--ink);
}

.badge-foot {
    background: var(--cream);
    border-top: 1px solid #f4e3d7;
    text-align: center;
    font-size: 10.5px;
    color: var(--muted);
    padding: 11px 14px;
    line-height: 1.5;
}

/* ------------------------------------------------------------------
   Print — badge only
   ------------------------------------------------------------------ */
@media print {
    body, body.public-bg { background: #fff !important; }
    .no-print, .poster-card { display: none !important; }
    .page-wrap { padding: 0; display: block; }
    .confirm-card {
        display: block;
        max-width: none;
        box-shadow: none;
        border-radius: 0;
        overflow: visible;
    }
    .confirm-side { background: none; padding: 0; display: block; }
    .badge-card {
        margin: 20px auto;
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    .confirm-side .badge-card { border: 1px solid #ccc; }
    .badge-head, .badge-type, .badge-code-box, .badge-foot, .badge-date-chip, .badge-qr {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */
@media (max-width: 1080px) {
    .poster-card { flex-basis: 340px; }
    .form-card { padding: 32px 30px 28px; }
}

@media (max-width: 900px) {
    .page-wrap { padding: 18px 12px 50px; }
    .hero-grid { flex-direction: column; gap: 0; }
    .poster-card { display: none; }
    .form-card { flex: 1 1 auto; width: 100%; max-width: 560px; }
    .mobile-banner { display: block; }
}

/* Confirmation card stacks: success message → badge → details */
@media (max-width: 980px) {
    .confirm-card {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "intro"
            "side"
            "details";
        max-width: 560px;
    }
    .confirm-intro  { padding: 26px 24px 4px; }
    .confirm-details-block { padding: 14px 24px 26px; }
    .confirm-side   { padding: 26px 20px; margin-top: 18px; }
}

@media (max-width: 600px) {
    .form-card { padding: 24px 18px 22px; border-radius: 18px; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .dates-list { grid-template-columns: 1fr; }
    .form-head h1 { font-size: 19px; }
    .mobile-wrap .mobile-code { flex-basis: 118px; font-size: 13px; }

    .confirm-intro  { padding: 22px 18px 2px; }
    .confirm-details-block { padding: 12px 18px 22px; }
    .confirm-head-text h1 { font-size: 19px; }
    .details-table td:first-child { width: 44%; }
    .confirm-actions .btn { width: 100%; }

    /* Badge must always fit inside the gradient panel on small phones */
    .confirm-side { padding: 22px 14px; }
    .confirm-side .badge-card { width: 100%; max-width: 340px; }
    .badge-body { padding: 18px 14px 14px; }
    .badge-qr { width: 72px; height: 72px; }
    .badge-code { font-size: 17px; letter-spacing: .5px; }
    .badge-name { font-size: 19px; }
    .badge-visitors-num { font-size: 28px; }
}

@media (max-width: 380px) {
    .mobile-wrap { flex-wrap: wrap; }
    .mobile-wrap .mobile-code { flex: 1 1 100%; border-radius: 12px 12px 0 0; }
    .mobile-wrap input { flex: 1 1 100%; border-radius: 0 0 12px 12px; border-left: 1.5px solid var(--line); border-top: none; }
}

/* ------------------------------------------------------------------
   Smallest devices (e.g. Galaxy Fold cover screen, 280px)
   ------------------------------------------------------------------ */
@media (max-width: 340px) {
    .page-wrap { padding: 10px 6px 30px; }
    .form-card { padding: 18px 12px; border-radius: 14px; }
    .form-head h1 { font-size: 15px; letter-spacing: .4px; }
    .head-ico { font-size: 14px; margin-right: 3px; }
    .form-sub { font-size: 11px; }
    .date-check { padding: 9px 10px; font-size: 12.5px; }
    .btn { font-size: 14px; padding: 12px 16px; }

    .confirm-intro { padding: 18px 12px 2px; }
    .confirm-details-block { padding: 10px 12px 18px; }
    .confirm-head-row { gap: 10px; }
    .confirm-check { width: 44px; height: 44px; font-size: 22px; line-height: 44px; }
    .confirm-head-text h1 { font-size: 16px; }
    .confirm-side { padding: 16px 8px; }
    .details-table { font-size: 12px; }

    .badge-head { padding: 14px 10px 18px; }
    .badge-event { font-size: 13px; }
    .badge-edition { font-size: 9px; }
    .badge-body { padding: 14px 10px 12px; }
    .badge-name { font-size: 17px; }
    .badge-code-box { gap: 8px; padding: 9px 8px; }
    .badge-qr { width: 64px; height: 64px; }
    .badge-code { font-size: 14px; letter-spacing: .5px; }
    .badge-visitors-num { font-size: 24px; }
    .badge-foot { font-size: 9.5px; }
}

/* ------------------------------------------------------------------
   Mobile keyboard zoom fix: browsers auto-zoom into form fields whose
   font-size is below 16px, and stay zoomed after the keyboard closes.
   Keeping every control at 16px on touch screens prevents the zoom.
   ------------------------------------------------------------------ */
@media (max-width: 768px) {
    .input-ctl,
    select.input-ctl,
    .mobile-wrap .mobile-code,
    .dataTables_wrapper .dataTables_filter input,
    .dataTables_wrapper .dataTables_length select {
        font-size: 16px;
    }
}
