/*
 * Tabpia account pages
 * Shared by login, registration, forgotten-password and reset-password screens.
 * Designed for full desktop windows, mobile screens and the extension popup.
 */

.auth-page {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--tp-text);
    background: var(--tp-bg);
}

.auth-page__background {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 18%, rgba(91, 108, 251, .20), transparent 31%),
        radial-gradient(circle at 88% 78%, rgba(0, 194, 171, .14), transparent 30%),
        linear-gradient(145deg, var(--tp-surface), var(--tp-bg));
}

.auth-page__layout {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-page__main {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(28px, 5vw, 72px) 24px 28px;
}

.auth-page .auth-section {
    width: min(100%, 430px);
    padding: 0;
    background: transparent;
}

.auth-page .auth-section__inner {
    width: 100%;
}

.auth-page .auth-card {
    width: 100%;
    padding: clamp(24px, 4vw, 34px);
    border: 1px solid var(--tp-border);
    border-radius: 24px;
    background: color-mix(in srgb, var(--tp-surface) 94%, transparent);
    box-shadow: var(--tp-shadow-md);
    backdrop-filter: blur(18px);
}

.auth-page .auth-logo {
    display: flex;
    justify-content: center;
    margin: 0 0 20px;
}

.auth-page .auth-logo img {
    width: auto;
    height: 43px;
    max-width: 190px;
    object-fit: contain;
}

.auth-page .auth-card h2 {
    margin: 0 0 7px;
    text-align: center;
    font-size: 27px;
    letter-spacing: -.03em;
}

.auth-page .auth-card > p {
    margin: 0 0 20px;
    color: var(--tp-muted);
    text-align: center;
    line-height: 1.55;
}

.auth-page .auth-form label {
    display: block;
    margin: 13px 0 7px;
    color: var(--tp-text);
    font-size: 14px;
    font-weight: 800;
}

.auth-page .auth-form input {
    width: 100%;
    min-height: 46px;
    margin: 0 0 7px;
    padding: 0 14px;
    border: 1px solid var(--tp-border);
    border-radius: 12px;
    outline: none;
    color: var(--tp-text);
    background: var(--tp-surface-soft);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.auth-page .auth-form input:focus {
    border-color: var(--tp-primary);
    background: var(--tp-surface);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--tp-primary) 15%, transparent);
}

.auth-page .auth-form .tp-btn {
    min-height: 47px;
    margin-top: 13px;
}

.auth-page .auth-divider {
    margin: 20px 0;
}

.auth-page .auth-foot {
    margin-top: 19px;
    line-height: 1.5;
}

.auth-page .auth-foot a {
    white-space: nowrap;
}

.auth-page .dev-reset-link {
    margin-top: 18px;
    padding: 13px 14px;
    overflow-wrap: anywhere;
    border: 1px solid var(--tp-border);
    border-radius: 12px;
    color: var(--tp-text-soft);
    background: var(--tp-surface-soft);
    font-size: 13px;
    line-height: 1.55;
}

.auth-page__footer {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px 20px;
    color: var(--tp-muted);
    font-size: 13px;
}

.auth-page__footer a {
    color: var(--tp-text-soft);
    font-weight: 700;
}

/* Toasts stay usable without the full site header. */
.auth-page .tp-toast-wrap {
    position: fixed;
    z-index: 1000;
    right: 24px;
    bottom: 24px;
    width: min(390px, calc(100% - 36px));
}


@media (max-width: 680px) {
    .auth-page .tp-toast-wrap {
        right: 16px;
        bottom: 16px;
        left: 16px;
        width: auto;
    }
}

/* Extension popup and narrow browser windows. */
@media (max-width: 760px) {
    .auth-page__main {
        align-items: flex-start;
        padding: 22px 18px 16px;
    }

    .auth-page .auth-section {
        width: min(100%, 480px);
        margin: 0 auto;
    }


    .auth-page .auth-card {
        padding: 24px;
        border-radius: 20px;
    }

    .auth-page .auth-logo {
        margin-bottom: 17px;
    }

    .auth-page .auth-logo img {
        height: 39px;
    }

    .auth-page .auth-card h2 {
        font-size: 25px;
    }

    .auth-page .auth-card > p {
        margin-bottom: 17px;
        font-size: 14px;
    }

    .auth-page .auth-divider {
        margin: 16px 0;
    }

    .auth-page__footer {
        padding-bottom: 16px;
    }
}

@media (max-width: 420px) {
    .auth-page__main {
        padding-right: 12px;
        padding-left: 12px;
    }

    .auth-page .auth-card {
        padding: 21px 18px;
        border-radius: 18px;
    }

    .auth-page .auth-foot {
        align-items: center;
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-height: 700px) and (max-width: 760px) {
    .auth-page__main {
        padding-top: 14px;
    }

    .auth-page .auth-card {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .auth-page .auth-logo {
        margin-bottom: 13px;
    }

    .auth-page .auth-logo img {
        height: 36px;
    }

    .auth-page .auth-card > p {
        margin-bottom: 13px;
    }

    .auth-page .auth-divider {
        margin: 13px 0;
    }

    .auth-page .auth-form label {
        margin-top: 9px;
    }

    .auth-page .auth-form input {
        min-height: 43px;
    }

    .auth-page__footer {
        min-height: 42px;
        padding-top: 8px;
        padding-bottom: 10px;
    }
}

/* v4 layout correction: keep the authentication card at a stable usable width. */
.auth-page,
.auth-page * {
    box-sizing: border-box;
}

.auth-page {
    min-width: 0;
}

.auth-page__main {
    min-width: 0;
}

.auth-page .auth-section {
    display: block;
    flex: 0 1 430px;
    width: 100%;
    max-width: 430px;
    min-width: 0;
    margin: 0 auto;
}

.auth-page .auth-section__inner {
    display: block;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.auth-page .auth-card {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: none;
}

.auth-page .auth-logo,
.auth-page .auth-card h2,
.auth-page .auth-card > p,
.auth-page .auth-form,
.auth-page .auth-divider,
.auth-page .auth-foot {
    width: 100%;
    min-width: 0;
}

@media (max-width: 520px) {
    .auth-page__main {
        padding: 16px 14px 12px;
    }

    .auth-page .auth-section {
        flex-basis: auto;
        max-width: 100%;
    }

    .auth-page .auth-card {
        padding: 22px 18px;
    }
}

@media (max-width: 320px) {
    .auth-page__main {
        padding-right: 8px;
        padding-left: 8px;
    }

    .auth-page .auth-card {
        padding-right: 14px;
        padding-left: 14px;
        border-radius: 16px;
    }

    .auth-page .auth-logo img {
        max-width: 150px;
        height: auto;
    }
}

/* Step 8.3A fix2: verification-pending status state */
.auth-page .auth-verification-status {
    display: grid;
    gap: 8px;
    margin: 22px 0;
    padding: 16px 18px;
    border: 1px solid var(--border-color, #dfe3e8);
    border-radius: 12px;
    text-align: left;
}

.auth-page .auth-verification-status strong {
    font-size: 15px;
}

.auth-page .auth-verification-status span {
    font-size: 14px;
    line-height: 1.55;
}

.auth-page .auth-form--secondary {
    margin-top: 8px;
}
