/* Measurements come from the InDesign source (126ASXT0808_DEM iscrizione_v1.idml).
   The PDF page is 700pt wide, so 1pt in the design = 1px here. */

:root {
    --color-stellaris-red: #a62b4e;   /* "Astellas Dark Red" swatch: rgb(166 43 78) */
    --color-stellaris-red-dark: #8c2442; /* hover state of the CTA */
    --color-nero-70: #444444;         /* [Nero] 70% tint */
    --color-astellas-gray: #939597;   /* "Astellas Gray" swatch: rgb(147 149 151), footer band */
    --color-light-gray: #a7a9ac;      /* "Astellas Light Gray" swatch: rgb(167 169 172), input borders */
    --ring-gradient: linear-gradient(90deg, #f22add 3%, #0562ff 51%, #1feaf7 98%);
    --page-width: 700px;
    --page-margin: 40px;              /* text column is 620px, like the PDF */
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Base type is set once here and inherited. Don't repeat it on every tag. */
body {
    margin: 0;
    background: #e9e9e9;              /* gray "desk" around the sheet */
    font-family: Arial, Helvetica, sans-serif;
    font-size: 18px;
    line-height: 1.2;                 /* InDesign "Auto" leading = 120% */
    font-weight: 400;
    color: var(--color-nero-70);
}

p {
    margin: 0;
}

/* ---------- Page sheet ---------- */

.page {
    width: var(--page-width);
    max-width: 100%;
    margin: 40px auto;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .15);
}

img.hero {
    display: block;                   /* removes the gap under inline images */
    width: 100%;
    height: auto;
}

.neat-section {
    padding: 36px var(--page-margin) 37px;
}

.text-red {
    color: var(--color-stellaris-red);
}

/* ---------- Introduction ---------- */

.greeting {
    font-weight: 700;
    margin-bottom: 34px;
}

.point-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 25px;
}

.point-parent {
    display: flex;
    align-items: center;
}

/* Gradient ring: white fill on the padding box, gradient on the border box. */
.point-container {
    flex: none;
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    margin-right: 23px;
    border: 2.7px solid transparent;
    border-radius: 50%;
    background:
        linear-gradient(#fff, #fff) padding-box,
        var(--ring-gradient) border-box;
}

img.point-icon {
    display: block;
    width: 56px;
    height: auto;
}

/* ---------- Episode block ---------- */

.divider {
    height: 2px;
    margin: 0 var(--page-margin);
    border: 0;
    background: var(--color-stellaris-red);
}

.episode-label {
    margin: 17px 0 6px;
    text-align: center;
    font-weight: 700;
}

/* ---------- Registration form ---------- */

.subscription {
    padding: 28px var(--page-margin) 40px;
}

.subscription-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* form.js hides the form after a successful submit. */
.subscription-form[hidden] {
    display: none;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
    width: 100%;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field--full {
    grid-column: 1 / -1;
}

.field label {
    font-size: 14px;
    font-weight: 700;
}

.field input {
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--color-light-gray);
    border-radius: 6px;
    background: #fff;
    color: inherit;
    font-family: inherit;
    font-size: 16px;                  /* 16px or more stops iOS from zooming in on focus */
}

.field input:focus-visible {
    outline: none;
    border-color: var(--color-stellaris-red);
    box-shadow: 0 0 0 3px rgb(166 43 78 / .2);
}

.privacy {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    font-size: 14px;
}

.privacy input {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--color-stellaris-red);
}

.privacy input:focus-visible {
    outline: 2px solid var(--color-stellaris-red);
    outline-offset: 2px;
}

.privacy a {
    color: var(--color-stellaris-red);
}

/* Honeypot: off-screen for people, still in the form for bots. */
.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-error {
    color: var(--color-stellaris-red);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.form-error:empty {
    display: none;
}

/* Hidden until form.js adds .is-visible, or the no-JS redirect targets them by id. */
.form-notice {
    display: none;
    margin-bottom: 20px;
    padding: 16px 20px;
    border-radius: 6px;
    text-align: center;
    font-weight: 700;
}

.form-notice:target,
.form-notice.is-visible {
    display: block;
}

.form-notice:focus {
    outline: none;
}

.form-notice--ok {
    background: var(--color-stellaris-red);
    color: #fff;
}

.form-notice--error {
    background: rgb(166 43 78 / .08);
    color: var(--color-stellaris-red);
}

/* After a successful no-JS submit, show only the thank-you message. */
#iscrizione-ok:target ~ .subscription-form {
    display: none;
}

/* The pill is the form's submit button. */
.cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 390px;
    max-width: 100%;
    min-height: 55px;
    margin-top: 8px;                  /* 20px gap + 8px = 28px, like the space above it in the PDF */
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: var(--color-stellaris-red);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-wrap: balance;               /* on phones the label wraps into two even lines, not "…CLICCA / QUI" */
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s;
}

.cta:hover {
    background: var(--color-stellaris-red-dark);
}

.cta:focus-visible {
    outline: 3px solid var(--color-stellaris-red);
    outline-offset: 3px;
}

.cta:disabled {
    opacity: .6;
    cursor: progress;
}

/* ---------- Moderator / speakers ---------- */

/* 39px gap in the PDF, plus the ~8px of empty space at the bottom of the 84px speaker frames. */
.members-section {
    padding: 0 var(--page-margin) 47px;
}

.moderator {
    display: flex;
    align-items: center;
}

/* The headshot PNG already contains its gradient ring. */
img.headshot {
    display: block;
    flex: none;
    width: 86px;
    height: auto;
    margin-right: 23px;
}

.moderator-name {
    font-weight: 700;
    margin-bottom: 6px;
}

.section-label {
    margin: 33px 0 6px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

/* Three 196px columns with 16px gutters, like the InDesign frames. */
.speaker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px 16px;
}

.speaker-name {
    margin-bottom: 6px;
    font-size: 16px;
    font-weight: 700;
}

.speaker-role {
    font-size: 14px;
}

/* ---------- Footer ---------- */

/* Text sits at the bottom of the gray band, logo in the bottom-right corner. */
.page-footer {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 156px;
    padding: 14px var(--page-margin) 42px;
    background: var(--color-astellas-gray);
    color: #fff;
    font-size: 10px;
    letter-spacing: .005em;           /* InDesign tracking 5 */
}

.page-footer p + p {
    margin-top: 4px;
}

.page-footer a {
    color: inherit;
}

img.footer-logo {
    position: absolute;
    right: 34px;
    bottom: 31px;
    display: block;
    width: 124px;
    height: auto;
}

/* ---------- Narrow screens ---------- */

@media (max-width: 700px) {
    .page {
        margin: 0;
        box-shadow: none;
    }

    :root {
        --page-margin: 20px;
    }

    /* The hard <br> breaks only match the PDF at full width. Let the text wrap freely here. */
    .introduction br,
    .page-footer br {
        display: none;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    /* The absolute logo would cover the text once lines wrap more. Put it under the text. */
    .page-footer {
        padding-bottom: 24px;
    }

    img.footer-logo {
        position: static;
        align-self: flex-end;
        margin-top: 16px;
    }
}

@media (max-width: 560px) {
    .speaker-grid {
        grid-template-columns: 1fr;
    }
}
