/* ============================================================================
   A Cubed Education — Event Registration

   Same visual language as feedback.html: grey banner strip, white card with a
   hairline black border, Pridi serif for labels and headings, Roboto for input
   text, pill inputs and a black solid submit. The `ev-` prefix keeps it from
   colliding with the `fb-` rules in style_feedback.css if the two ever load on
   the same page.

   This file only loads on the event registration page.
   ========================================================================== */


/* Reset + box-sizing (mirrors the site's global reset) */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    background-color: #ffffff;
    font-family: 'Roboto', sans-serif;
    color: #111111;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Page title banner ── */
.ev-banner-title {
    width: 100%;
    margin: 0;
    padding: 26px 20px;
    text-align: center;
    font-family: 'Pridi', serif;
    font-weight: 600;
    font-size: 2.7rem;
    letter-spacing: 2px;
    color: #000000;
    background: #B8B8B8;
}

/* ── Layout wrapper (grows to push the footer down) ── */
.ev-wrap {
    flex: 1 0 auto;
    width: 100%;
    padding: 36px 20px 56px;
}

/* ── The card ── */
.ev-card {
    max-width: 672px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #000000;
    border-radius: 4px;
    padding: 28px 30px 24px;
}

.ev-card[hidden] {
    display: none;
}

/* ── Event details block ── */
.ev-eyebrow {
    font-family: 'Roboto', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #1F8A3B;
    margin-bottom: 10px;
}

.ev-event-title {
    font-family: 'Pridi', serif;
    font-weight: 600;
    font-size: 1.95rem;
    line-height: 1.2;
    letter-spacing: 0.3px;
    color: #000000;
}

.ev-event-blurb {
    margin-top: 10px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444444;
}

/* Facts list — When / Where / Price */
.ev-facts {
    list-style: none;
    margin-top: 22px;
    display: grid;
    gap: 14px;
}

.ev-fact {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.ev-fact-icon {
    width: 21px;
    height: 21px;
    flex: none;
    margin-top: 2px;
    color: #000000;
    display: block;
}

.ev-fact-label {
    font-family: 'Roboto', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: #8a8a8a;
}

.ev-fact-value {
    margin-top: 2px;
    font-family: 'Pridi', serif;
    font-size: 1.05rem;
    line-height: 1.45;
    color: #000000;
}

.ev-fact-sub {
    margin-top: 2px;
    font-size: 0.78rem;
    line-height: 1.45;
    color: #777777;
}

.ev-fact-sub[hidden] {
    display: none;
}

.ev-free {
    display: inline-block;
    padding: 1px 9px 2px;
    border-radius: 999px;
    background: #E7F7EA;
    color: #1F8A3B;
    font-family: 'Roboto', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    vertical-align: 1px;
}

.ev-rule {
    border: none;
    border-top: 1px solid #E4E4E4;
    margin: 26px 0 24px;
}

/* ── Fields ── */
.ev-field {
    margin-bottom: 20px;
}

.ev-label {
    display: block;
    font-family: 'Pridi', serif;
    font-size: 1.15rem;
    font-weight: 400;
    color: #000000;
    margin-bottom: 8px;
}

.ev-req {
    color: #e23b3b;
    font-size: 0.85em;
    vertical-align: super;
    margin-left: 1px;
}

.ev-help {
    font-family: 'Pridi', serif;
    font-size: 0.82rem;
    color: #2b2b2b;
    margin: -2px 0 10px;
    line-height: 1.4;
}

/* Pill inputs */
.ev-input {
    width: 100%;
    height: 40px;
    border: 1.5px solid #000000;
    border-radius: 20px;
    padding: 0 18px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    color: #111111;
    background: #ffffff;
    outline: none;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.ev-input:focus {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.12);
}

/* Autofill animation — green ring while typing, then it settles back to black */
.ev-input.ev-typing {
    border-color: #45C05C;
    box-shadow: 0 0 0 3px rgba(69, 192, 92, 0.16);
}

.ev-input.ev-autofilled {
    animation: ev-autofill-settle 520ms ease-out;
}

@keyframes ev-autofill-settle {
    from {
        border-color: #45C05C;
        box-shadow: 0 0 0 3px rgba(69, 192, 92, 0.16);
    }
    to {
        border-color: #000000;
        box-shadow: 0 0 0 3px rgba(69, 192, 92, 0);
    }
}

/* Invalid state */
.ev-input.ev-invalid,
.ev-phone-row.ev-invalid .ev-cc-btn,
.ev-phone-row.ev-invalid .ev-phone-input {
    border-color: #e23b3b;
}

.ev-input.ev-invalid:focus,
.ev-phone-row.ev-invalid .ev-phone-input:focus {
    box-shadow: 0 0 0 3px rgba(226, 59, 59, 0.18);
}

.ev-error {
    font-family: 'Roboto', sans-serif;
    font-size: 0.78rem;
    color: #e23b3b;
    min-height: 1em;
    margin-top: 5px;
}

/* ── Phone row: country picker + national number ── */
.ev-phone-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.ev-phone-input {
    flex: 1 1 auto;
    min-width: 0;   /* without this the input refuses to shrink below its
                       intrinsic width and the row overflows on small phones */
}

.ev-cc {
    position: relative;
    flex: none;
}

.ev-cc-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 10px 0 14px;
    border: 1.5px solid #000000;
    border-radius: 20px;
    background: #ffffff;
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    color: #111111;
    cursor: pointer;
    white-space: nowrap;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.ev-cc-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.12);
}

