/*
 * Digital Closer Masterclass registration pages (AP's 2026-12 redesign):
 * Views/Funnel/WebinarFunnel/WebinarFunnelMasterclass.cshtml (English, /free-masterclass)
 * Views/Funnel/WebinarFunnel/WebinarFunnelMasterclassSpanish.cshtml (Spanish, /clase-gratis)
 *
 * Peter's requirements (2026-12-01):
 *   - fully responsive, AP's fonts, AP's exact line breaks;
 *   - on a phone everything above the disclaimers is above the fold;
 *   - on every screen the first view fills the screen without distorting or reflowing;
 *   - the disclaimers sit below the fold on desktop and on mobile.
 *
 * HOW IT FITS EVERY SCREEN
 * ------------------------
 * The first screen (.mc-fold) is laid out on a fixed design canvas, --rw x --rh design pixels,
 * and every size inside it is a multiple of --u, one design pixel. --u is the largest value that
 * keeps the whole canvas inside the viewport:
 *
 *     --u = min(100vw / --rw, 100svh / --rh)
 *
 * So the first screen scales as one piece. Nothing reflows: each headline / intro line is its own
 * nowrap span, and because the type and the box it sits in scale by the same factor, the words
 * break exactly where AP put them on any screen. Images keep their aspect ratio. Whatever height
 * is left over on a tall phone goes to the flexible gaps (.mc-sp) and the presenter photo, so the
 * view always fills the screen top to bottom. .mc-fold is at least one screen tall, so the
 * footer and its disclaimers always start below the fold.
 *
 * Two canvases:
 *   - "desktop" (landscape screens): AP's desktop design, 1040 x 970, with the topic cards.
 *     Short landscape screens (a phone on its side) drop the cards: 1040 x 720.
 *   - "mobile" (portrait screens, phones and tablets): AP's mobile design, 390 wide.
 * The switch is on the screen's SHAPE (aspect ratio), not its width, so a portrait tablet gets the
 * mobile design scaled up rather than a squashed desktop one.
 *
 * Font: Roboto, as AP's files name it, loaded from Google Fonts by the views so every device
 * renders the same face (AP's files only named it, so a computer without Roboto installed showed
 * Arial instead).
 */

:root {
    --mc-blue: #0057ff;
    --mc-ink: #101828;
    --mc-muted: #465467;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body.mc {
    margin: 0;
    background: #f8f9f9;
    color: var(--mc-ink);
    font-family: Roboto, Arial, sans-serif;
    text-align: center;
    overflow-x: hidden;
    /* Desktop canvas by default. */
    --rw: 1040;
    --rh: 976;
    --u: min(calc(100vw / var(--rw)), calc(100vh / var(--rh)), 2px);
}

@supports (height: 100svh) {
    /* svh = the viewport with the browser's toolbars showing, so "above the fold" holds on a
       phone before the address bar collapses. */
    body.mc { --u: min(calc(100vw / var(--rw)), calc(100svh / var(--rh)), 2px); }
}

/* Short landscape (a phone turned sideways): desktop design without the topic cards. */
@media (min-aspect-ratio: 1/1) and (max-height: 520px) {
    body.mc { --rh: 720; }
    .mc-topics-wrap { display: none !important; }
}

/* Portrait screens: AP's mobile design. */
@media (max-aspect-ratio: 1/1) {
    body.mc { --rw: 390; --rh: 618; }
    body.mc.mc-es { --rh: 600; }
}

/* Desktop-only / mobile-only fragments (AP's two files break lines differently). */
.mc-m { display: none !important; }
@media (max-aspect-ratio: 1/1) {
    .mc-d { display: none !important; }
    .mc-m { display: block !important; }
    br.mc-m, span.mc-m.mc-inline { display: inline !important; }
}

/* ---------- First screen ---------- */

.mc-fold {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
}

