@import url('../variables.css');

/* Auth pages — login / register / forgot / reset (full-width, landing header) */

.auth-layout {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    background-color: var(--bg-tertiary);
}

#main:has(.auth-layout) {
    padding: 0;
    background-color: var(--bg-tertiary);
}

.auth-page {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 2rem;
    box-sizing: border-box;
    width: 100%;
    max-width: var(--max-width);
    min-height: 100dvh;
    min-height: 100vh;
    margin-inline: auto;
    padding: var(--landing-header-clearance) 1rem 1.75rem;
    background-color: var(--bg-tertiary);
    overflow-x: clip;
}

@media (min-width: 768px) {
    .auth-page {
        flex-direction: row;
        overflow: visible;
        align-items: center;
        justify-content: center;
        gap: 2.5rem;
        padding: var(--landing-header-clearance) 2.5rem 1.75rem;
    }
}

@media (max-width: 767px) {
    .auth-page {
        --landing-header-clearance: 8.5rem;
    }
}

.auth-page__illustration {
    display: none;
    position: relative;
    z-index: 0;
    flex: 1 1 0;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    pointer-events: none;
}

@media (min-width: 768px) {
    .auth-page__illustration {
        display: flex;
    }
}

.auth-page__eepy {
    position: relative;
    z-index: 0;
    flex-shrink: 0;
    width: 17.875rem;
    aspect-ratio: 1 / 1;
    overflow: visible;
    pointer-events: none;
}

.auth-page__eepy-img {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    width: calc(2261 / 500 * 100%);
    height: calc(2486 / 500 * 100%);
    max-width: none;
    object-fit: cover;
    pointer-events: none;
    transform: translate(calc(-860 / 2261 * 100%), calc(-1200 / 2486 * 100%));
}

.auth-page__form-col {
    position: relative;
    z-index: 2;
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    gap: 2.5rem;
    align-items: stretch;
    justify-content: center;
    width: 100%;
    min-width: 0;
    max-width: none;
}

@media (min-width: 768px) {
    .auth-page__form-col {
        gap: 3rem;
        max-width: 37.5rem;
    }
}

.auth-page__head {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
}

.auth-page__title {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--fg-primary);
    font-family: var(--font-text);
    font-size: var(--text-3xl);
    font-weight: 500;
    line-height: 2rem;
    letter-spacing: 0.01em;
    text-overflow: ellipsis;
}

@media (min-width: 768px) {
    .auth-page__title {
        font-size: var(--text-4xl);
        line-height: 2rem;
    }
}

.auth-page__toggle.btn-group {
    flex-shrink: 0;
}

.auth-page__toggle .btn {
    min-width: 3.5rem;
    padding-inline: 1.25rem;
    white-space: nowrap;
}

.auth-page__stack {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.auth-page__lead {
    margin: 0;
    color: var(--fg-tertiary);
    font-family: var(--font-text);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.125rem;
}

.auth-card {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    box-sizing: border-box;
    width: 100%;
    padding: 1.25rem;
    border: 2px solid var(--border-secondary);
    border-radius: 1.25rem;
    background-color: var(--bg-secondary-alt);
}

.auth-card .account-input {
    gap: 0.625rem;
    padding-bottom: 1.25rem;
}

.auth-card .account-input__control {
    height: 2.5rem;
    min-height: 2.5rem;
    border-width: 1.5px;
    border-radius: 0.875rem;
}

.auth-card__row--end {
    justify-content: flex-end;
}

.auth-password-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-password-toggle__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
}

.auth-password-toggle__icon[hidden] {
    display: none !important;
}

.auth-card__footer {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 0.5rem;
}

.auth-card__submit.btn {
    flex-shrink: 0;
}

.auth-card__extras {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
    margin-top: 0.5rem;
}

.auth-card__row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.25rem;
    align-items: center;
    justify-content: space-between;
}

.auth-card__forgot {
    color: var(--fg-secondary);
    font-family: var(--font-text);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.125rem;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.auth-card__forgot:hover {
    color: var(--fg-primary);
}

.auth-card__legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
    color: var(--fg-tertiary);
    font-family: var(--font-text);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.125rem;
}

.auth-card__legal-link {
    color: var(--fg-brand-primary);
    text-decoration: underline;
    cursor: pointer;
}

.auth-password-hints {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-password-hints__item {
    display: flex;
    gap: 0.375rem;
    align-items: center;
    color: var(--fg-quaternary);
    font-family: var(--font-text);
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1rem;
    transition: color 0.15s ease;
}

.auth-password-hints--active .auth-password-hints__item:not(.auth-password-hints__item--passed):not(.auth-password-hints__item--failed) {
    color: var(--fg-quaternary);
}

.auth-password-hints__item--failed {
    color: var(--fg-error-primary);
}

.auth-password-hints__item--passed {
    color: var(--fg-success-primary);
}

.auth-password-hints__item--passed::before {
    content: '';
    flex-shrink: 0;
    width: 0.875rem;
    height: 0.875rem;
    border: 1.5px solid var(--border-success-primary);
    border-radius: 50%;
    background-color: var(--bg-success-primary);
    transition: background-color 0.15s ease, border-color 0.15s ease;
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="10" viewBox="0 0 14 10"><path fill-rule="evenodd" clip-rule="evenodd" d="M13.7071 1.70711C14.0976 1.31658 14.0976 0.683417 13.7071 0.292893C13.3166 -0.0976311 12.6834 -0.0976311 12.2929 0.292893L5 7.58579L1.70711 4.29289C1.31658 3.90237 0.683417 3.90237 0.292893 4.29289C-0.0976311 4.68342 -0.0976311 5.31658 0.292893 5.70711L4.29289 9.70711C4.68342 10.0976 5.31658 10.0976 5.70711 9.70711L13.7071 1.70711Z" fill="black"/></svg>');
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: 0.5rem 0.375rem;
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="10" viewBox="0 0 14 10"><path fill-rule="evenodd" clip-rule="evenodd" d="M13.7071 1.70711C14.0976 1.31658 14.0976 0.683417 13.7071 0.292893C13.3166 -0.0976311 12.6834 -0.0976311 12.2929 0.292893L5 7.58579L1.70711 4.29289C1.31658 3.90237 0.683417 3.90237 0.292893 4.29289C-0.0976311 4.68342 -0.0976311 5.31658 0.292893 5.70711L4.29289 9.70711C4.68342 10.0976 5.31658 10.0976 5.70711 9.70711L13.7071 1.70711Z" fill="black"/></svg>');
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: 0.5rem 0.375rem;
}

.auth-divider {
    margin: 0;
    color: var(--fg-tertiary);
    font-family: var(--font-text);
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1.125rem;
    letter-spacing: 0.01em;
    text-align: center;
}

.auth-google.btn {
    width: 100%;
}

.auth-google__icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
}

.auth-google__icon svg {
    display: block;
    width: 1.5rem;
    height: 1.5rem;
}

.auth-google__icon svg rect {
    display: none;
}

.auth-page--single {
    justify-content: center;
}

.auth-page--single .auth-page__form-col {
    max-width: 37.5rem;
    margin-inline: auto;
}

@media (max-width: 767px) {
    .auth-page {
        align-items: stretch;
    }

    .auth-page--single .auth-page__form-col {
        max-width: none;
    }

    .auth-page__head {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-page__toggle.btn-group {
        width: 100%;
    }

    .auth-page__toggle .btn {
        flex: 1 1 0;
    }

    .auth-card__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-card__footer .btn {
        width: 100%;
    }

    .auth-card__row {
        flex-direction: column;
        align-items: flex-start;
    }
}
