/* Login, password reset, account, newsletter and the contact form partial.
   Tokens come from app.css; nothing here is boxed: forms sit on the page. */

.form-page,
.contact-form {
    --form-error: #a4241a;
    --form-error-bg: #fbeceb;
    --form-ok: #0b7f87;
    --form-ok-bg: #e3f6f7;
    --form-measure: 36rem;
}

/* Page head: the sky band of the content pages */

.form-hero {
    padding-block: clamp(2rem, 1rem + 3vw, 3.5rem) clamp(1.75rem, 1rem + 2vw, 2.75rem);
    background:
        radial-gradient(50rem 26rem at 85% 20%, rgba(18, 195, 206, 0.13), transparent 70%),
        linear-gradient(180deg, var(--sky) 0%, #f5f9fd 65%, var(--white) 100%);
}

.form-hero h1 {
    max-width: 18ch;
    color: var(--blue);
    font-size: clamp(2.5rem, 1.5rem + 3vw, 4.25rem);
    line-height: 1.02;
}

.form-lead {
    margin-top: 1.1rem;
    color: var(--ink-soft);
    font-size: var(--step-1);
    line-height: 1.6;
}

.form-crumbs ol {
    display: flex;
    flex-wrap: wrap;
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
    font-size: 1rem;
    color: var(--ink-soft);
}

.form-crumbs li + li::before {
    content: "/";
    margin-inline: 0.55rem;
    color: var(--teal);
}

.form-crumbs a {
    text-decoration: none;
}

.form-crumbs a:hover {
    text-decoration: underline;
}

/* Body: form column and an optional aside */

.form-body {
    padding-block: clamp(1.5rem, 1rem + 2vw, 2.5rem) var(--space-xl);
}

.form-grid {
    display: grid;
    gap: var(--space-l);
}

@media (min-width: 60rem) {
    .form-grid--aside {
        grid-template-columns: minmax(0, var(--form-measure)) minmax(0, 26rem);
        column-gap: clamp(4rem, 10vw, 10rem);
        align-items: start;
    }
}

.form-main {
    max-width: var(--form-measure);
}

.form-main > * + * {
    margin-top: 1.5rem;
}

.form-aside h2 {
    color: var(--blue);
    font-size: var(--step-2);
}

.form-aside > * + * {
    margin-top: 1rem;
}

.form-aside .actions {
    margin-top: 1.5rem;
}

.form-after {
    margin-top: var(--space-l);
    color: var(--ink-soft);
}

/* Fields */

.form-stack {
    display: grid;
    gap: 1.4rem;
}

.form-field label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--navy);
    font-weight: 700;
    font-stretch: var(--semi);
}

.form-field input,
.form-field textarea {
    display: block;
    width: 100%;
    min-height: 56px;
    padding: 0.65rem 0.95rem;
    border: 2px solid var(--rule);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--ink);
    font: inherit;
    line-height: 1.4;
    caret-color: var(--blue);
    transition: border-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}

.form-field textarea {
    min-height: 11rem;
    resize: vertical;
}

.form-field input:hover,
.form-field textarea:hover {
    border-color: #aab5cc;
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(18, 195, 206, 0.22);
}

.form-field.has-error label {
    color: var(--form-error);
}

.form-field.has-error input,
.form-field.has-error textarea {
    border-color: var(--form-error);
}

.form-hint {
    margin-top: 0.4rem;
    font-size: 1.05rem;
    color: var(--ink-soft);
}

.form-error {
    margin-top: 0.4rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--form-error);
}

.form-legal {
    color: var(--ink-soft);
    font-size: 1.1rem;
}

.form-submit {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
}

.form-submit .button {
    min-height: 56px;
    padding-inline: 1.75rem;
}

.form-link {
    font-weight: 600;
}

/* Password reset: one short column in the middle of the page, head and
   form close together, no skyline behind the head. */
.form-page--narrow {
    --form-measure: 26rem;
    --narrow-space: clamp(2.5rem, 1.5rem + 3vw, 4rem);
}

.form-page--narrow .form-hero {
    padding-block: var(--narrow-space) 1.5rem;
    text-align: center;
}

.form-page--narrow .form-hero::after {
    content: none;
}

.form-page--narrow .form-hero h1 {
    max-width: none;
    font-size: clamp(2.25rem, 1.6rem + 2vw, 3.25rem);
}

