.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 1.5rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    background: rgba(18, 24, 34, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 2.5rem;
    padding: 2.5rem 2rem;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
    position: relative;
    animation: modalFade 0.3s ease;
}

@keyframes modalFade {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #8b9bb5;
    font-size: 2rem;
    cursor: pointer;
    transition: 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: #fff;
    transform: rotate(90deg);
}

.modal-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.8rem;
}

.modal-brand img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 12px;
    background: #1f2a3a;
    padding: 6px;
}

.modal-brand span {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #b7d0ff, #7aa9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-tabs {
    display: flex;
    background: #121a26;
    border-radius: 60px;
    padding: 6px;
    margin-bottom: 2rem;
    border: 1px solid #283240;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 0.7rem 0;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    background: transparent;
    color: #8b9bb5;
    border-radius: 40px;
    cursor: pointer;
    transition: 0.25s ease;
}

.auth-tab.active {
    background: #2a3a52;
    color: #f0f6ff;
    box-shadow: 0 4px 12px rgba(0, 30, 70, 0.5);
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 1.4rem;
}

.auth-form.active {
    display: flex;
}

.auth-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.auth-form .form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #a0b6d6;
    margin-left: 6px;
}

.auth-form .form-group input,
.auth-form .form-group select {
    background: #0f1622;
    border: 1px solid #283546;
    border-radius: 40px;
    padding: 0.9rem 1.4rem;
    font-size: 1rem;
    color: #eef4ff;
    outline: none;
    transition: 0.2s;
    font-family: 'Roboto', sans-serif;
}

.auth-form .form-group input:focus,
.auth-form .form-group select:focus {
    border-color: #5d8aff;
    box-shadow: 0 0 0 3px rgba(70, 130, 255, 0.2);
    background: #141e2e;
}

.auth-form .form-group input::placeholder {
    color: #4e627f;
    font-weight: 300;
}

.role-selector {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b9bb5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.2rem center;
    cursor: pointer;
}

.btn-auth {
    background: linear-gradient(145deg, #3b67f0, #1f44c9);
    border: none;
    border-radius: 60px;
    padding: 1rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    cursor: pointer;
    transition: 0.25s;
    margin-top: 0.5rem;
    box-shadow: 0 8px 20px rgba(30, 80, 255, 0.25);
}

.btn-auth:hover {
    transform: scale(1.02);
    background: linear-gradient(145deg, #527aff, #2a4fd6);
    box-shadow: 0 12px 28px rgba(30, 80, 255, 0.4);
}

.btn-auth:active {
    transform: scale(0.97);
}

.auth-error {
    background: #30161c;
    border-left: 4px solid #ff5e7c;
    color: #ffb3c1;
    padding: 0.7rem 1rem;
    border-radius: 40px;
    font-size: 0.9rem;
    display: none;
}

.auth-error.visible {
    display: block;
}

.auth-footer {
    margin-top: 1.8rem;
    text-align: center;
    color: #6f85a5;
    font-size: 0.9rem;
}

.auth-footer a {
    color: #7aa9ff;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

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

.open-modal-btn {
    background: linear-gradient(145deg, #3b67f0, #1f44c9);
    border: none;
    border-radius: 60px;
    padding: 0.7rem 1.5rem;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.25s;
    box-shadow: 0 8px 20px rgba(30, 80, 255, 0.25);
}

.open-modal-btn:hover {
    transform: scale(1.05);
}

@media (max-width: 480px) {
    .modal-container {
        padding: 1.8rem 1.2rem;
        border-radius: 2rem;
    }
}