.auth-page {
    min-height: 90vh;
    padding: calc(var(--header-h) + 48px) 1rem 5rem;
    background: var(--color-surface);
}

.auth-container {
    width: min(100%, 420px);
    margin: 0 auto;
}

.auth-panel[hidden] {
    display: none;
}

.auth-title {
    margin: 0 0 1.5rem;
    color: var(--color-french-blue);
    font-size: clamp(1.25rem, 2vw, 1.4rem);
    font-weight: 700;
    text-align: left;
    line-height: 1.25;
}

.auth-title--center {
    text-align: center;
}

.auth-card {
    width: 100%;
    padding: 1.75rem 1.5rem 2rem;
    border-radius: 1rem;
    background: #fff;
    border: 1px solid #E4E7F0;
    box-shadow: 0 2px 12px rgba(62, 68, 155, 0.08);
    box-sizing: border-box;
}

.auth-card--compact {
    padding: 1.25rem 1.5rem;
}

.auth-form {
    display: flex;
    align-items: center;
    flex-direction: column;
    width: 100%;
}

.auth-step {
    display: none;
    flex-direction: column;
    width: 100%;
}

.auth-step.is-active {
    display: flex;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
    width: 100%;
}

.auth-field label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-french-blue);
}

.auth-form__box {
    width: 100%;
    padding: 1.25rem 1.25rem;
    border-radius: 1rem;
    background: #fff;
    border: 1px solid #E4E7F0;
    box-shadow: 0 2px 12px rgba(62, 68, 155, 0.08);
}

.auth-form__box--register {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 10px;
}

.auth-form input:not([type="checkbox"]),
.auth-field input {
    width: 100%;
    height: 2.85rem;
    padding: 0 1rem;
    border: 1px solid #D5D9E8;
    border-radius: 999px;
    outline: none;
    background: #F5F6FB;
    color: #202020;
    font: inherit;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.auth-form input:not([type="checkbox"]):focus,
.auth-field input:focus {
    border-color: var(--color-french-blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgb(62 68 155 / 16%);
}

.auth-form input::placeholder {
    color: #6b7280;
    opacity: 1;
}

.auth-password {
    position: relative;
    width: 100%;
}

.auth-password input {
    padding-right: 3rem !important;
}

.auth-password__toggle {
    position: absolute;
    top: 50%;
    right: 0.8rem;
    display: grid;
    width: 1.8rem;
    height: 1.8rem;
    padding: 0;
    transform: translateY(-50%);
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--color-french-blue);
    cursor: pointer;
}

.auth-password__toggle svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.auth-password__toggle.is-visible::after {
    position: absolute;
    width: 1.35rem;
    height: 1px;
    transform: rotate(-45deg);
    background: currentColor;
    content: "";
}

.auth-forgot-link {
    display: inline-block;
    align-self: flex-start;
    margin: 0 0 1.25rem;
    padding: 0.1rem 0;
    border: 0;
    background: none;
    color: var(--color-french-blue);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.auth-forgot-link:hover {
    text-decoration: underline;
}

.auth-primary-button {
    width: 100%;
    margin-top: 0;
    margin-bottom: 0.5rem;
    height: 2.85rem;
    border-radius: 999px;
    font-weight: 700;
}

.auth-step .auth-primary-button {
    margin-top: 0;
}

.auth-switch-button {
    margin-top: 0.25rem;
    padding: 0.65rem;
    border: 0;
    background: transparent;
    color: var(--color-french-blue);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: normal;
    line-height: 1.55;
    cursor: pointer;
    text-transform: none;
}

.auth-switch-button:hover {
    text-decoration: underline;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.75rem 0 0.5rem;
    color: #8a93a8;
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #E4E7F0;
}

.auth-helper-inline {
    margin: 0;
    text-align: center;
    font-size: 0.8rem;
    color: #6b7280;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 1rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-french-blue);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    max-width: 100%;
}

.auth-back:hover {
    text-decoration: underline;
}

.auth-back--center {
    margin: 0 auto 0.75rem;
    display: flex;
    width: fit-content;
}

.auth-back-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-form__row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.auth-consents {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.auth-consents label {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    color: #202020;
    font-size: 0.78rem;
    cursor: pointer;
}

.auth-consents input {
    width: 1rem;
    height: 1rem;
    margin: 0.1rem 0 0;
    accent-color: var(--color-accent);
}

.auth-consents a {
    color: var(--color-text);
    text-decoration: underline;
}

.auth-helper-text {
    max-width: 36rem;
    margin: 0 auto 1.25rem;
    color: #333;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
}

.auth-message {
    min-height: 1.4rem;
    margin: 0.75rem 0 0;
    color: var(--color-text);
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
}

.auth-message.is-error {
    color: #9f2020;
}

#return-message {
    margin-bottom: 1rem;
    text-align: center;
}

.sr-only {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 640px) {
    .auth-page {
        padding: calc(var(--header-h) + 28px) 0.75rem 3rem;
    }

    .auth-container {
        max-width: 31rem;
    }

    .auth-title {
        margin-bottom: 1.25rem;
        font-size: 1.15rem;
    }

    .auth-card,
    .auth-form__box {
        padding: 1.25rem 1rem 1.5rem;
        border-radius: 0.85rem;
    }

    .auth-form__row {
        grid-template-columns: 1fr;
    }

    .auth-form input:not([type="checkbox"]),
    .auth-field input {
        height: 2.65rem;
        font-size: 0.9rem;
    }

    .auth-primary-button {
        height: 2.65rem;
    }

    .auth-switch-button {
        margin-top: 0.5rem;
    }
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 1rem 0 1.15rem;
    color: #8a94aa;
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #E4E7F0;
}

.auth-google {
    width: 100%;
    display: flex;
    justify-content: center;
    overflow: visible;
}

.auth-google .g_id_signin,
.auth-google > div {
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    overflow: visible;
}