/* ISO alpha-2, NOT a flag emoji. Windows ships no colour regional-indicator
   font, so 🇦🇪 renders as two letter boxes for most desktop visitors — the code
   is the thing that reads correctly everywhere. */
.ev-cc-iso {
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.5px;
    color: #666666;
}

.ev-cc-dial {
    font-variant-numeric: tabular-nums;
}

.ev-cc-caret {
    width: 16px;
    height: 16px;
    flex: none;
    display: block;
    color: #666666;
    transition: transform 0.15s ease;
}

.ev-cc-btn[aria-expanded="true"] .ev-cc-caret {
    transform: rotate(180deg);
}

/* Dropdown panel */
.ev-cc-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 60;
    width: 268px;
    max-width: calc(100vw - 56px);
    background: #ffffff;
    border: 1px solid #000000;
    border-radius: 10px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.16);
    padding: 8px;
    overflow: hidden;
}

.ev-cc-panel[hidden] {
    display: none;
}

.ev-cc-search {
    width: 100%;
    height: 34px;
    border: 1.5px solid #DDDDDD;
    border-radius: 8px;
    padding: 0 12px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.88rem;
    color: #111111;
    outline: none;
}

.ev-cc-search:focus {
    border-color: #000000;
}

.ev-cc-list {
    list-style: none;
    margin-top: 6px;
    max-height: 232px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.ev-cc-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.88rem;
    color: #222222;
    cursor: pointer;
}

.ev-cc-option:hover,
.ev-cc-option.ev-cc-active {
    background: #F1F1F1;
}

.ev-cc-option[aria-selected="true"] {
    font-weight: 700;
}

.ev-cc-opt-iso {
    flex: none;
    width: 26px;
    font-weight: 700;
    font-size: 0.76rem;
    letter-spacing: 0.5px;
    color: #666666;
}

.ev-cc-opt-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ev-cc-opt-dial {
    flex: none;
    color: #666666;
    font-variant-numeric: tabular-nums;
}

.ev-cc-empty {
    padding: 12px 10px;
    font-size: 0.85rem;
    color: #888888;
    text-align: center;
}

.ev-cc-empty[hidden] {
    display: none;
}

/* Honeypot — keep it far off-screen, never visible/focusable for humans */
.ev-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ── Submit ── */
.ev-submit-row {
    display: flex;
    justify-content: center;
    margin-top: 26px;
}

.ev-submit {
    font-family: 'Pridi', serif;
    font-size: 1.05rem;
    letter-spacing: 1.5px;
    color: #ffffff;
    background: #000000;
    border: none;
    border-radius: 8px;
    padding: 10px 48px;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.05s ease;
}

.ev-submit:hover {
    opacity: 0.88;
}

.ev-submit:active {
    transform: translateY(1px);
}

.ev-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ev-fineprint {
    margin-top: 14px;
    text-align: center;
    font-size: 0.76rem;
    color: #888888;
}

/* ══════════════════════════════════════════════════════════════════════════
   Success screen
   ═══════════════════════════════════════════════════════════════════════ */
/* [hidden] must win over display:flex so it stays hidden until submit. */
.ev-success[hidden] {
    display: none;
}

.ev-success {
    display: flex;
    justify-content: center;
    padding: 60px 20px 64px;
}

.ev-success-card {
    width: 100%;
    max-width: 624px;
    background: #F9F9F9;
    border: 1px solid #EDEDED;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    padding: 42px 50px 40px;
    text-align: center;
}

/* Black rounded square holding the white check_circle glyph */
.ev-success-badge {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    border-radius: 14px;
    background: #000000;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ev-success-badge svg {
    width: 36px;
    height: 36px;
    display: block;
}