.form-page--narrow .form-lead {
    max-width: 30rem;
    margin-inline: auto;
    font-size: var(--step-0);
    line-height: 1.5;
}

/* The same space below the last line as above the headline. The footer
   adds 1.25rem padding and 15px above the text of its 44px links. */
.form-page--narrow .form-body {
    padding-block: 0.5rem max(0px, calc(var(--narrow-space) - 1.25rem - 15px));
}

.form-page--narrow .form-main {
    margin-inline: auto;
}

.form-page--narrow .form-main > p {
    text-align: center;
}

.form-page--narrow .form-submit,
.form-page--narrow .actions {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    text-align: center;
}

.form-page--narrow .form-submit .button,
.form-page--narrow .actions .button {
    justify-content: center;
    width: 100%;
    min-height: 56px;
}

/* Hidden from people, filled by bots */
.form-trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.cf-turnstile {
    min-height: 65px;
}

/* Notes: status and error lines above a form */

.form-note {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    background: var(--sky);
    color: var(--navy);
    line-height: 1.5;
}

.form-note svg {
    flex: none;
    width: 1.5rem;
    height: 1.5rem;
    margin-top: 0.1rem;
}

.form-note--ok {
    background: var(--form-ok-bg);
}

.form-note--ok svg {
    color: var(--form-ok);
}

.form-note--error {
    background: var(--form-error-bg);
    color: var(--form-error);
}

/* Done states: a check draws itself once */

.form-done {
    display: grid;
    gap: 1.25rem;
    justify-items: start;
}

.form-check {
    width: clamp(3.5rem, 3rem + 2vw, 4.5rem);
    height: auto;
    color: var(--cyan);
}

.form-check circle,
.form-check path {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
}

@media (prefers-reduced-motion: no-preference) {
    .form-check circle {
        animation: form-draw 700ms var(--ease-out) both;
    }

    .form-check path {
        animation: form-draw 420ms 520ms var(--ease-out) both;
    }
}

@keyframes form-draw {
    from {
        stroke-dashoffset: 1;
    }
}

/* Account page: one row per topic, heading left, content right */

.account-section {
    display: grid;
    gap: 1.25rem;
    padding-block: clamp(2rem, 1.5rem + 2vw, 3rem);
    border-top: 1px solid var(--rule);
}

.account-section:first-child {
    border-top: 0;
    padding-top: 0;
}

.account-section h2 {
    color: var(--blue);
    font-size: var(--step-2);
}

@media (min-width: 60rem) {
    .account-section {
        grid-template-columns: 16rem minmax(0, 1fr);
        column-gap: clamp(3rem, 8vw, 8rem);
    }
}

.account-section .form-main {
    max-width: 34rem;
}

.account-email {
    font-size: var(--step-1);
    font-weight: 700;
    font-stretch: var(--semi);
    color: var(--navy);
    overflow-wrap: anywhere;
}

.account-logout {
    margin-top: 1.25rem;
}

.account-empty .actions {
    margin-top: 1.25rem;
}

/* Orders */

.orders {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: lining-nums tabular-nums;
}

.orders th {
    padding: 0 1rem 0.6rem 0;
    color: var(--ink-soft);
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
}

.orders td {
    padding: 0.9rem 1rem 0.9rem 0;
    border-top: 1px solid var(--rule);
    vertical-align: top;
}

.orders .num {
    text-align: right;
    white-space: nowrap;
}

.orders ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.order-status {
    font-weight: 700;
    font-stretch: var(--semi);
}

.order-status--paid {
    color: var(--form-ok);
}

@media (max-width: 47.99rem) {
    .orders thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .orders tr {
        display: grid;
        gap: 0.2rem;
        padding-block: 1rem;
        border-top: 1px solid var(--rule);
    }

    .orders td {
        padding: 0;
        border: 0;
    }

    .orders td::before {
        content: attr(data-label) ": ";
        color: var(--ink-soft);
    }

    .orders .num {
        text-align: left;
    }
}

/* Contact form partial, placed on /contact/ and /legal/ */

.contact-form {
    max-width: var(--form-measure);
    scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

.contact-form > * + *,
#contact-form-body > * + * {
    margin-top: 1.5rem;
}

.contact-form h1,
.contact-form h2 {
    color: var(--blue);
}

.contact-form h2 {
    font-size: var(--step-3);
}

