﻿/* =========================================================
   AUTH (login/register)
   ========================================================= */
.auth-wrap {
    padding: 48px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    border-radius: 18px;
    border: 1px solid #202a3d;
    background: linear-gradient(180deg,#121827,#0f141f);
    box-shadow: 0 18px 60px rgba(0,0,0,.45);
    padding: 28px 24px;
    position: relative;
    overflow: hidden;
}

    .auth-card::before {
        content: "";
        position: absolute;
        inset: -2px;
        border-radius: inherit;
        background: conic-gradient(from 180deg at 50% 50%, #67e8f9, #a78bfa, #67e8f9);
        filter: blur(16px);
        opacity: .16;
        z-index: 0;
    }

    .auth-card > * {
        position: relative;
        z-index: 1;
    }

    .auth-card .pane-header {
        margin-bottom: 22px;
    }

    .auth-card .pane-title {
        margin: 4px 0 4px;
        font-weight: 800;
        font-size: clamp(26px,4vw,34px);
        background: linear-gradient(135deg, var(--accent1), var(--accent2));
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }

    .auth-card .pane-subtle {
        color: #9aa4b2;
        font-size: .95rem;
    }

.badge-mini {
    display: inline-block;
    font-size: .8rem;
    color: #9aa4b2;
    border: 1px solid #1f2738;
    border-radius: 999px;
    padding: 4px 10px;
}

.auth-title {
    margin: 10px 0 6px;
    font-weight: 800;
    font-size: clamp(28px,4vw,36px);
    background: linear-gradient(135deg, var(--accent1), var(--accent2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-sub {
    color: #9aa4b2;
    margin-bottom: 18px;
}

.auth-card {
    border-radius: 32px;
    padding: 30px 26px;
    background: radial-gradient(circle at top left, rgba(31,94,255,.14), transparent 28%), radial-gradient(circle at top right, rgba(79,140,255,.10), transparent 32%), linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
}

    .auth-card::before {
        background: conic-gradient(from 180deg at 50% 50%, rgba(31,94,255,.55), rgba(79,140,255,.40), rgba(31,94,255,.55));
        opacity: .10;
    }

    .auth-card .pane-title,
    .auth-title {
        background: linear-gradient(135deg, #dbe8ff 0%, #8ab4ff 38%, #4f8cff 68%, #1f5eff 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }

html[data-bs-theme="light"] .auth-card .pane-title,
html[data-bs-theme="light"] .auth-title {
    background: linear-gradient(135deg, #0f2f7a 0%, #174ee6 32%, #2f67ef 62%, #5b8cff 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* LIGHT AUTH */
html[data-bs-theme="light"] .auth-card {
    border-color: var(--border);
    background: linear-gradient(180deg,#ffffff,#f6f8fc);
    box-shadow: 0 18px 60px rgba(15,23,42,.12);
}

    html[data-bs-theme="light"] .auth-card::before {
        opacity: .10;
    }

    html[data-bs-theme="light"] .auth-card .pane-subtle,
    html[data-bs-theme="light"] .auth-sub,
    html[data-bs-theme="light"] .badge-mini {
        color: #64748b;
    }

html[data-bs-theme="light"] .badge-mini {
    border-color: var(--border);
    background: rgba(15,23,42,.02);
}

/* Login notification */
#notification-div {
    transition: transform .15s ease;
}

    #notification-div.shake {
        animation: shake .45s ease;
    }

/* LOGIN SUBMIT BUTTON + SPINNER */
#loginForm #submitBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    line-height: 1.1;
}

    #loginForm #submitBtn .btn-spinner {
        width: 1.15rem;
        height: 1.15rem;
        min-width: 1.15rem;
        min-height: 1.15rem;
        flex: 0 0 auto;
        aspect-ratio: 1 / 1;
        border-width: .16em;
    }

@keyframes shake {
    10%,90% {
        transform: translateX(-1px);
    }

    20%,80% {
        transform: translateX(2px);
    }

    30%,50%,70% {
        transform: translateX(-4px);
    }

    40%,60% {
        transform: translateX(4px);
    }
}

.auth-card-registration {
    max-width: 980px;
    width: min(980px, calc(100vw - 24px));
}

.registration-org-block {
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: 16px;
    padding: 18px;
    background: rgba(255, 255, 255, .04);
}

    .registration-org-block legend {
        float: none;
        width: auto;
        padding: 0 6px;
    }

@media (max-width: 991.98px) {
    .auth-card-registration {
        max-width: 560px;
    }
}

/* ============================ AUTH FIELDs ============================ */

.auth-field {
    position: relative;
}

    .auth-field .form-label {
        transition: color .15s ease;
    }

    .auth-field .input-group {
        --auth-field-border: var(--bs-border-color);
        --auth-field-bg: var(--bs-body-bg);
        --auth-field-color: var(--bs-body-color);
        --auth-field-muted: var(--bs-secondary-color);
        --auth-field-glow: transparent;
        overflow: hidden;
        border: 1px solid var(--auth-field-border);
        border-radius: .65rem;
        background: var(--auth-field-bg);
        box-shadow: 0 0 0 .25rem var(--auth-field-glow);
        transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
    }

        .auth-field .input-group:focus-within {
            --auth-field-border: rgba(var(--bs-primary-rgb), .72);
            --auth-field-glow: rgba(var(--bs-primary-rgb), .18);
        }

    .auth-field .input-group-text,
    .auth-field .form-control,
    .auth-field .btn-eye {
        border: 0 !important;
        background: transparent !important;
        color: var(--auth-field-color);
        box-shadow: none !important;
        transition: color .15s ease, background-color .15s ease;
    }

    .auth-field .input-group-text,
    .auth-field .btn-eye {
        color: var(--auth-field-muted);
    }

    .auth-field .form-control {
        min-width: 0;
    }

        .auth-field .form-control:focus {
            box-shadow: none;
        }

    .auth-field .btn-eye {
        cursor: pointer;
    }

        .auth-field .btn-eye:hover {
            color: var(--auth-field-color);
        }

    .auth-field:has(.is-invalid) .form-label {
        color: var(--bs-danger);
    }

    .auth-field:has(.is-invalid) .input-group {
        --auth-field-border: rgba(var(--bs-danger-rgb), .72);
        --auth-field-bg: rgba(var(--bs-danger-rgb), .055);
        --auth-field-color: var(--bs-body-color);
        --auth-field-muted: rgba(var(--bs-danger-rgb), .86);
        --auth-field-glow: rgba(var(--bs-danger-rgb), .16);
    }

    .auth-field:has(.is-valid):not(:has(.is-invalid)) .input-group {
        --auth-field-border: rgba(var(--bs-success-rgb), .62);
        --auth-field-bg: rgba(var(--bs-success-rgb), .045);
        --auth-field-color: var(--bs-body-color);
        --auth-field-muted: rgba(var(--bs-success-rgb), .78);
        --auth-field-glow: rgba(var(--bs-success-rgb), .11);
    }

html[data-bs-theme="dark"] .auth-field .input-group {
    --auth-field-border: rgba(255,255,255,.16);
    --auth-field-bg: rgba(255,255,255,.045);
    --auth-field-color: rgba(255,255,255,.92);
    --auth-field-muted: rgba(255,255,255,.58);
}

    html[data-bs-theme="dark"] .auth-field .input-group:focus-within {
        --auth-field-border: rgba(var(--bs-primary-rgb), .72);
        --auth-field-glow: rgba(var(--bs-primary-rgb), .20);
    }

html[data-bs-theme="dark"] .auth-field:has(.is-invalid) .input-group {
    --auth-field-border: rgba(var(--bs-danger-rgb), .68);
    --auth-field-bg: rgba(var(--bs-danger-rgb), .075);
    --auth-field-color: rgba(255,255,255,.94);
    --auth-field-muted: rgba(var(--bs-danger-rgb), .82);
    --auth-field-glow: rgba(var(--bs-danger-rgb), .17);
}

html[data-bs-theme="dark"] .auth-field:has(.is-valid):not(:has(.is-invalid)) .input-group {
    --auth-field-border: rgba(var(--bs-success-rgb), .58);
    --auth-field-bg: rgba(var(--bs-success-rgb), .06);
    --auth-field-color: rgba(255,255,255,.94);
    --auth-field-muted: rgba(var(--bs-success-rgb), .76);
    --auth-field-glow: rgba(var(--bs-success-rgb), .12);
}

.otp-digit.is-invalid {
    border-color: rgba(var(--bs-danger-rgb), .72);
    box-shadow: 0 0 0 .22rem rgba(var(--bs-danger-rgb), .16);
}

.otp-digit.is-valid {
    border-color: rgba(var(--bs-success-rgb), .62);
    box-shadow: 0 0 0 .16rem rgba(var(--bs-success-rgb), .11);
}