.ev-success-title {
    margin-top: 28px;
    font-family: 'Pridi', serif;
    font-weight: 700;
    font-size: 3.1rem;
    line-height: 1.1;
    letter-spacing: 0.04em;
    color: #000000;
}

.ev-success-text {
    margin-top: 10px;
    font-size: 1.125rem;
    letter-spacing: 0.2px;
    color: #45C05C;
}

/* ── Read-back summary ── */
.ev-summary {
    margin-top: 34px;
    text-align: left;
    background: #ffffff;
    border: 1px solid #E8E8E8;
    border-radius: 10px;
    padding: 6px 20px;
}

.ev-summary-row {
    display: flex;
    gap: 16px;
    align-items: baseline;
    padding: 11px 0;
    border-bottom: 1px solid #F0F0F0;
}

.ev-summary-row:last-child {
    border-bottom: none;
}

.ev-summary dt {
    flex: none;
    width: 90px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #8a8a8a;
}

.ev-summary dd {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #111111;
    overflow-wrap: anywhere;   /* long email addresses must not widen the card */
}

/* ── Add to calendar ── */
.ev-cal {
    margin-top: 34px;
    padding-top: 28px;
    border-top: 1px solid #E8E8E8;
}

.ev-cal-title {
    font-family: 'Pridi', serif;
    font-size: 1.1rem;
    color: #000000;
}

.ev-cal-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

/* ── Buttons ── */
.ev-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border-radius: 8px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: opacity 0.15s ease, background-color 0.15s ease,
                color 0.15s ease, transform 0.05s ease;
}

.ev-btn-icon {
    width: 18px;
    height: 18px;
    flex: none;
    display: block;
}

.ev-btn-solid {
    background: #000000;
    color: #ffffff;
    border: 2px solid #000000;
}

.ev-btn-solid:hover {
    opacity: 0.88;
}

.ev-btn-outline {
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
}

.ev-btn-outline:hover {
    background: #000000;
    color: #ffffff;
}

/* Third-weight button — the secondary action next to a solid primary. */
.ev-btn-ghost {
    background: transparent;
    color: #000000;
    border: 2px solid #C9C9C9;
}

.ev-btn-ghost:hover {
    border-color: #000000;
}

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

.ev-success-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 36px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .ev-banner-title {
        font-size: 1.7rem;
        letter-spacing: 1px;
        padding: 18px 16px;
    }

    .ev-wrap {
        padding: 24px 16px 44px;
    }

    .ev-card {
        padding: 22px 18px 24px;
        border-radius: 4px;
    }

    .ev-event-title {
        font-size: 1.55rem;
    }

    .ev-event-blurb {
        font-size: 0.9rem;
    }

    .ev-label {
        font-size: 1.02rem;
    }

    .ev-help {
        font-size: 0.76rem;
    }

    .ev-success {
        padding: 40px 16px 60px;
    }

    .ev-success-card {
        padding: 32px 22px 28px;
    }

    .ev-success-badge {
        width: 62px;
        height: 62px;
        border-radius: 12px;
    }

    .ev-success-badge svg {
        width: 31px;
        height: 31px;
    }

    .ev-success-title {
        margin-top: 24px;
        font-size: 2.2rem;
    }

    .ev-success-text {
        font-size: 1rem;
    }

    .ev-summary {
        padding: 4px 15px;
    }

    .ev-summary dt {
        width: 76px;
        font-size: 0.68rem;
    }

    .ev-summary dd {
        font-size: 0.875rem;
    }
}

/* Below this the summary label column costs more than it earns — stack it. */
@media (max-width: 430px) {
    .ev-summary-row {
        flex-direction: column;
        gap: 2px;
    }

    .ev-summary dt {
        width: auto;
    }

    .ev-cal-actions,
    .ev-success-actions {
        flex-direction: column;
        gap: 10px;
    }

    .ev-btn {
        width: 100%;
    }
}

@media (max-width: 380px) {
    .ev-banner-title {
        font-size: 1.45rem;
    }

    .ev-submit {
        padding: 10px 32px;
    }

    /* The dial code is the part that has to stay readable; drop the ISO code
       rather than let the row wrap or overflow. */
    .ev-cc-iso {
        display: none;
    }

    .ev-cc-btn {
        padding: 0 8px 0 12px;
    }
}

/* Respect reduced-motion: no transform transitions */
@media (prefers-reduced-motion: reduce) {
    .ev-submit:active,
    .ev-btn:active {
        transform: none;
    }

    /* JS already fills instantly under reduced-motion; kill the ring too. */
    .ev-input.ev-autofilled {
        animation: none;
    }

    .ev-cc-caret {
        transition: none;
    }
}
