/* RHIC 2026 — registration form theme (RHIC-2026-R5) */

:root {
    --rhic-primary: #0b4f6c;
    --rhic-primary-dark: #083a50;
    --rhic-accent: #c8a04a;
    --rhic-dark: #0a2540;
    --rhic-ink: #11202e;
    --rhic-muted: #64748b;
    --rhic-line: #e2e8f0;
    /* input borders — deliberately darker than --rhic-line so fields read clearly (organiser feedback) */
    --rhic-input-line: #b6c2d1;
    --rhic-input-line-hover: #7f8ea3;
    --rhic-bg: #eef2f6;
    --rhic-surface: #ffffff;
    --rhic-success: #0f766e;
    --rhic-danger: #b42318;
    --rhic-radius: 14px;
    --rhic-radius-sm: 10px;
    --rhic-shadow: 0 10px 40px rgba(10, 37, 64, .10);
}

* { box-sizing: border-box; }

/* Some phones showed a horizontal scrollbar / the page shifted sideways (organiser report,
   2026-07-30). The 3D transforms (translateZ/perspective) and long unbreakable strings can nudge
   content past the viewport edge. Clamp the document to the viewport width so nothing scrolls
   sideways, and let long words wrap instead of overflowing. */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    background: var(--rhic-bg);
    color: var(--rhic-ink);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

a { color: var(--rhic-primary); }

/* ---------- layout ---------- */
.rhic-header {
    background: linear-gradient(135deg, var(--rhic-dark) 0%, var(--rhic-primary) 100%);
    color: #fff;
    padding: 2.4rem 1.25rem 2.6rem;
    text-align: center;
}
.rhic-header .eyebrow {
    letter-spacing: .18em;
    text-transform: uppercase;
    font-size: .72rem;
    color: var(--rhic-accent);
    font-weight: 700;
}
.rhic-header h1 { margin: .5rem 0 .35rem; font-size: 1.6rem; font-weight: 700; }
.rhic-header .meta {
    margin: 0;
    opacity: .88;
    font-size: .95rem;
    /* let the date and venue sit on separate lines on narrow phones instead of overflowing */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0 .25rem;
    padding: 0 .5rem;
}
.rhic-header .meta span { white-space: nowrap; }
/* the venue is the long one — allow it to wrap rather than push the page sideways */
.rhic-header .meta .venue { white-space: normal; }
.rhic-header .dot { opacity: .5; margin: 0 .5rem; }
@media (max-width: 560px) {
    /* on small phones drop the middle dot and stack date over venue */
    .rhic-header .meta .dot { display: none; }
    .rhic-header .meta { flex-direction: column; gap: .15rem; }
}

.rhic-main { max-width: 860px; margin: -1.6rem auto 3rem; padding: 0 1rem; }

.rhic-card {
    background: var(--rhic-surface);
    border-radius: var(--rhic-radius);
    box-shadow: var(--rhic-shadow);
    padding: 1.6rem;
}
@media (min-width: 640px) { .rhic-card { padding: 2rem 2.2rem; } }

