/*
 * Account entry page: ecosystem introduction, authentication and session views.
 * Load after ateam-common.css for entry-specific field overrides.
 * Base component rules come first; responsive media queries follow.
 */

/* ==========================================================================
   Page surface and viewport shell
   ========================================================================== */

.account-entry {
    min-height: 100vh;
    min-height: 100dvh;
    background: radial-gradient(ellipse at 1% 78%, #e3f5ff 0, transparent 47%), radial-gradient(ellipse at 100% 4%, #eaf3ff 0, transparent 42%), #f7fafd;
}

.page-shell {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    /* The shell grows with real content; decorative descendants stay inside its painted bounds. */
    overflow: clip;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px 64px 0;
}

/* ==========================================================================
   Page-wide contour artwork
   ========================================================================== */

/* A clipped, noninteractive layer adds relief at the page edges behind all content. */
.entry-background {
    position: absolute;
    z-index: -1;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.entry-contours {
    position: absolute;
    height: auto;
    color: #62b4e8;
    stroke: currentColor;
    stroke-width: .7;
    opacity: .2;
}

.entry-contours-top {
    top: -30px;
    left: -100px;
    width: clamp(360px, 43vw, 620px);
}

.entry-contours-right {
    top: -40px;
    right: -180px;
    width: clamp(380px, 46vw, 660px);
}

/* ==========================================================================
   Company brand, logo and caption
   ========================================================================== */

.company-brand {
    display: flex;
    align-items: center;
    gap: 13px;
    width: fit-content;
    max-width: 100%;
    margin-bottom: 40px;
    color: var(--color-navy);
    text-decoration: none;
}

.company-brand-mark {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.company-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.company-brand-name {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.6px;
}

.company-brand-suffix {
    font-weight: 400;
}

.company-brand-caption {
    color: var(--color-muted);
    font-size: 14px;
    letter-spacing: 1.9px;
    text-transform: uppercase;
}

/* ==========================================================================
   Main grid and content-height alignment
   ========================================================================== */

.entry-main {
    display: grid;
    flex: 1 0 auto;
    grid-template-columns: minmax(0, 1.22fr) minmax(380px, 1fr);
    gap: 68px;
    align-items: center;
    align-content: center;
    padding: 30px 0 48px;
}

/* When natural content exceeds the viewport, both columns return to normal top alignment. */
.page-shell.is-content-tall .entry-main {
    align-items: start;
    align-content: start;
}

.entry-introduction {
    min-width: 0;
}

/* ==========================================================================
   Ecosystem story, headline and local contours
   ========================================================================== */

.ecosystem-story {
    position: relative;
    isolation: isolate;
    min-width: 0;
}

.story-contours {
    position: absolute;
    z-index: -1;
    top: -60px;
    right: -30px;
    width: 105%;
    height: 720px;
    color: #62b4e8;
    stroke: currentColor;
    stroke-width: .7;
    opacity: .22;
    pointer-events: none;
}

.ecosystem-story h1 {
    margin: 0 0 21px;
    color: var(--color-navy);
    font-size: clamp(47px, 4.65vw, 65px);
    font-weight: 750;
    line-height: 1.06;
    letter-spacing: -2.8px;
}

.ecosystem-story h1 > span {
    color: var(--color-blue);
}

.story-description {
    margin: 0;
    color: #56718a;
    font-size: 16px;
    line-height: 1.8;
}

/* ==========================================================================
   Product introduction, cards and logo proportions
   ========================================================================== */

.product-collection {
    margin-top: 65px;
}

.collection-label {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #5c7b94;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1.1px;
    text-transform: uppercase;
}

.collection-label > span {
    height: 1px;
    flex: 1;
    background: #c8e0f2;
}

/* The office-to-field copy is a compact introduction to the product collection. */
.collection-description {
    margin: 14px 0 0;
    color: #668198;
    font-size: 11px;
    line-height: 1.7;
    text-align: center;
}

.product-grid {
    --product-logo-height: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.product-card {
    min-width: 0;
    padding: 19px 12px 17px;
    border: 1px solid #d0e5f5;
    border-radius: 13px;
    background: rgb(255 255 255 / 75%);
    box-shadow: 0 4px 15px rgb(27 98 154 / 3%);
    text-align: center;
}

.product-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-logo img {
    display: block;
    width: auto;
    max-width: 100%;
    height: var(--product-logo-height);
    object-fit: contain;
}

/* PROPOSALS has transparent top/bottom padding; compensate to match the visible logo height. */
.product-logo .product-logo-proposals {
    height: calc(var(--product-logo-height) * 1.1);
}

.product-card p {
    margin: 15px 10px 5px;
    color: #868686;
    font-size: 11px;
    font-weight: 600;
}

.product-category {
    display: block;
    color: #617b92;
    font-size: 9px;
    line-height: 1.5;
}

/* ==========================================================================
   Account access container and form card
   ========================================================================== */

/* Card height grows naturally for registration; the document remains scrollable. */
.account-access {
    min-width: 0;
    scroll-margin-top: 20px;
}

.access-card {
    position: relative;
    overflow: hidden;
    padding: 30px 34px 28px;
    border: 1px solid #e0eaf3;
    border-radius: 23px;
    background: white;
    box-shadow: 0 24px 70px rgb(16 65 108 / 8%), 0 2px 8px rgb(16 65 108 / 3%);
}

/* ==========================================================================
   Session-restoration overlay and initial content visibility
   ========================================================================== */

/* Preserve natural card height while hiding unknown session content before the first paint. */
.access-card.is-session-loading > #auth-forms, .access-card.is-session-loading > #authenticated-panel {
    visibility: hidden;
}

.session-loader {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 28px;
    border-radius: inherit;
    background: radial-gradient(ellipse at center, #f2f9ff, white 70%);
    text-align: center;
}

.session-loader-spinner {
    width: 52px;
    height: 52px;
    margin-bottom: 8px;
    border: 4px solid #e1edf8;
    border-top-color: var(--color-blue);
    border-right-color: var(--color-sky);
    border-radius: 50%;
    animation: session-loader-spin .9s linear infinite;
}

.session-loader strong {
    color: var(--color-navy);
    font-size: 17px;
    font-weight: 600;
}

.session-loader p {
    margin: 0;
    color: var(--color-muted);
    font-size: 13px;
    line-height: 1.7;
}

/* The shared reduced-motion preference disables this animation with the other interface effects. */
@keyframes session-loader-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Entry input surfaces, autofill and overlaid controls
   ========================================================================== */

/* The input owns the full field surface, so native autofill also paints beneath its icons. */
.account-entry .input-shell {
    position: relative;
    display: block;
    border: 0;
    background: transparent;
}

.account-entry .input-shell input {
    /* A block input avoids the inline baseline gap and preserves the original field height. */
    display: block;
    min-height: 48px;
    padding: 10px 13px 10px 44px;
    border: 1px solid var(--color-line);
    background: #fbfdff;
    transition: border-color .16s, box-shadow .16s;
}

.account-entry .input-shell-plain input {
    padding-left: 14px;
}

.account-entry .input-shell > i {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 1px;
    width: 44px;
    transform: translateY(-50%);
    pointer-events: none;
}

.account-entry .input-shell:has(> .password-toggle) input {
    padding-right: 56px;
}

.account-entry .password-toggle {
    position: absolute;
    z-index: 1;
    top: 1px;
    right: 1px;
    bottom: 1px;
    width: 43px;
    padding: 0;
}

/* ==========================================================================
   Entry input focus and validation states
   ========================================================================== */

/* The full input receives one focus ring, including when its password button is focused. */
.account-entry .input-shell:focus-within {
    box-shadow: none;
}

.account-entry .input-shell:focus-within input {
    border-color: var(--color-blue);
    box-shadow: 0 0 0 3px rgb(8 124 229 / 11%);
}

.account-entry .input-shell input[aria-invalid="true"] {
    border-color: var(--color-error);
}

/* ==========================================================================
   Authentication tabs and session-restoration notice
   ========================================================================== */

.auth-tabs {
    display: flex;
    gap: 5px;
    padding: 5px;
    border: 1px solid #e8eff6;
    border-radius: 11px;
    background: #f3f7fb;
}

.auth-tab {
    width: 50%;
    min-height: 38px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #61758b;
    font-size: 12px;
    font-weight: 600;
}

.auth-tab.is-active {
    border-color: #e4edf6;
    background: white;
    color: var(--color-navy);
    box-shadow: 0 2px 5px rgb(14 55 94 / 6%);
}

.session-notice {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 16px;
    color: var(--color-muted);
    font-size: 11px;
    line-height: 1.6;
}

/* ==========================================================================
   Form headings, submit actions and navigation footnotes
   ========================================================================== */

.form-heading {
    margin: 29px 0 26px;
}

.form-heading h2, .authenticated-panel h2 {
    margin: 0 0 9px;
    color: var(--color-navy);
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -.9px;
}

.form-heading p {
    margin: 0;
    color: var(--color-muted);
    font-size: 12px;
    line-height: 1.7;
}

.submit-button {
    margin-top: 7px;
}

.submit-button > i {
    font-size: 12px;
}

.form-footnote {
    margin: 22px 0 0;
    color: #6b7f92;
    font-size: 11px;
    line-height: 1.7;
    text-align: center;
}

/* ==========================================================================
   Registration groups and field spacing
   ========================================================================== */

.registration-group {
    min-width: 0;
    margin: 0 0 4px;
    padding: 0;
    border: 0;
}

.registration-group legend {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 17px;
    color: #4b6881;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .4px;
}

.group-number {
    padding: 3px 5px;
    border-radius: 4px;
    background: #edf6ff;
    color: var(--color-blue);
    font-size: 9px;
}

#register-panel .form-field {
    margin-bottom: 16px;
}

#register-panel .form-heading {
    margin-bottom: 22px;
}

/* ==========================================================================
   Registration draft notices: explicit choices, distinct from published terms
   ========================================================================== */

.registration-legal {
    min-width: 0;
    margin: 8px 0 22px;
    padding: 16px;
    border: 1px solid #d9e4f1;
    border-radius: 12px;
    background: #f6f9fd;
}

.registration-legal legend {
    padding: 0 6px;
    color: #334e68;
    font-size: 12px;
    font-weight: 700;
}

.registration-legal-disclosure {
    margin: 0 0 16px;
    color: #526579;
    font-size: 12px;
    line-height: 1.6;
}

.account-entry .registration-legal-choice {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.6;
    cursor: pointer;
}

.registration-legal-choice > span {
    flex: 1;
    min-width: 0;
}

.account-entry .registration-legal-choice input {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    padding: 0;
    accent-color: var(--color-blue);
    cursor: pointer;
}

.registration-legal-choice input:focus-visible,
.registration-legal-choice input[aria-invalid="true"] {
    outline: 2px solid var(--color-blue);
    outline-offset: 3px;
}

.registration-legal-choice a {
    color: #075eac;
    text-decoration: underline;
    text-underline-offset: 2px;
}

#register-panel .registration-legal .form-field:last-of-type {
    margin-bottom: 0;
}

/* ==========================================================================
   JavaScript availability feedback
   ========================================================================== */

.noscript-message {
    padding: 14px;
    color: var(--color-error);
    font-size: 13px;
    line-height: 1.6;
}

/* ==========================================================================
   Active-session confirmation, identity and actions
   ========================================================================== */

/* A completed or restored session offers entry to the authenticated account workspace. */
.authenticated-panel {
    padding-top: 12px;
}

.session-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 25px;
    border: 1px solid #b4dfc5;
    border-radius: 16px;
    background: #edf8f1;
    color: #21834a;
    font-size: 22px;
}

