/* =====================================
   Modern Authentication Modal Styles
   ===================================== */

/* Modal Animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalSlideDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
}

@keyframes stepFadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Modal Overlay */
#auth-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease-out;
}

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

/* Modern Modal Container */
.auth-modal-modern {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    max-width: 480px;
    width: 92%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal-modern .modal-header {
    background: linear-gradient(135deg, #4a7c59 0%, #6b9b7a 100%);
    color: white;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-modal-modern .modal-header-content {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.auth-modal-modern .modal-icon {
    font-size: 32px;
    opacity: 0.95;
}

.auth-modal-modern .modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
}

.auth-modal-modern .modal-subtitle {
    margin: 4px 0 0;
    font-size: 0.85rem;
    opacity: 0.85;
    color: rgba(255, 255, 255, 0.9);
}

.auth-modal-modern .modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-modal-modern .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Step Indicator */
.auth-step-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    background: #f8faf9;
    border-bottom: 1px solid #e8f0e8;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #e8f0e8;
    background: white;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.step-label {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;
    transition: all 0.3s;
}

.step-item.active .step-number {
    background: linear-gradient(135deg, #4a7c59, #6b9b7a);
    border-color: #4a7c59;
    color: white;
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
}

.step-item.active .step-label {
    color: #4a7c59;
    font-weight: 600;
}

.step-item.completed .step-number {
    background: #6b9b7a;
    border-color: #6b9b7a;
    color: white;
}

.step-item.completed .step-label {
    color: #6b9b7a;
}

.step-line {
    flex: 1;
    height: 2px;
    background: #e8f0e8;
    margin: 0 8px;
    max-width: 60px;
}

/* Modal Body */
.auth-modal-modern .modal-body {
    padding: 32px 24px;
    min-height: 200px;
    position: relative;
}

/* Auth Steps */
.auth-step {
    display: none;
    animation: stepFadeIn 0.4s ease-out;
}

.auth-step.active {
    display: block;
}

.step-description {
    margin: 0 0 24px;
    color: #6b7c6b;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Form Groups */
.auth-modal-modern .form-group {
    margin-bottom: 20px;
}

.auth-modal-modern .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2d3a2d;
    font-weight: 500;
    font-size: 0.9rem;
}

.auth-modal-modern .form-group label i {
    color: #4a7c59;
    margin-right: 6px;
}

.auth-modal-modern .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e8f0e8;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.2s;
    background: #f8faf9;
}

.auth-modal-modern .form-control:focus {
    outline: none;
    border-color: #4a7c59;
    background: white;
    box-shadow: 0 0 0 4px rgba(74, 124, 89, 0.1);
}

/* Student Name Display */
.student-name-display {
    padding: 16px;
    background: linear-gradient(135deg, #f8faf9 0%, #e8f0e8 100%);
    border-radius: 10px;
    border: 2px solid #4a7c59;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3a2d;
    text-align: center;
}

/* Password Input Wrapper */
.password-input-wrapper {
    position: relative;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7c6b;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.password-toggle-btn:hover {
    color: #4a7c59;
}

/* Buttons */
.auth-modal-modern .btn-large {
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.auth-modal-modern .btn-primary {
    background: linear-gradient(135deg, #4a7c59 0%, #6b9b7a 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
}

.auth-modal-modern .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 124, 89, 0.4);
}

.auth-modal-modern .btn-primary:active {
    transform: translateY(0);
}

/* Error Message */
.auth-error {
    display: none;
    margin-top: 16px;
    padding: 12px 16px;
    background: #fee;
    border-left: 4px solid #e74c3c;
    border-radius: 8px;
    color: #c0392b;
    font-size: 0.9rem;
    line-height: 1.4;
}

.auth-error:not(:empty) {
    display: block;
    animation: stepFadeIn 0.3s ease-out;
}

/* Loading Indicator */
.auth-loading {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    z-index: 10;
}

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

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e8f0e8;
    border-top-color: #4a7c59;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.auth-loading p {
    margin: 0;
    color: #6b7c6b;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-modal-modern {
        max-width: 100%;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .auth-modal-modern .modal-header {
        padding: 20px;
    }

    .auth-step-indicator {
        padding: 16px;
    }

    .step-label {
        font-size: 0.7rem;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .auth-modal-modern .modal-body {
        padding: 24px 20px;
    }
}