/* ---------- steps ---------- */
/* Numbered stepper — shrinks to fit ANY width, so it never needs a horizontal scrollbar. */
.rhic-steps {
    display: flex;
    list-style: none;
    margin: 0 0 1.6rem;
    padding: 0;
    position: relative;
}
.rhic-steps li {
    flex: 1 1 0;
    min-width: 0;                 /* allow items to shrink below content width — no overflow */
    position: relative;
    text-align: center;
    font-size: .72rem;
    color: var(--rhic-muted);
    transition: color .2s;
}
/* connecting progress line between the dot centres (sits behind the dots) */
.rhic-steps li::before {
    content: "";
    position: absolute;
    top: 13px;                    /* centre of a 26px dot */
    right: 50%;
    width: 100%;
    height: 3px;
    background: var(--rhic-line);
    z-index: 0;
}
.rhic-steps li:first-child::before { display: none; }
.rhic-steps li.is-active::before,
.rhic-steps li.is-done::before { background: var(--rhic-primary); }
.rhic-steps .dot {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin: 0 auto .4rem;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--rhic-line);
    font-weight: 700;
    font-size: .78rem;
    color: var(--rhic-muted);
    transition: border-color .2s, background .2s, color .2s;
}
.rhic-steps .lbl { display: block; padding: 0 3px; line-height: 1.25; }
.rhic-steps li.is-active { color: var(--rhic-primary); font-weight: 600; }
.rhic-steps li.is-active .dot { border-color: var(--rhic-primary); color: var(--rhic-primary); }
.rhic-steps li.is-done { color: var(--rhic-primary); }
.rhic-steps li.is-done .dot { border-color: var(--rhic-primary); background: var(--rhic-primary); color: #fff; }
/* On narrow screens the labels don't fit — drop them and keep the numbered dots; the section
   heading below (e.g. "3. Category Verification & Uploads") names the current step. */
@media (max-width: 560px) {
    .rhic-steps .lbl { display: none; }
}

/* ---------- form ---------- */
.rhic-step { display: none; }
.rhic-step.is-active { display: block; animation: rhicFade .18s ease; }
@keyframes rhicFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.rhic-step h2 { font-size: 1.15rem; margin: 0 0 .25rem; }
.rhic-step .step-hint { margin: 0 0 1.25rem; color: var(--rhic-muted); font-size: .9rem; }

.rhic-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 620px) { .rhic-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.rhic-grid .span-2 { grid-column: 1 / -1; }

.rhic-field label { display: block; font-size: .84rem; font-weight: 600; margin-bottom: .35rem; }
.rhic-field .req { color: var(--rhic-danger); }
.rhic-field input[type="text"],
.rhic-field input[type="email"],
.rhic-field input[type="tel"],
.rhic-field input[type="number"],
.rhic-field select,
.rhic-field textarea {
    width: 100%;
    padding: .68rem .8rem;
    /* Organiser feedback (2026-07-30): field borders were too faint on some screens.
       Darker + slightly thicker so every input reads clearly as an editable box. */
    border: 1.5px solid var(--rhic-input-line);
    border-radius: var(--rhic-radius-sm);
    font: inherit;
    font-size: .95rem;
    background: #fff;
    color: var(--rhic-ink);
    transition: border-color .15s, box-shadow .15s;
}
.rhic-field input:hover, .rhic-field select:hover, .rhic-field textarea:hover {
    border-color: var(--rhic-input-line-hover);
}
.rhic-field input:focus, .rhic-field select:focus {
    outline: none;
    border-color: var(--rhic-primary);
    box-shadow: 0 0 0 3px rgba(11, 79, 108, .12);
}
.rhic-field input[readonly] { background: #f4f6f8; color: var(--rhic-muted); }
.rhic-field .error { display: none; color: var(--rhic-danger); font-size: .8rem; margin-top: .3rem; }
.rhic-field.has-error input, .rhic-field.has-error select { border-color: var(--rhic-danger); }
.rhic-field.has-error .error { display: block; }

.phone-row { display: grid; grid-template-columns: 130px 1fr; gap: .6rem; }

/* ---------- category cards ---------- */
.rhic-categories { display: grid; gap: .7rem; }
@media (min-width: 620px) { .rhic-categories { grid-template-columns: 1fr 1fr; } }
.rhic-category { position: relative; }
.rhic-category input { position: absolute; opacity: 0; pointer-events: none; }
.rhic-category label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    height: 100%;
    padding: .9rem 1rem;
    border: 1.5px solid var(--rhic-line);
    border-radius: var(--rhic-radius-sm);
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.rhic-category label:hover { border-color: #b7c6d4; }
/* Selected category: organiser asked (2026-07-30) that the user's choice be immediately obvious.
   Thicker primary border, tinted fill, primary ring — the ✓ badge is added in rhic-3d.css. */
.rhic-category input:checked + label {
    border-color: var(--rhic-primary);
    border-width: 2px;
    background: rgba(11, 79, 108, .09);
    box-shadow: 0 0 0 3px rgba(11, 79, 108, .18);
}
.rhic-category input:checked + label .name { color: var(--rhic-primary); font-weight: 700; }
.rhic-category .name { font-weight: 600; font-size: .92rem; }
.rhic-category .price { font-size: .85rem; color: var(--rhic-primary); font-weight: 700; white-space: nowrap; }
.rhic-category .price.tbc { color: var(--rhic-muted); font-weight: 500; font-size: .78rem; }
.rhic-category input:disabled + label { opacity: .55; cursor: not-allowed; }

/* ---------- uploads ---------- */
.rhic-note {
    background: #f1f6f9;
    border: 1px solid #dbe6ee;
    border-left: 4px solid var(--rhic-primary);
    border-radius: var(--rhic-radius-sm);
    padding: .9rem 1rem;
    font-size: .9rem;
    margin-bottom: 1.1rem;
}
.rhic-note.warn { background: #fff8ea; border-color: #f0dcae; border-left-color: var(--rhic-accent); }
.rhic-note strong { display: block; margin-bottom: .2rem; }

.rhic-file input[type="file"] {
    width: 100%;
    padding: .8rem;
    border: 1.5px dashed var(--rhic-line);
    border-radius: var(--rhic-radius-sm);
    background: #fbfcfd;
    font-size: .88rem;
}
.rhic-file .hint { color: var(--rhic-muted); font-size: .78rem; margin-top: .35rem; }

/* ---------- declaration ---------- */
.rhic-check { display: flex; gap: .7rem; align-items: flex-start; font-size: .92rem; }
.rhic-check input { margin-top: .28rem; width: 18px; height: 18px; accent-color: var(--rhic-primary); flex: 0 0 auto; }

/* ---------- promo + summary ---------- */
.rhic-promo { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: start; }
.rhic-promo .msg { grid-column: 1 / -1; font-size: .84rem; margin-top: -.2rem; }
.rhic-promo .msg.ok { color: var(--rhic-success); }
.rhic-promo .msg.err { color: var(--rhic-danger); }
/* Applied-coupon state: the field is locked (read-only) and shows the code; Remove undoes it. */
.rhic-promo input.is-locked { background: var(--rhic-bg); color: var(--rhic-muted); font-weight: 600; letter-spacing: .5px; cursor: not-allowed; }
#promoRemove { color: var(--rhic-danger); }

.rhic-employee { display: none; margin-top: 1.2rem; }
.rhic-employee.is-visible { display: block; }

.rhic-summary {
    margin-top: 1.4rem;
    border: 1px solid var(--rhic-line);
    border-radius: var(--rhic-radius-sm);
    overflow: hidden;
}
.rhic-summary .row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .65rem 1rem;
    font-size: .92rem;
    border-bottom: 1px solid var(--rhic-line);
}
.rhic-summary .row:last-child { border-bottom: 0; }
.rhic-summary .row.discount { color: var(--rhic-success); }
.rhic-summary .row.total { background: #f7fafc; font-weight: 700; font-size: 1.02rem; }
/* VAT inclusive/exclusive statement — a quiet, full-width footnote under the total */
.rhic-summary .row.vat-note {
    display: block;
    background: #f7fafc;
    color: var(--rhic-muted);
    font-size: .8rem;
    line-height: 1.4;
    text-align: center;
    padding: .55rem 1rem;
}

/* ---------- buttons ---------- */
.rhic-actions { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-top: 1.7rem; }
.btn {
    appearance: none;
    border: 0;
    border-radius: var(--rhic-radius-sm);
    padding: .78rem 1.5rem;
    font: inherit;
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    transition: background .15s, opacity .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--rhic-primary); color: #fff; }
.btn-primary:hover { background: var(--rhic-primary-dark); }
.btn-ghost { background: #eef2f6; color: var(--rhic-ink); }
.btn-ghost:hover { background: #e2e8f0; }
.btn-small { padding: .68rem 1.1rem; font-size: .88rem; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* Continue / Proceed is the primary action — organiser feedback (2026-07-30) asked for it to be
   clearly the main call to action, so in the action row it is larger and takes the leading width. */
.rhic-actions .btn-primary {
    flex: 1 1 auto;
    min-width: 0;
    padding: .95rem 1.6rem;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: .01em;
}

/* Buttons carry a directional arrow (Back ← / Continue → / Proceed →). */
.btn-arrow { display: inline-block; font-weight: 700; }
.btn-arrow-left { margin-right: .5rem; }
.btn-arrow-right { margin-left: .5rem; }
.rhic-actions .btn { display: inline-flex; align-items: center; justify-content: center; }

/* Step 1 has no Back button — Continue should be truly full-width (not just flex-leading).
   The JS adds this class whenever Back is hidden. */
.rhic-actions.is-solo { justify-content: stretch; }
.rhic-actions.is-solo .btn-primary { width: 100%; flex: 1 1 100%; }

/* Awaiting-payment: the primary action turns into "Cancel transaction". */
.btn-danger { background: #b02a2a; color: #fff; }
.btn-danger:hover { background: #922222; }

/* Cancel-payment confirmation modal (custom, in-page — never a JS confirm inside the popup). */
.rhic-modal-overlay {
    position: fixed; inset: 0; background: rgba(10,37,64,.55);
    display: none; align-items: center; justify-content: center; padding: 20px; z-index: 1000;
}
.rhic-modal-overlay.is-open { display: flex; }
.rhic-modal {
    background: #fff; border-radius: 14px; padding: 26px 24px; max-width: 400px; width: 100%;
    box-shadow: 0 20px 60px rgba(10,37,64,.28); text-align: center;
}
.rhic-modal h3 { margin: 0 0 8px; font-size: 1.15rem; color: var(--rhic-ink); }
.rhic-modal p { margin: 0 0 20px; color: #5b6b7c; font-size: .95rem; }
.rhic-modal-actions { display: flex; gap: .7rem; justify-content: center; }
.rhic-modal-actions .btn { flex: 1 1 auto; }
.rhic-actions .btn-ghost { flex: 0 0 auto; }

.rhic-alert {
    display: none;
    margin-top: 1rem;
    padding: .85rem 1rem;
    border-radius: var(--rhic-radius-sm);
    font-size: .9rem;
    background: #fdeceb;
    color: var(--rhic-danger);
    border: 1px solid #f6cfcb;
}
.rhic-alert.is-visible { display: block; }

.rhic-blocked { text-align: center; padding: 2rem 1rem; }
.rhic-blocked h2 { margin-top: 0; }

.rhic-footer {
    text-align: center;
    color: var(--rhic-muted);
    font-size: .78rem;
    padding: 0 1rem 2.5rem;
}
.rhic-footer a { color: var(--rhic-primary); text-decoration: none; }

/* ---------- success page ---------- */
.rhic-result { text-align: center; }
.rhic-result .badge-icon {
    width: 62px; height: 62px; line-height: 62px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    font-size: 30px;
    color: #fff;
    background: var(--rhic-success);
}
.rhic-result .badge-icon.fail { background: var(--rhic-danger); }
.rhic-result .qr-box {
    display: inline-block;
    margin: 1.2rem 0;
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--rhic-line);
    border-radius: var(--rhic-radius-sm);
}
.rhic-result .reg-id { font-size: .9rem; color: var(--rhic-muted); margin-top: .6rem; }
.rhic-result .reg-id strong { color: var(--rhic-ink); letter-spacing: .06em; }
