/* Enrolment page (course-enrol.html): the Fard 'Ayn booking form as a page of the website.

   The form's own styles are css/enrol-form.css, which is generated from the form's source and scoped to .enrol.
   This file is written by hand and loads after it. It does three things:
     1. undoes the site-wide rules that would otherwise reach into the form
     2. gives the form the website's type, colours and square shapes
     3. lays out the top of the page as the course page's top is laid out
   Selectors here repeat the form's own (".enrol .thing"), so the later rule wins without !important. */

/* ---------- 1. Site-wide rules the form must not inherit ---------- */

/* The site's reset removes the margin that centres a dialog. Kept at low specificity so the form's own rule for
   phones (the sheet rises from the foot of the screen) still wins. */
dialog.sheet {
    margin: auto;
}

.enrol:focus {
    outline: none;
}

.enrol p {
    max-width: none;
}

.enrol a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.enrol h3 {
    font-weight: 500;
    letter-spacing: 0;
}

.enrol .done-head h1 {
    color: inherit;
}

.enrol .alert ul {
    list-style: disc;
}

/* ---------- 2. The website's type, colours and shapes ---------- */

.enrol {
    --paper: #FFFEF9;      /* the site's ivory */
    --paper-2: #FAF6F0;    /* the site's cream */
    --field: #FFFFFF;
    --ink: #2A2A2A;        /* the site's charcoal */
    --gold: #C4A962;
    --font-display: 'Bodoni Moda', 'Didot', 'Times New Roman', serif;
    --font-text: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
    /* "Back to the top" stops below the site's fixed header. */
    scroll-margin-top: var(--header-height);
}

/* Lines up with the site's header and footer. */
.enrol .wrap {
    max-width: var(--container-max);
    padding-left: max(var(--space-lg), env(safe-area-inset-left, 0px));
    padding-right: max(var(--space-lg), env(safe-area-inset-right, 0px));
}

/* Step titles in the site's lighter Bodoni. */
.enrol h2 {
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* Money uses the small optical size of Bodoni Moda, fixed, as on the course page: the display cut's hairlines are
   so fine that a 4 reads like a 1 and a 1 like a capital I (compared in options/money-figure-test.png). */
.enrol .person-fee,
.enrol .total,
.enrol .pay-total,
.enrol .sheet-total {
    font-variation-settings: 'opsz' 10;
}

/* Square shapes, as everywhere else on the site. */
.enrol .input,
.enrol .segmented,
.enrol .seg span,
.enrol .tick.panel,
.enrol .tick.commit,
.enrol .person,
.enrol .add,
.enrol .remove,
.enrol .ledger,
.enrol .alert,
.enrol .btn,
.enrol .done-card,
.enrol dialog.sheet {
    border-radius: 0;
}

.enrol .box {
    border-radius: 2px;
}

/* Buttons as the site's: capitals, spaced. (The site's .btn rule also applies to these.) */
.enrol .btn,
.enrol .add {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* A field or button brought into view stops clear of the site's fixed header, and of the total bar on a phone. */
.enrol input,
.enrol select,
.enrol textarea,
.enrol button,
.enrol .alert {
    scroll-margin-top: calc(var(--header-height) + 1rem);
    scroll-margin-bottom: 6rem;
}

/* ---------- 3. The top of the page ---------- */

/* A fine gold line closes it, as under the site's header. (The form's own arch band is not used on the website.) */
.enrol .hero {
    background: var(--cream);
    color: var(--charcoal);
    border-bottom: 1px solid rgba(196, 169, 98, 0.6);
}

.enrol .top-grid {
    gap: 1.5rem;
    padding-block: clamp(1.6rem, 3.2vw, 2rem) clamp(1.9rem, 3.6vw, 2.3rem);
}

.enrol .hero-back {
    margin-bottom: 1.2rem;
    font-size: 0.88rem;
    color: var(--emerald);
}

.enrol .hero-back:hover {
    color: var(--emerald-deep);
    text-decoration: none;
}

.enrol .hero-back svg {
    transition: transform 0.2s ease;
}

.enrol .hero-back:hover svg {
    transform: translateX(-3px);
}

/* The site's small heading above a title: a gold dash, then spaced capitals. */
.enrol .hero-kicker {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 0.95rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    line-height: 1;
    text-transform: uppercase;
    color: var(--emerald);
}

.enrol .hero-kicker::before {
    content: '';
    width: 32px;
    height: 2px;
    background: var(--gold);
}

/* The course name, set as it is on the course page. */
.enrol .hero h1 {
    font-size: clamp(2.6rem, 10.6vw, 4rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.014em;
    color: var(--emerald-deep);
}

.enrol .hero-line {
    max-width: 31em;
    margin-top: 0.95rem;
    font-size: clamp(1.09rem, 1.5vw, 1.19rem);
    line-height: 1.55;
    color: var(--slate);
}

/* The three steps beside the title: on a laptop only, where the space is otherwise empty. */
.enrol .hero-side {
    display: none;
}

@media (min-width: 960px) {
    .enrol .top-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
        gap: clamp(2rem, 6vw, 5rem);
        align-items: center;
    }

    /* A white card with a gold top edge, as the teachers' cards on the course page. */
    .enrol .hero-side {
        display: block;
        padding: 0.35rem 1.6rem;
        background: var(--ivory);
        border-top: 4px solid var(--gold);
        box-shadow: 0 16px 34px -20px rgba(8, 61, 51, 0.55);
    }

    .enrol .hero-steps {
        gap: 0;
    }

    .enrol .hero-steps li {
        align-items: center;
        gap: 1.1rem;
        padding: 0.9rem 0;
        font-family: var(--font-display);
        font-size: 1.25rem;
        line-height: 1.2;
        color: var(--emerald-deep);
    }

    .enrol .hero-steps li + li {
        border-top: 1px solid rgba(196, 169, 98, 0.45);
    }

    /* The same numbered badge as the steps of the form below. */
    .enrol .hero-step-num {
        display: grid;
        place-items: center;
        flex: 0 0 auto;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: var(--house);
        box-shadow: inset 0 0 0 2px var(--gold);
        font-size: 1.05rem;
        font-weight: 600;
        line-height: 1;
        color: var(--gold-text);
    }

    /* The form starts a little higher, so its first step shows on a laptop's first screen. */
    .enrol .body-grid {
        padding-top: 44px;
    }

    /* The summary beside the form: under the site's fixed header as the page scrolls, with the same gold edge. */
    .enrol .aside {
        top: calc(var(--header-height) + 24px);
        max-height: calc(100vh - var(--header-height) - 48px);
        overflow: auto;
        border: 0;
        border-top: 4px solid var(--gold);
        box-shadow: 0 16px 34px -20px rgba(8, 61, 51, 0.55);
    }
}

/* Bodoni's small cut is spaced widely; the commitment sentence reads better drawn in a little. */
.enrol .tick.commit .tick-title {
    letter-spacing: -0.012em;
}
