/* =========================================================
   Authentication Page
   ========================================================= */

.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(
            circle at top left,
            rgba(99, 91, 255, 0.10),
            transparent 34%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(20, 184, 166, 0.10),
            transparent 34%
        ),
        var(--background);
}


/* ---------------------------------------------------------
   Header
   --------------------------------------------------------- */

.auth-header {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;

    min-height: 78px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;

    color: var(--text);
    text-decoration: none;
}

.auth-brand-icon {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    border-radius: 14px;

    background: var(--primary);
    color: white;

    font-size: 1.35rem;

    box-shadow:
        0 8px 24px
        rgba(99, 91, 255, 0.22);
}

.auth-brand strong {
    display: block;
    font-size: 1rem;
    line-height: 1.2;
}

.auth-brand small {
    display: block;
    margin-top: 3px;

    color: var(--muted-text);

    font-size: 0.72rem;
}

.auth-home-link {
    color: var(--muted-text);
    text-decoration: none;

    font-size: 0.9rem;
    font-weight: 700;

    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.auth-home-link:hover {
    color: var(--primary);
    transform: translateX(-2px);
}


/* ---------------------------------------------------------
   Main
   --------------------------------------------------------- */

.auth-main {
    width: min(1080px, calc(100% - 40px));
    margin: 45px auto 70px;

    display: grid;
    grid-template-columns:
        minmax(360px, 480px)
        minmax(280px, 1fr);

    align-items: center;
    gap: 70px;
}


/* ---------------------------------------------------------
   Authentication card
   --------------------------------------------------------- */

.auth-card {
    padding: 38px;

    background: var(--surface);

    border:
        1px solid
        var(--border);

    border-radius: 28px;

    box-shadow:
        0 25px 70px
        rgba(15, 23, 42, 0.09);
}

.auth-intro {
    text-align: center;
}

.auth-logo {
    width: 58px;
    height: 58px;

    margin: 0 auto 18px;

    display: grid;
    place-items: center;

    border-radius: 18px;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--accent)
        );

    color: white;

    font-size: 1.6rem;

    box-shadow:
        0 12px 30px
        rgba(99, 91, 255, 0.22);
}

.auth-eyebrow {
    display: inline-block;

    color: var(--primary);

    font-size: 0.72rem;
    font-weight: 800;

    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.auth-intro h1 {
    margin: 8px 0 10px;

    font-size: clamp(1.8rem, 4vw, 2.3rem);

    letter-spacing: -0.03em;
}

.auth-intro p {
    max-width: 390px;

    margin: 0 auto;

    color: var(--muted-text);

    font-size: 0.94rem;
    line-height: 1.7;
}


/* ---------------------------------------------------------
   Message
   --------------------------------------------------------- */

.auth-message {
    margin-top: 24px;
    padding: 12px 14px;

    border-radius: 12px;

    font-size: 0.88rem;
    line-height: 1.5;
}

.auth-message.error {
    background: rgba(239, 68, 68, 0.09);
    color: #dc2626;

    border:
        1px solid
        rgba(239, 68, 68, 0.18);
}

.auth-message.success {
    background: rgba(20, 184, 166, 0.10);
    color: #0f766e;

    border:
        1px solid
        rgba(20, 184, 166, 0.18);
}


/* ---------------------------------------------------------
   Tabs
   --------------------------------------------------------- */

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 5px;

    margin-top: 30px;
    padding: 5px;

    background: var(--surface-soft);

    border-radius: 14px;
}