.mc-header {
    flex: none;
    background: var(--mc-blue);
    color: #fff;
    height: calc(var(--u) * 48);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mc-header img.mc-logo { display: block; width: calc(var(--u) * 263); height: auto; }

.mc-es .mc-header { height: calc(var(--u) * 44); }
.mc-brand {
    display: inline-flex;
    align-items: center;
    gap: calc(var(--u) * 6);
    font-weight: 750;
    font-size: calc(var(--u) * 17);
    white-space: nowrap;
}
.mc-brand img { display: block; width: auto; height: calc(var(--u) * 30); }

.mc-hero {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: calc(var(--u) * var(--rw));
    max-width: 100%;
    margin: 0 auto;
    padding: 0 calc(var(--u) * 18);
}

/* Flexible gaps: a fixed minimum from AP's design, plus a share of any spare height. */
.mc-sp { flex: 1 1 0; min-height: var(--min, 0); max-height: calc(var(--u) * 40); width: 100%; }

.mc-eyebrow {
    margin: 0;
    color: var(--mc-blue);
    font-size: calc(var(--u) * 22);
    font-weight: 800;
    line-height: 1.18;
    white-space: nowrap;
}
.mc-eyebrow::before {
    content: '';
    display: inline-block;
    vertical-align: .12em;
    width: calc(var(--u) * 8);
    height: calc(var(--u) * 8);
    border-radius: 50%;
    background: var(--mc-blue);
    box-shadow: 0 0 0 calc(var(--u) * 3) #0057ff44;
    margin-right: calc(var(--u) * 8);
    animation: mc-blink 1.2s ease-in-out infinite;
}
@keyframes mc-blink { 50% { opacity: .28; } }
@media (prefers-reduced-motion: reduce) { .mc-eyebrow::before { animation: none; } }

.mc-h1 {
    margin: 0;
    color: #000;
    font-size: calc(var(--u) * 36);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -.035em;
}
.mc-es .mc-h1 { font-size: calc(var(--u) * 37); line-height: calc(var(--u) * 42); }
.mc-line { display: block; white-space: nowrap; }

.mc-intro {
    color: #151111;
    font-size: calc(var(--u) * 19);
    line-height: 1.24;
}
.mc-es .mc-intro { font-size: calc(var(--u) * 17); }
.mc-intro p { margin: 0; white-space: nowrap; }
.mc-intro p + p { margin-top: calc(var(--u) * 6); }

/* Date + countdown, with AP's red arrows either side. */
.mc-event { display: flex; flex-direction: column; align-items: center; }
.mc-date {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: calc(var(--u) * 6);
    margin: 0 0 calc(var(--u) * 8);
    color: var(--mc-blue);
    font-size: calc(var(--u) * 24);
    font-weight: 750;
    font-style: italic;
    line-height: 1.17;
    white-space: nowrap;
}
.mc-date svg { flex: none; width: calc(var(--u) * 24); height: calc(var(--u) * 24); }
.mc-es .mc-date { font-size: calc(var(--u) * 28); font-weight: 800; margin-bottom: calc(var(--u) * 10); }

.mc-timer-row { display: flex; align-items: center; justify-content: center; gap: calc(var(--u) * 78); }
.mc-es .mc-timer-row { gap: calc(var(--u) * 12); }
.mc-arrow { display: block; width: calc(var(--u) * 20); height: auto; flex: none; }
.mc-es .mc-arrow { width: calc(var(--u) * 24); }

.mc-timer {
    display: flex;
    align-items: center;
    gap: calc(var(--u) * 4);
    color: var(--mc-blue);
    font-size: calc(var(--u) * 25);
    font-weight: 800;
}
.mc-unit {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: calc(var(--u) * 70);
    height: calc(var(--u) * 52);
    background: #fff;
    border: 1px solid #e7ebef;
    box-shadow: 0 1px 3px #10182812;
    border-radius: calc(var(--u) * 9);
    line-height: 1.13;
}
.mc-unit b { font-weight: 900; font-variant-numeric: tabular-nums; }
.mc-unit small { display: block; color: #292929; font-size: calc(var(--u) * 11); font-weight: 800; }
.mc-es .mc-timer { gap: calc(var(--u) * 5); font-size: calc(var(--u) * 28); }
.mc-es .mc-unit { width: calc(var(--u) * 80); height: calc(var(--u) * 59); border-radius: calc(var(--u) * 10); gap: calc(var(--u) * 3); }
.mc-es .mc-unit small { font-size: calc(var(--u) * 13); font-weight: 700; line-height: 1.1; }

/* Presenter: AP's size is the minimum; on a tall phone it takes a share of the spare height. */
.mc-presenter {
    flex: 2 0 calc(var(--u) * 147);
    min-height: calc(var(--u) * 147);
    max-height: calc(var(--u) * 230);
    display: flex;
    justify-content: center;
}
.mc-presenter img { display: block; height: 100%; width: auto; max-width: 100%; object-fit: contain; }
.mc-es .mc-presenter { flex-basis: calc(var(--u) * 172); min-height: calc(var(--u) * 172); max-height: calc(var(--u) * 260); }

.mc-cta {
    display: block;
    width: calc(var(--u) * 560);
    margin: 0;
    padding: calc(var(--u) * 8) calc(var(--u) * 20);
    border: 0;
    border-radius: calc(var(--u) * 60);
    background: var(--mc-blue);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: calc(var(--u) * 24);
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}
.mc-cta:hover { background: #0044cf; }
.mc-cta:focus-visible { outline: 3px solid #003db5; outline-offset: 4px; }
.mc-cta small { display: block; color: #bfd3ff; margin-top: calc(var(--u) * 5); font-size: calc(var(--u) * 16); }
.mc-es .mc-cta { padding: calc(var(--u) * 10) calc(var(--u) * 20) calc(var(--u) * 11); }

.mc-bonus {
    margin: 0;
    color: var(--mc-blue);
    font-size: calc(var(--u) * 18);
    font-weight: 800;
    white-space: nowrap;
}
.mc-bonus img { width: calc(var(--u) * 34); height: auto; vertical-align: calc(var(--u) * -2); margin: 0 calc(var(--u) * 5); }
.mc-free { text-decoration: underline; text-decoration-color: #e5202b; text-decoration-thickness: calc(var(--u) * 2); text-underline-offset: calc(var(--u) * 3); }

.mc-proof { display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 6); }
.mc-proof img { display: block; height: auto; }
.mc-proof .mc-faces { width: calc(var(--u) * 690); }
.mc-proof .mc-trusted { width: calc(var(--u) * 352); }

.mc-trust-es {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: calc(var(--u) * 5);
    white-space: nowrap;
    color: #140c0c;
    font-size: calc(var(--u) * 15);
    font-weight: 800;
    line-height: 1.2;
}
.mc-trust-es .mc-badge { width: 1.2em; height: auto; }
.mc-trust-es .mc-stars { width: 6em; height: auto; }

/* Topic cards (desktop canvas only). */
.mc-topics-wrap { width: 100%; display: flex; flex-direction: column; align-items: center; }
.mc-topics-title {
    margin: 0 0 calc(var(--u) * 9);
    color: #140c0c;
    font-size: calc(var(--u) * 22);
    line-height: 1.1;
    font-weight: 700;
}
.mc-topics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: calc(var(--u) * 12);
    width: calc(var(--u) * 960);
}
.mc-card {
    background: #fff;
    border: 1px solid #eaecf0;
    border-radius: calc(var(--u) * 8);
    padding: calc(var(--u) * 11) calc(var(--u) * 12);
    box-shadow: calc(var(--u) * 10) calc(var(--u) * 10) calc(var(--u) * 15) calc(var(--u) * -3) #0000001a,
                calc(var(--u) * 4) calc(var(--u) * 4) calc(var(--u) * 6) calc(var(--u) * -4) #0000001a;
}
.mc-card h3 { margin: 0 0 calc(var(--u) * 6); color: #3b3936; font-size: calc(var(--u) * 18); line-height: 1.12; font-weight: 700; }
.mc-card h3 img { display: block; height: calc(var(--u) * 36); max-width: calc(var(--u) * 56); width: auto; margin: 0 auto calc(var(--u) * 6); object-fit: contain; }
.mc-card p { margin: 0; font-size: calc(var(--u) * 14); line-height: 1.2; }

/* ---------- Mobile canvas (portrait), AP's mobile file ---------- */
@media (max-aspect-ratio: 1/1) {
    .mc-hero { padding: 0 calc(var(--u) * 14); }
    .mc-eyebrow { font-size: calc(var(--u) * 15.6); }
    .mc-h1 { font-size: calc(var(--u) * 20.9); line-height: 1.1; }
    .mc-intro { font-size: calc(var(--u) * 14.5); }
    .mc-intro p + p { margin-top: calc(var(--u) * 8); }
    .mc-date { font-size: calc(var(--u) * 14.43); gap: calc(var(--u) * 5); }
    .mc-date svg { width: 1em; height: 1em; }
    .mc-timer-row { gap: calc(var(--u) * 5); width: calc(var(--u) * 362); }
    .mc-arrow { width: calc(var(--u) * 14); }
    .mc-timer { flex: 1 1 0; gap: calc(var(--u) * 3); justify-content: center; }
    .mc-unit { width: auto; flex: 1 1 0; max-width: calc(var(--u) * 70); }
    .mc-presenter { flex-basis: calc(var(--u) * 131); min-height: calc(var(--u) * 131); max-height: calc(var(--u) * 210); }
    .mc-cta { width: calc(var(--u) * 326); padding: calc(var(--u) * 7) calc(var(--u) * 12); font-size: calc(var(--u) * 18); font-weight: 750; }
    .mc-cta small { margin-top: calc(var(--u) * 4); font-size: calc(var(--u) * 14); }
    .mc-bonus { font-size: calc(var(--u) * 12.48); font-weight: 500; }
    .mc-bonus strong { font-weight: 650; }
    .mc-proof { gap: calc(var(--u) * 4); }
    .mc-proof .mc-faces { width: calc(var(--u) * 285); }
    .mc-proof .mc-trusted { width: calc(var(--u) * 276); }

    /* Spanish mobile file */
    .mc-es .mc-header { height: calc(var(--u) * 40); }
    .mc-es .mc-brand { font-size: calc(var(--u) * 14); gap: calc(var(--u) * 6); }
    .mc-es .mc-brand img { height: calc(var(--u) * 27); }
    .mc-es .mc-eyebrow { font-size: calc(var(--u) * 16); }
    .mc-es .mc-h1 { font-size: calc(var(--u) * 23.4); line-height: 1.09; }
    .mc-es .mc-intro { font-size: calc(var(--u) * 13.45); line-height: 1.25; }
    .mc-es .mc-intro p + p { margin-top: calc(var(--u) * 6); }
    .mc-es .mc-date { font-size: calc(var(--u) * 14.6); margin-bottom: calc(var(--u) * 8); }
    .mc-es .mc-timer-row { gap: calc(var(--u) * 6); width: calc(var(--u) * 354); }
    .mc-es .mc-arrow { width: calc(var(--u) * 14); }
    .mc-es .mc-timer { gap: calc(var(--u) * 3); font-size: calc(var(--u) * 23); }
    .mc-es .mc-unit { height: calc(var(--u) * 49); max-width: calc(var(--u) * 67); border-radius: calc(var(--u) * 8); }
    .mc-es .mc-unit b { line-height: 1.13; }
    .mc-es .mc-unit small { font-size: calc(var(--u) * 10.14); }
    .mc-es .mc-presenter { flex-basis: calc(var(--u) * 131); min-height: calc(var(--u) * 131); max-height: calc(var(--u) * 210); }
    .mc-es .mc-cta { width: calc(var(--u) * 294); min-height: calc(var(--u) * 44); padding: calc(var(--u) * 6) calc(var(--u) * 12); font-size: calc(var(--u) * 15); }
    .mc-es .mc-cta small { margin-top: calc(var(--u) * 2); font-size: calc(var(--u) * 11); }
    .mc-es .mc-bonus { font-size: calc(var(--u) * 12.48); font-weight: 800; }
    .mc-es .mc-proof .mc-faces { width: calc(var(--u) * 362); }
    .mc-es .mc-trust-es { font-size: calc(var(--u) * 11.9); gap: calc(var(--u) * 4); }

    .mc-topics-wrap { display: none !important; }
}

/* ---------- Footer: ordinary, readable type, NOT scaled ---------- */
.mc-footer {
    background: #fff;
    border-top: 1px solid #e4e7ec;
    color: #475467;
    font-size: 12px;
    line-height: 1.55;
    padding: 28px 16px 36px;
}
.mc-footer-inner { max-width: 960px; margin: 0 auto; }
.mc-footer p { margin: 0 0 12px; }
.mc-footer .mc-disclaimer-title { font-weight: 700; color: #101828; margin-top: 18px; }
.mc-footer a { color: #003db5; }
.mc-footer ul { list-style: none; padding: 0; margin: 18px 0 10px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }
.mc-footer .mc-copyright { margin: 0; color: #667085; }

/* ---------- Registration modal (AP's dialog styling) ---------- */
.mc-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background: #10182866;
}
.mc-modal.is-open { display: flex; }
.mc-modal-box {
    position: relative;
    width: min(696px, 100%);
    max-height: calc(100vh - 28px);
    max-height: calc(100dvh - 28px);
    overflow-y: auto;
    background: #fff;
    border: 3px solid #648fff;
    border-radius: 16px;
    padding: clamp(20px, 4vw, 35px);
    color: var(--mc-ink);
    box-shadow: 0 20px 70px #10182844;
}
.mc-close {
    position: absolute;
    right: 8px;
    top: 8px;
    width: 33px;
    height: 33px;
    border: 0;
    border-radius: 50%;
    background: #172033;
    color: #fff;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
}
.mc-modal h2 { font-size: clamp(27px, 5vw, 43px); line-height: 1.15; margin: 4px 0 10px; }
.mc-modal-box > p { margin: 0 0 12px; font-size: 16px; }
.mc-session { border: 2px dashed var(--mc-blue); border-radius: 8px; background: #eef4ff; color: #0045cc; font-weight: 750; padding: 8px; }
.mc-modal form { background: #f5f8fc; padding: clamp(14px, 4vw, 30px); margin-top: 18px; }
.mc-modal .form-item { margin: 0 0 12px; text-align: left; }
.mc-modal input[type=text], .mc-modal input[type=email], .mc-modal input[type=tel] {
    display: block;
    width: 100%;
    min-width: 0;
    background: #fff;
    border: 1px solid #bcc5d1;
    border-radius: 6px;
    padding: 13px 15px;
    font: inherit;
    font-size: 16px; /* 16px stops iOS zooming into the field */
}
.mc-modal .iti { display: block; width: 100%; }
.mc-submit {
    display: block;
    width: 100%;
    margin-top: 18px;
    padding: 15px 20px;
    border: 0;
    border-radius: 99px;
    background: var(--mc-blue);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 19px;
    font-weight: 750;
}
.mc-submit:hover { background: #0044cf; }
.mc-submit:disabled { opacity: .7; cursor: default; }
.mc-legal { font-size: 13px; color: var(--mc-muted); line-height: 1.45; margin: 16px 0 0; }
.mc-legal a { color: #003db5; }
body.mc-modal-open { overflow: hidden; }