/* Login and join: navy side with the member line, form on white. */

.auth {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: calc(100dvh - var(--header-h));
}

.auth-side {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: clamp(2.5rem, 5vw, 5rem) clamp(1.5rem, 4vw, 4rem);
    background:
        radial-gradient(40rem 30rem at 80% 90%, rgba(18, 195, 206, 0.28), transparent 70%),
        linear-gradient(160deg, var(--navy) 0%, #152463 70%, var(--blue) 130%);
    color: var(--white);
}

.auth-heading {
    margin-bottom: 1.5rem;
    color: var(--white);
    font-size: var(--step-3);
}

.auth-quote {
    max-width: 24ch;
    font-size: clamp(1.75rem, 1rem + 1.6vw, 2.5rem);
    font-weight: 750;
    font-stretch: var(--semi);
    line-height: 1.15;
    text-wrap: balance;
}

.auth-main {
    display: grid;
    place-items: center;
    padding: clamp(2.5rem, 5vw, 5rem) 1.25rem;
}

.auth-form {
    width: 100%;
    max-width: 26rem;
}

.auth-form h1 {
    margin-bottom: 1.75rem;
    color: var(--blue);
    font-size: var(--step-4);
}

.auth-form .form-note {
    margin-bottom: 1.25rem;
}

.auth-forgot {
    justify-self: end;
    margin-top: -0.75rem;
    color: var(--blue);
    font-size: 1rem;
    font-weight: 600;
}

.auth-submit {
    justify-content: center;
    width: 100%;
    min-height: 56px;
}

.auth-form .form-legal {
    margin: 0;
    font-size: 1rem;
}

.auth-switch {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
    color: var(--ink-soft);
    font-size: var(--step-0);
}

.auth-switch a {
    color: var(--blue);
    font-weight: 700;
}

@media (max-width: 56rem) {
    .auth {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
    }

    /* The navy side carries the h1, so it stays above the form. */
    .auth-side {
        padding-block: 2.5rem;
    }

    .auth-main {
        padding-block: 2rem 3rem;
    }
}

/* /join/: the login layout with a wider form and the membership choice at
   its end. The chosen level gets the blue frame and a cyan glow. */
.join-form {
    max-width: 32rem;
}

.join-plans {
    display: grid;
    gap: 0.75rem;
    margin: 0.5rem 0 0;
    padding: 0;
    border: 0;
}

.join-plans legend {
    margin-bottom: 0.75rem;
    padding: 0;
    color: var(--blue);
    font-size: var(--step-2);
    font-weight: 800;
    font-stretch: var(--semi);
}

.join-plan {
    position: relative;
    display: grid;
    gap: 0.3rem;
    padding: 1rem 1.25rem 1rem 3.25rem;
    border: 2px solid var(--rule);
    border-radius: calc(var(--radius) + 4px);
    background: var(--white);
    cursor: pointer;
    transition: border-color 200ms, box-shadow 260ms var(--ease-out), background-color 200ms;
}

.join-plan:hover {
    border-color: var(--teal);
}

.join-plan input {
    position: absolute;
    top: 1.2rem;
    left: 1.1rem;
    width: 1.35rem;
    height: 1.35rem;
    margin: 0;
    accent-color: var(--blue);
}

.join-plan:has(input:checked) {
    border-color: var(--blue);
    background: linear-gradient(180deg, #f4f9fe, var(--white));
    box-shadow: 0 0 0 4px rgba(18, 195, 206, 0.22), 0 18px 40px -24px rgba(33, 63, 154, 0.55);
}

.join-plan:has(input:focus-visible) {
    outline: 3px solid var(--cyan);
    outline-offset: 2px;
}

.join-plan-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0 1rem;
}

.join-plan-name {
    color: var(--navy);
    font-size: var(--step-1);
    font-weight: 800;
    font-stretch: var(--semi);
}

.join-plan-price {
    color: var(--ink-soft);
    font-size: 1rem;
}

.join-plan-price strong {
    color: var(--blue);
    font-size: var(--step-1);
    font-weight: 800;
}

.join-plan-text {
    color: var(--ink-soft);
    font-size: 1.0625rem;
    line-height: 1.45;
}

.join-plan-terms {
    font-size: 0.9375rem;
}

.join-form .auth-submit {
    margin-top: 0.5rem;
}