.auth-tab {
    min-height: 42px;

    border: 0;
    border-radius: 10px;

    background: transparent;

    color: var(--muted-text);

    font: inherit;
    font-size: 0.88rem;
    font-weight: 800;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

.auth-tab.active {
    background: var(--surface);

    color: var(--text);

    box-shadow:
        0 3px 10px
        rgba(15, 23, 42, 0.08);
}

.auth-tab:hover:not(.active) {
    color: var(--primary);
}


/* ---------------------------------------------------------
   Forms
   --------------------------------------------------------- */

.auth-form {
    margin-top: 26px;
}

.form-field {
    margin-bottom: 18px;
}

.form-field label {
    display: block;

    margin-bottom: 7px;

    color: var(--text);

    font-size: 0.83rem;
    font-weight: 800;
}

.form-field input {
    width: 100%;
    min-height: 48px;

    padding: 0 14px;

    border:
        1px solid
        var(--border);

    border-radius: 12px;

    background: var(--background);

    color: var(--text);

    font: inherit;
    font-size: 0.92rem;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.form-field input::placeholder {
    color: var(--muted-text);
    opacity: 0.7;
}

.form-field input:focus {
    border-color: var(--primary);

    background: var(--surface);

    box-shadow:
        0 0 0 4px
        rgba(99, 91, 255, 0.10);
}

.form-field input:invalid:not(:placeholder-shown) {
    border-color:
        rgba(239, 68, 68, 0.55);
}


/* ---------------------------------------------------------
   Submit
   --------------------------------------------------------- */

.auth-submit-button {
    width: 100%;
    min-height: 50px;

    margin-top: 4px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    border: 0;
    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            #766dff
        );

    color: white;

    font: inherit;
    font-weight: 800;

    cursor: pointer;

    box-shadow:
        0 10px 25px
        rgba(99, 91, 255, 0.20);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
}

.auth-submit-button:hover:not(:disabled) {
    transform: translateY(-1px);

    box-shadow:
        0 14px 30px
        rgba(99, 91, 255, 0.26);
}

.auth-submit-button:active:not(:disabled) {
    transform: translateY(0);
}

.auth-submit-button:disabled {
    opacity: 0.7;
    cursor: wait;
}

.button-spinner {
    width: 17px;
    height: 17px;

    display: none;

    border:
        2px solid
        rgba(255, 255, 255, 0.4);

    border-top-color: white;

    border-radius: 50%;

    animation:
        auth-spin 0.7s linear infinite;
}

.auth-submit-button.loading .button-spinner {
    display: block;
}

.auth-submit-button.loading .button-label {
    opacity: 0.85;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}


/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */

.auth-footer {
    margin-top: 24px;
    padding-top: 20px;

    border-top:
        1px solid
        var(--border);

    text-align: center;
}

.auth-footer p {
    margin: 0;

    color: var(--muted-text);

    font-size: 0.74rem;
    line-height: 1.6;
}


/* ---------------------------------------------------------
   Benefits
   --------------------------------------------------------- */

.auth-benefits {
    padding: 20px 0;
}

.benefits-heading h2 {
    max-width: 480px;

    margin: 9px 0 12px;

    font-size: clamp(1.9rem, 4vw, 2.7rem);

    line-height: 1.1;

    letter-spacing: -0.035em;
}

.benefits-heading p {
    max-width: 500px;

    margin: 0;

    color: var(--muted-text);

    line-height: 1.75;
}

.benefit-list {
    margin-top: 34px;

    display: grid;

    gap: 20px;
}

.benefit-item {
    display: flex;
    align-items: flex-start;

    gap: 15px;
}

.benefit-icon {
    flex: 0 0 auto;

    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border-radius: 12px;

    background:
        rgba(20, 184, 166, 0.11);

    color: var(--accent);

    font-weight: 900;
}

.benefit-item h3 {
    margin: 1px 0 4px;

    font-size: 0.98rem;
}

.benefit-item p {
    margin: 0;

    color: var(--muted-text);

    font-size: 0.87rem;
    line-height: 1.6;
}


/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 850px) {

    .auth-main {
        grid-template-columns: 1fr;

        max-width: 560px;

        gap: 35px;
    }

    .auth-benefits {
        text-align: center;
    }

    .benefits-heading p {
        margin-left: auto;
        margin-right: auto;
    }

    .benefit-item {
        text-align: left;
    }
}


@media (max-width: 560px) {

    .auth-header {
        width: min(100% - 28px, 520px);

        min-height: 68px;
    }

    .auth-brand small {
        display: none;
    }

    .auth-home-link {
        font-size: 0.8rem;
    }

    .auth-main {
        width: min(100% - 28px, 520px);

        margin-top: 20px;
        margin-bottom: 40px;
    }

    .auth-card {
        padding: 25px 20px;

        border-radius: 22px;
    }

    .auth-benefits {
        padding: 0 4px;
    }

    .benefits-heading h2 {
        font-size: 1.8rem;
    }
}