/* Auth page — synced from backup inline (login.html) */

/* ── Auth Page — always fits viewport ── */
    .auth-page {
        background: linear-gradient(160deg, #f8fafc 0%, #e3ebf2 50%, #f3eff4 100%);
    }

    .auth-card {
        animation: authIn 0.35s ease;
    }

    @keyframes authIn {
        from {
            opacity: 0;
            transform: translateY(16px) scale(0.98);
        }

        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    /* ── Header ── */
    .auth-card-header {
        padding: 1rem 1.6rem;
        text-align: center;
        background: var(--color-primary);
        color: white;
        flex-shrink: 0;
    }

    .auth-brand {
        margin: 0;
        font-size: 1.6rem;
        font-weight: 700;
        font-family: var(--font-heading);
        letter-spacing: 0.25em;
        color: white;
    }

    /* ── Body ── */
    .auth-card-body {
        padding: 1.1rem 1.6rem;
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .auth-panels-scroll {
        flex: 1;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        margin: 0 -0.35rem;
        padding: 0 0.35rem 0.15rem;
        scrollbar-gutter: stable;
        scrollbar-width: thin;
        scrollbar-color: rgba(73, 98, 117, 0.42) rgba(73, 98, 117, 0.06);
    }

    .auth-panels-scroll::-webkit-scrollbar {
        width: 7px;
    }

    .auth-panels-scroll::-webkit-scrollbar-track {
        background: rgba(73, 98, 117, 0.06);
        border-radius: 999px;
        margin: 6px 0;
    }

    .auth-panels-scroll::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg, rgba(73, 98, 117, 0.28), rgba(73, 98, 117, 0.52));
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.35);
    }

    .auth-panels-scroll::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(180deg, rgba(73, 98, 117, 0.42), rgba(73, 98, 117, 0.68));
    }

    .auth-tabs {
        flex-shrink: 0;
        display: flex;
        gap: 6px;
        margin-bottom: 0.8rem;
    }

    .auth-tab {
        flex: 1;
        padding: 0.5rem 0.6rem;
        font-size: 0.82rem;
        font-weight: 600;
        font-family: var(--font-heading);
        border: 2px solid var(--color-gray-light);
        border-radius: var(--radius-lg);
        background: var(--color-white);
        color: var(--color-gray-dark);
        cursor: pointer;
        transition: all 0.2s;
        text-align: center;
    }

    .auth-tab:hover {
        border-color: var(--color-primary);
        color: var(--color-primary);
    }

    .auth-tab.is-active {
        background: var(--color-primary);
        color: #fff;
        border-color: transparent;
        box-shadow: var(--shadow-sm);
    }

    .auth-tab.is-active:hover {
        color: #fff;
    }

    /* ── Form ── */
    .auth-form {
        display: flex;
        flex-direction: column;
        gap: 0.7rem;
    }

    .auth-field {
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
    }

    .auth-field label:not(.auth-legal-label) {
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--color-dark);
    }

    .auth-field input:not([type="checkbox"]) {
        width: 100%;
        padding: 0.55rem 0.8rem;
        border: 2px solid var(--color-gray-light);
        border-radius: var(--radius-lg);
        font-family: var(--font-body);
        font-size: 0.88rem;
        min-height: 2.65rem;
        transition: border-color 0.2s, box-shadow 0.2s;
        box-sizing: border-box;
    }

    .auth-field input:not([type="checkbox"]):focus {
        outline: none;
        border-color: var(--color-primary);
        box-shadow: 0 0 0 3px rgba(73, 98, 117, 0.1);
    }

    .auth-field input:not([type="checkbox"]).is-invalid {
        border-color: var(--color-error, #dc3545);
        box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
    }

    .auth-field input:not([type="checkbox"]).is-invalid:focus {
        border-color: var(--color-error, #dc3545);
        box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.18);
    }

    .auth-field .form-error.auth-pw-live-error {
        margin-top: 0.15rem;
        line-height: 1.35;
    }

    .auth-field-row {
        display: flex;
        align-items: center;
        gap: 0.4rem;
    }

    .auth-field-row input[type="checkbox"] {
        width: 15px;
        height: 15px;
        accent-color: var(--color-primary);
    }

    .auth-field-row label {
        font-size: 0.8rem;
        font-weight: 500;
        color: var(--color-dark-secondary);
        cursor: pointer;
    }

    .auth-field .form-error {
        color: var(--color-error);
        font-size: 0.75rem;
    }

    /* ── Button ── */
    .auth-submit {
        width: 100%;
        padding: 0.6rem;
        font-size: 0.92rem;
        font-weight: 600;
        font-family: var(--font-heading);
        border-radius: var(--radius-lg);
        border: none;
        cursor: pointer;
        background: var(--color-primary);
        color: white;
        box-shadow: var(--shadow-md);
        transition: all 0.2s;
        margin-top: 0.15rem;
    }

    .auth-submit:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }

    .auth-submit:disabled,
    .auth-submit:disabled:hover {
        opacity: 0.55;
        cursor: not-allowed;
        transform: none;
        box-shadow: var(--shadow-md);
    }

    .auth-pw-hint {
        font-size: 0.624rem;
        line-height: 1.4;
        color: var(--color-text-muted, #64748b);
    }

    .auth-forgot-link {
        font-size: 0.64rem;
        color: var(--color-primary);
        margin-top: 0.2rem;
        display: inline-block;
    }

    .auth-field--legal {
        gap: 0;
    }

    .auth-legal-label {
        display: flex;
        align-items: center;
        gap: 0.45rem;
        margin: 0;
        padding: 0;
        cursor: pointer;
        font-size: 0.8rem;
        font-weight: 400;
        line-height: 1.35;
        color: var(--color-dark-secondary);
    }

    .auth-legal-label input[type="checkbox"] {
        width: 16px;
        height: 16px;
        min-width: 16px;
        min-height: 16px;
        margin: 0;
        padding: 0;
        border: none;
        flex-shrink: 0;
        accent-color: var(--color-primary);
    }

    .zc-honeypot {
        position: absolute;
        left: -9999px;
        width: 1px;
        height: 1px;
        opacity: 0;
        pointer-events: none;
    }

    .zc-puzzle {
        margin: 0.5rem 0 0.35rem;
    }

    .zc-puzzle-hint {
        margin: 0 0 0.45rem;
        font-size: 0.82rem;
        color: var(--color-gray, #666);
        line-height: 1.35;
    }

    .zc-puzzle-scroll {
        overflow-x: hidden;
        margin-bottom: 0.35rem;
    }

    .zc-puzzle-inner {
        width: 100%;
        max-width: 100%;
    }

    .zc-puzzle-stage {
        position: relative;
        width: 100%;
        max-width: 100%;
        line-height: 0;
        overflow: hidden;
        border-radius: var(--radius-lg, 8px);
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
    }

    .zc-puzzle-bgimg {
        display: block;
        width: 100%;
        height: auto;
        vertical-align: top;
        border-radius: var(--radius-lg, 8px);
    }

    .zc-puzzle-controls {
        width: 100%;
        max-width: 100%;
        margin-top: 0.4rem;
        position: relative;
        z-index: 1;
    }

    .zc-puzzle-floating {
        position: absolute;
        left: 0;
        pointer-events: none;
        z-index: 2;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    }

    .zc-puzzle-range {
        width: 100%;
        accent-color: var(--color-primary, #7c4dff);
    }

    .zc-puzzle-hint-foot {
        margin: 0.35rem 0 0;
        font-size: 0.72rem;
        line-height: 1.35;
        color: var(--color-gray-dark-secondary, #555);
    }

    /* ── OAuth ── */
    .auth-oauth {
        margin-top: 0.8rem;
        text-align: center;
        flex-shrink: 0;
        padding-top: 0.75rem;
        border-top: 1px solid var(--color-gray-light);
    }

    .auth-oauth-label {
        display: block;
        color: var(--color-gray);
        font-size: 0.72rem;
        margin-bottom: 0.5rem;
    }

    .auth-oauth-icons {
        display: flex;
        justify-content: center;
        gap: 0.45rem;
    }

    .auth-oauth-icon {
        width: 34px;
        height: 34px;
        min-width: 34px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
        text-decoration: none;
    }

    .auth-oauth-icon svg {
        width: 16px;
        height: 16px;
    }

    .auth-oauth-icon:hover {
        transform: translateY(-2px);
    }

    .oa-google {
        background: #fff;
        border: 2px solid var(--color-gray-light);
    }

    .oa-google:hover {
        border-color: #4285F4;
        box-shadow: 0 3px 10px rgba(66, 133, 244, 0.25);
    }

    .oa-vk {
        background: #4680C2;
        color: white;
    }

    .oa-vk:hover {
        box-shadow: 0 3px 10px rgba(70, 128, 194, 0.4);
    }

    .oa-yandex {
        background: #FC3F1D;
        color: white;
    }

    .oa-yandex:hover {
        box-shadow: 0 3px 10px rgba(252, 63, 29, 0.4);
    }

    .oa-facebook {
        background: #1877F2;
        color: white;
    }

    .oa-facebook:hover {
        box-shadow: 0 3px 10px rgba(24, 119, 242, 0.4);
    }

    .oa-telegram {
        background: #0088cc;
        color: white;
    }

    .oa-telegram:hover {
        box-shadow: 0 3px 10px rgba(0, 136, 204, 0.4);
    }

    .oa-ok {
        background: #EE8208;
        color: white;
    }

    .oa-ok:hover {
        box-shadow: 0 3px 10px rgba(238, 130, 8, 0.4);
    }

    /* ── Footer ── */
    .auth-card-footer {
        text-align: center;
        padding: 0.65rem 1.6rem;
        background: var(--color-light);
        border-top: 1px solid var(--color-gray-light);
        flex-shrink: 0;
    }

    .auth-card-footer a {
        color: var(--color-primary);
        font-weight: 600;
        text-decoration: none;
        font-size: 0.85rem;
    }

    .auth-card-footer a:hover {
        text-decoration: underline;
    }

    .auth-card-footer .back-link {
        display: block;
        margin-top: 0.25rem;
        color: var(--color-gray);
        font-weight: 400;
        font-size: 0.78rem;
    }

    .auth-card-footer .back-link:hover {
        color: var(--color-primary);
    }

    /* ── Alerts ── */
    .auth-alert {
        padding: 0.5rem 0.8rem;
        border-radius: var(--radius-lg);
        margin-bottom: 0.6rem;
        font-size: 0.8rem;
    }

    .auth-alert-success {
        background: #d4edda;
        color: #155724;
        border: 1px solid #c3e6cb;
    }

    .auth-alert-danger {
        background: #f8d7da;
        color: #721c24;
        border: 1px solid #f5c6cb;
    }

    .auth-alert-info {
        background: #d1ecf1;
        color: #0c5460;
        border: 1px solid #bee5eb;
    }

    .auth-alert-warning {
        background: #fff3cd;
        color: #856404;
        border: 1px solid #ffeaa7;
    }

    .oa-whatsapp {
        background: #25D366;
        color: white;
    }

    .oa-whatsapp:hover {
        box-shadow: 0 3px 10px rgba(37, 211, 102, 0.45);
    }

    button.auth-oauth-icon.oa-telegram,
    button.auth-oauth-icon.oa-whatsapp {
        border: none;
        cursor: pointer;
        padding: 0;
        font: inherit;
    }

    .auth-wa-modal-overlay,
    .auth-tg-modal-overlay,
    .auth-captcha-modal-overlay {
        position: fixed;
        inset: 0;
        z-index: 12000;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 1rem;
        background: rgba(15, 23, 42, 0.55);
        backdrop-filter: blur(4px);
    }

    .auth-wa-modal-overlay.is-open,
    .auth-tg-modal-overlay.is-open,
    .auth-captcha-modal-overlay.is-open {
        display: flex;
    }

    .auth-wa-modal,
    .auth-tg-modal {
        position: relative;
        width: min(100%, 380px);
        max-height: min(92vh, 560px);
        overflow: auto;
        padding: 1.35rem 1.25rem 1.25rem;
        border-radius: var(--radius-xl, 16px);
        background: #fff;
        box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
        text-align: center;
    }

    .auth-wa-modal__close,
    .auth-tg-modal__close {
        position: absolute;
        top: 0.55rem;
        right: 0.65rem;
        width: 2rem;
        height: 2rem;
        border: none;
        border-radius: 50%;
        background: #f1f5f9;
        color: #64748b;
        font-size: 1.1rem;
        line-height: 1;
        cursor: pointer;
    }

    .auth-wa-modal__close:hover,
    .auth-tg-modal__close:hover {
        background: #e2e8f0;
        color: #334155;
    }

    .auth-wa-modal__icon {
        width: 52px;
        height: 52px;
        margin: 0 auto 0.65rem;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #ecfdf5;
        color: #25D366;
    }

    .auth-tg-modal__icon {
        width: 52px;
        height: 52px;
        margin: 0 auto 0.65rem;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #eff6ff;
        color: #0088cc;
    }

    .auth-wa-modal__title,
    .auth-tg-modal__title {
        margin: 0 0 0.55rem;
        font-size: 1.15rem;
        font-weight: 700;
        color: #0f172a;
    }

    .auth-wa-modal__body,
    .auth-tg-modal__body {
        margin: 0 0 1rem;
        font-size: 0.86rem;
        line-height: 1.5;
        color: #475569;
        text-align: left;
    }

    .auth-wa-modal__qr-wrap,
    .auth-tg-modal__qr-wrap {
        display: none;
        margin: 0 auto 0.85rem;
        padding: 0.65rem;
        border-radius: var(--radius-lg, 12px);
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        width: fit-content;
    }

    .auth-wa-modal__qr-hint,
    .auth-tg-modal__qr-hint {
        margin: 0.45rem 0 0;
        font-size: 0.72rem;
        color: #64748b;
        line-height: 1.35;
    }

    @media (min-width: 768px) {
        .auth-wa-modal__qr-wrap.is-visible,
        .auth-tg-modal__qr-wrap.is-visible {
            display: block;
        }
    }

    .auth-wa-modal__open,
    .auth-tg-modal__open {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.45rem;
        width: 100%;
        padding: 0.72rem 1rem;
        border-radius: var(--radius-lg, 12px);
        color: #fff;
        font-weight: 700;
        font-size: 0.9rem;
        text-decoration: none;
        border: none;
        cursor: pointer;
    }

    .auth-wa-modal__open {
        background: #25D366;
    }

    .auth-wa-modal__open:hover {
        background: #1ebe5d;
        color: #fff;
    }

    .auth-tg-modal__open {
        background: #0088cc;
    }

    .auth-tg-modal__open:hover {
        background: #0077b5;
        color: #fff;
    }

    .auth-captcha-modal {
        position: relative;
        width: min(100%, 420px);
        max-height: min(92vh, 640px);
        overflow: auto;
        padding: 1.35rem 1.25rem 1.15rem;
        border-radius: var(--radius-xl, 16px);
        background: #fff;
        box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
    }

    .auth-captcha-modal__close {
        position: absolute;
        top: 0.55rem;
        right: 0.65rem;
        width: 2rem;
        height: 2rem;
        border: none;
        border-radius: 50%;
        background: #f1f5f9;
        color: #64748b;
        font-size: 1.1rem;
        line-height: 1;
        cursor: pointer;
    }

    .auth-captcha-modal__close:hover {
        background: #e2e8f0;
        color: #334155;
    }

    .auth-captcha-modal__title {
        margin: 0 2rem 0.85rem 0;
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--color-text, #1e293b);
        line-height: 1.35;
    }

    .auth-captcha-modal .zc-puzzle {
        margin-bottom: 0.75rem;
    }

    .auth-captcha-modal__confirm {
        width: 100%;
        margin-top: 0.15rem;
        padding: 0.72rem 1rem;
        border: none;
        border-radius: var(--radius-lg, 10px);
        background: var(--color-primary, #7c4dff);
        color: #fff;
        font-size: 0.92rem;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.15s, transform 0.1s;
    }

    .auth-captcha-modal__confirm:hover {
        filter: brightness(1.06);
    }

    .auth-captcha-modal__confirm:active {
        transform: scale(0.99);
    }

    /* ── Mobile (доп. к auth-pages.css) ── */
    @media (max-width: 480px) {
        .auth-card-header {
            padding: 0.9rem 1.2rem 0.7rem;
        }

        .auth-card-header h1 {
            font-size: 1.15rem;
        }

        .auth-card-body {
            padding: 0.9rem 1.2rem;
        }

        .auth-card-footer {
            padding: 0.5rem 1.2rem;
        }
    }

    /* ── Very short screens ── */
    @media (max-height: 600px) {
        .auth-card-header {
            padding: 0.7rem 1.2rem 0.5rem;
        }

        .auth-card-header h1 {
            font-size: 1.1rem;
        }

        .auth-card-header p {
            font-size: 0.72rem;
        }

        .auth-card-body {
            padding: 0.7rem 1.2rem;
        }

        .auth-form {
            gap: 0.55rem;
        }

        .auth-oauth {
            margin-top: 0.5rem;
            padding-top: 0.6rem;
        }

        .auth-oauth-icon {
            width: 30px;
            height: 30px;
            min-width: 30px;
        }

        .auth-card-footer {
            padding: 0.4rem 1rem;
        }
    }