.session-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.authenticated-description {
    margin: 15px 0 25px;
    color: var(--color-muted);
    font-size: 13px;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

.session-details {
    margin: 0 0 28px;
    padding: 5px 16px;
    border: 1px solid var(--color-line);
    border-radius: 12px;
    background: #f8fbff;
}

.session-details > div {
    padding: 14px 0;
}

.session-details > div + div {
    border-top: 1px solid #e5edf6;
}

.session-details dt {
    margin-bottom: 5px;
    color: var(--color-muted);
    font-size: 10px;
}

.session-details dd {
    margin: 0;
    color: var(--color-navy);
    font-size: 14px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* ==========================================================================
   Page footer and company location
   ========================================================================== */

.entry-footer {
    display: flex;
    flex: 0 0 auto;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 23px 0 25px;
    border-top: 1px solid #dce9f3;
    color: #6f879c;
    font-size: 10px;
    line-height: 1.7;
}

/* ==========================================================================
   Media queries — responsive adaptations
   ========================================================================== */

/* Wide desktop: increase vertical spacing from 1500px. */
@media (min-width: 1500px) {
    .entry-main {
        padding-top: 48px;
        padding-bottom: 64px;
    }
}

/* Compact desktop: reduce columns, spacing and product typography at 1150px and below. */
@media (max-width: 1150px) {
    /* Page spacing and two-column layout. */
    .page-shell {
        padding-right: 36px;
        padding-left: 36px;
    }

    .entry-main {
        grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr);
        gap: 36px;
    }

    /* Story and product scale. */
    .ecosystem-story h1 {
        font-size: 53px;
    }

    .product-grid {
        --product-logo-height: 14px;
        gap: 7px;
    }

    .product-card {
        padding-right: 7px;
        padding-left: 7px;
    }

    .product-card p {
        font-size: 10px;
    }

    .product-category {
        font-size: 8px;
    }
}

/* Tablets and phones: use one column with brand, form and story at 850px and below. */
@media (max-width: 850px) {
    /* Page spacing and edge decoration. */
    .page-shell {
        padding: 16px 28px 0;
    }

    /* Keep the same natural SVG proportions with lighter edge detail on narrow pages. */
    .entry-contours {
        opacity: .14;
    }

    .entry-contours-top {
        left: -160px;
        width: 400px;
    }

    .entry-contours-right {
        top: 210px;
        right: -180px;
        width: 400px;
    }

    /* Centered company branding. */
    .company-brand {
        grid-row: 1;
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
        justify-content: center;
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .company-brand-copy {
        align-items: center;
    }

    .company-brand-name {
        font-size: 22px;
    }

    .company-brand-caption {
        font-size: 16px;
        letter-spacing: 1.4px;
    }

    .company-brand-mark {
        width: 100px;
        height: 100px;
    }

    /* Single-column order and ecosystem story. */
    .entry-main {
        grid-template-columns: minmax(0, 1fr);
        gap: 38px;
        padding: 30px 0 40px;
        align-items: start;
    }

    /* Unwrap the introduction column so mobile keeps branding above the form. */
    .entry-introduction {
        display: contents;
    }

    .ecosystem-story {
        grid-row: 3;
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
        text-align: center;
    }

    .ecosystem-story h1 {
        font-size: 48px;
        letter-spacing: -2px;
    }

    .ecosystem-story h1 br:last-child {
        display: none;
    }

    .story-description {
        max-width: 480px;
        margin-right: auto;
        margin-left: auto;
        font-size: 15px;
    }

    .product-collection {
        margin-top: 26px;
    }

    .story-contours {
        top: -110px;
        height: 450px;
        width: 80%;
        right: -20px;
    }

    /* Form width and footer typography. */
    .account-access {
        grid-row: 2;
        width: 100%;
        max-width: 530px;
        margin: 0 auto;
    }

    .entry-footer {
        font-size: 9px;
    }
}

/* Small phones: compact the form and stack product cards at 480px and below. */
@media (max-width: 480px) {
    /* Page edges and company branding. */
    .page-shell {
        padding: 12px 20px 0;
    }

    .company-brand {
        gap: 6px;
    }

    .company-brand-mark {
        width: 120px;
        height: 120px;
    }

    .company-brand-name {
        font-size: 22px;
        letter-spacing: -.4px;
    }

    .company-brand-caption {
        font-size: 16px;
        letter-spacing: 1px;
    }

    .company-brand-suffix {
        font-size: 22px;
        letter-spacing: .2px;
    }

    /* Main spacing and story typography. */
    .entry-main {
        gap: 27px;
        padding-top: 26px;
    }

    .ecosystem-story h1 {
        font-size: 39px;
        letter-spacing: -1.8px;
    }

    .story-description {
        font-size: 13px;
        line-height: 1.8;
    }

    /* Stacked cards keep the widest logo readable without unequal downscaling on small phones. */
    .product-grid {
        --product-logo-height: 24px;
        grid-template-columns: minmax(0, 1fr);
    }

    /* Compact form card and footer. */
    .access-card {
        padding: 25px 23px 24px;
        border-radius: 18px;
    }

    .form-heading h2, .authenticated-panel h2 {
        font-size: 25px;
    }

    .footer-location {
        display: none;
    }
}
