/* ===== Auth modals — split layout (Webrace purple) ===== */

.auth-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(4, 4, 6, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.auth-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.auth-modal {
    position: relative;
    width: min(920px, 100%);
    max-height: min(640px, calc(100vh - 48px));
    border-radius: 24px;
    overflow: hidden;
    background: #121218;
    border: 1px solid rgba(147, 51, 234, 0.35);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 60px rgba(147, 51, 234, 0.12);
    transform: scale(0.96) translateY(12px);
    transition: transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.auth-modal-overlay.is-open .auth-modal {
    transform: scale(1) translateY(0);
}

.auth-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.auth-modal__close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.auth-modal__panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 520px;
}

.auth-modal__form-side {
    position: relative;
    padding: 40px 36px 32px;
    background: #14141a;
}

.auth-modal__pane {
    display: none;
    animation: authPaneIn 0.22s ease;
}

.auth-modal__pane.is-active {
    display: block;
}

@keyframes authPaneIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

.auth-modal__title {
    margin: 0 0 28px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
}

.auth-modal__error {
    margin: -16px 0 20px;
    padding: 10px 12px;
    font-size: 13px;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.auth-modal__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-field {
    position: relative;
    display: block;
}

.auth-field__icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #9333ea;
    opacity: 0.85;
    pointer-events: none;
    transition: color 0.18s, opacity 0.18s;
}

.auth-field:focus-within .auth-field__icon {
    color: #c084fc;
    opacity: 1;
}

.auth-field__icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.auth-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 15px 16px 15px 48px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.auth-field input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.auth-field input:focus {
    border-color: #9333ea;
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.2);
}

.auth-modal__terms {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
}

.auth-modal__terms input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    accent-color: var(--purple, #9333ea);
    cursor: pointer;
}

.auth-modal__submit {
    margin-top: 6px;
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 45%, #7c3aed 100%);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(147, 51, 234, 0.35);
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.auth-modal__submit:hover {
    filter: brightness(1.06);
    box-shadow: 0 10px 28px rgba(147, 51, 234, 0.45);
    transform: translateY(-1px);
}

.auth-modal__submit:active {
    transform: translateY(0);
}

.auth-modal__switch {
    margin: 22px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    text-align: left;
}

.auth-modal__link {
    padding: 0;
    border: none;
    background: none;
    color: #c084fc;
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s;
}

.auth-modal__link:hover {
    color: #e9d5ff;
    text-decoration: underline;
}

a.auth-modal__link:hover {
    text-decoration: underline;
}

/* Visual panel */
.auth-modal__visual-side {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    overflow: hidden;
    background: linear-gradient(145deg, #9333ea 0%, #7c3aed 42%, #6d28d9 100%);
}

.auth-modal__visual-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.14;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23fff' fill-opacity='1'%3E%3Cpath d='M20 18h12v12H20zM58 18h12v12H58zM96 18h12v12H96zM39 39h12v12H39zM77 39h12v12H77zM20 60h12v12H20zM58 60h12v12H58zM96 60h12v12H96zM39 81h12v12H39zM77 81h12v12H77z'/%3E%3Ccircle cx='26' cy='24' r='4'/%3E%3Ccircle cx='64' cy='45' r='4'/%3E%3Ccircle cx='102' cy='66' r='4'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 120px 120px;
}

.auth-modal__mascot {
    position: relative;
    z-index: 1;
    width: min(260px, 85%);
    height: auto;
    filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.25));
    animation: authMascotFloat 4s ease-in-out infinite;
}

@keyframes authMascotFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.auth-modal__brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
}

.auth-modal__brand-logo svg {
    width: 22px;
    height: 22px;
    display: block;
}

.auth-modal__brand-name {
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: #fff;
}

body.auth-modal-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .auth-modal__panels {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .auth-modal__visual-side {
        display: none;
    }

    .auth-modal__form-side {
        padding: 36px 24px 28px;
    }

    .auth-modal {
        max-height: calc(100vh - 32px);
        max-height: calc(100dvh - 32px);
        overflow-y: auto;
    }
}

@media (max-width: 480px) {
    .auth-modal__form-side {
        padding: 24px 16px 20px;
    }

    .auth-modal {
        max-height: calc(100dvh - 16px);
        border-radius: 16px;
    }
}
