﻿/* =====================================================
   PRIME PRESS LMS - ENHANCED AUTHENTICATION PAGES
   Modern, Compact Login & Signup Design
   ===================================================== */

/* ===== AUTH CONTAINER WITH ANIMATED BACKGROUND ===== */
.auth-container {
    min-height: calc(100vh - 70px - 300px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

    .auth-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="white" opacity="0.1"/></svg>');
        opacity: 0.3;
        animation: backgroundScroll 20s linear infinite;
    }

@keyframes backgroundScroll {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-100px, -100px);
    }
}

.auth-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 70%, rgba(212, 175, 55, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

/* ===== MODERN AUTH CARD WITH GLASS EFFECT ===== */
.auth-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    padding: 24px 28px;
    border-radius: 20px;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
    overflow: hidden;
}

    .auth-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, #667eea, #764ba2, #d4af37);
    }

    .auth-card::after {
        content: '';
        position: absolute;
        top: -50%;
        right: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
        pointer-events: none;
    }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== STYLISH AUTH TABS ===== */
.auth-tabs {
    display: flex;
    background: #f7fafc;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 16px;
    gap: 4px;
    position: relative;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #718096;
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    z-index: 1;
}

    .auth-tab:hover {
        color: #667eea;
    }

    .auth-tab.active {
        background: white;
        color: #667eea;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    }

/* ===== ENHANCED FORM INPUTS ===== */
.input-boxes {
    display: flex;
    flex-direction: column;
    gap: 6px; /* KEY: was 16px */
    position: relative;
    z-index: 2;
}

.auth-card .form-group {
    margin-bottom: 0;
    position: relative;
}

.auth-card .form-input {
    width: 100%;
    padding: 9px 14px; /* KEY: was 12px 16px */
    font-size: 0.875rem; /* KEY: was 0.9rem */
    border: 2px solid #e2e8f0;
    border-radius: 10px; /* KEY: was 12px */
    background: #ffffff;
    color: #2d3748;
    transition: all 0.3s ease;
    font-family: inherit;
    height: 38px; /* KEY: fixed height for consistency */
    box-sizing: border-box;
}

    .auth-card .form-input:hover {
        border-color: #cbd5e0;
    }

    .auth-card .form-input:focus {
        outline: none;
        border-color: #667eea;
        background: #f7fafc;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        transform: translateY(-1px);
    }

    .auth-card .form-input::placeholder {
        color: #a0aec0;
        font-size: 0.8rem;
    }

/* ===== VALIDATION MESSAGES ===== */
.auth-card .text-danger {
    display: block;
    color: #e53e3e;
    font-size: 0.75rem; /* KEY: was 0.8rem */
    margin-top: 2px; /* KEY: was 6px */
    font-weight: 500;
    animation: shake 0.3s ease;
    line-height: 1.2;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

/* KEY: hide empty validation spans — they cause phantom spacing */
.field-validation-valid {
    display: none !important;
}

.field-validation-error {
    display: block;
}

#usernameAvailabilityMessage {
    font-size: 0.75rem;
    margin-top: 2px; /* KEY: was 6px */
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
    min-height: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===== ICON INPUTS ===== */
.input-with-icon {
    position: relative;
}

    .input-with-icon .form-input {
        padding-left: 44px;
    }

    .input-with-icon .input-icon {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: #a0aec0;
        font-size: 1rem;
        transition: color 0.3s ease;
    }

    .input-with-icon .form-input:focus ~ .input-icon {
        color: #667eea;
    }

/* ===== PASSWORD TOGGLE ===== */
.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 4px;
    font-size: 1rem;
    transition: color 0.3s ease;
}

    .password-toggle:hover {
        color: #667eea;
    }

/* ===== MODERN BUTTONS ===== */
.auth-card .btn-primary {
    width: 100%;
    padding: 10px 24px; /* KEY: was 13px */
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 10px;
    margin-top: 6px; /* KEY: was 8px */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .auth-card .btn-primary::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        transition: left 0.5s;
    }

    .auth-card .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    }

        .auth-card .btn-primary:hover::before {
            left: 100%;
        }

    .auth-card .btn-primary:active {
        transform: translateY(0);
    }

/* ===== REMEMBER ME ===== */
.remember-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 6px 0; /* KEY: was 12px */
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #4a5568;
    font-size: 0.8rem; /* KEY: was 0.875rem */
    margin: 0;
    transition: color 0.3s ease;
}

    .checkbox-label:hover {
        color: #2d3748;
    }

    .checkbox-label input[type="checkbox"] {
        width: 15px; /* KEY: was 18px */
        height: 15px;
        cursor: pointer;
        accent-color: #667eea;
        border-radius: 4px;
        flex-shrink: 0;
    }

    .checkbox-label a {
        color: #667eea;
        text-decoration: none;
        font-weight: 600;
        transition: color 0.3s ease;
    }

        .checkbox-label a:hover {
            color: #764ba2;
        }

.forgot-link {
    color: #667eea;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
}

    .forgot-link:hover {
        color: #764ba2;
        text-decoration: underline;
    }

/* ===== MODERN DIVIDER ===== */
.divider {
    display: flex;
    align-items: center;
    margin: 12px 0; /* KEY: was 24px */
    color: #a0aec0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

    .divider::before,
    .divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: linear-gradient(to right, transparent, #e2e8f0, transparent);
    }

    .divider span {
        padding: 0 12px;
    }

/* ===== SOCIAL LOGIN ===== */
.social-login {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 12px; /* KEY: was 20px */
}

.social-btn {
    width: 44px; /* KEY: was 52px */
    height: 44px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    position: relative;
    overflow: hidden;
}

    .social-btn::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, #667eea, #764ba2);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .social-btn:hover {
        border-color: #667eea;
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(102, 126, 234, 0.25);
    }

        .social-btn:hover::before {
            opacity: 0.05;
        }

    .social-btn:active {
        transform: translateY(-1px);
    }

    .social-btn svg {
        width: 20px; /* KEY: was 24px */
        height: 20px;
        position: relative;
        z-index: 1;
    }

/* ===== AUTH FOOTER TEXT ===== */
.auth-footer-text {
    text-align: center;
    color: #718096;
    font-size: 0.8rem; /* KEY: was 0.875rem */
    margin: 0;
}

    .auth-footer-text a {
        color: #667eea;
        font-weight: 600;
        transition: color 0.3s ease;
        text-decoration: none;
    }

        .auth-footer-text a:hover {
            color: #764ba2;
            text-decoration: underline;
        }

/* ===== ENHANCED ALERTS ===== */
.auth-card .alert {
    margin-bottom: 10px; /* KEY: was 18px */
    padding: 8px 12px; /* KEY: was 12px 16px */
    border-radius: 10px;
    font-size: 0.8rem;
    animation: slideDown 0.4s ease-out;
    display: flex;
    align-items: center;
    gap: 8px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    color: #22543d;
    border: 1px solid #9ae6b4;
}

    .alert-success::before {
        content: '✓';
        font-weight: bold;
        font-size: 1rem;
    }

.alert-danger {
    background: linear-gradient(135deg, #fed7d7 0%, #fc8181 100%);
    color: #742a2a;
    border: 1px solid #fc8181;
}

    .alert-danger::before {
        content: '✗';
        font-weight: bold;
        font-size: 1rem;
    }

.alert-info {
    background: linear-gradient(135deg, #bee3f8 0%, #90cdf4 100%);
    color: #1a365d;
    border: 1px solid #90cdf4;
}

    .alert-info::before {
        content: 'ℹ';
        font-weight: bold;
        font-size: 1rem;
    }

/* ===== TWO-COLUMN FORM GROUPS ===== */
.form-group.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px; /* KEY: was 12px */
}

    .form-group.row .col-md-6 {
        width: 100%;
    }

/* ===== SELECT STYLING ===== */
.auth-card select.form-input {
    height: 38px;
    padding: 0 44px 0 14px;
    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='%23667eea' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
    appearance: none;
}

    .auth-card select.form-input:hover {
        border-color: #cbd5e0;
    }

/* ===== SELECT2 CUSTOM STYLING ===== */
.select2-container--default .select2-selection--single {
    height: 38px !important;
    padding: 0 14px;
    font-size: 0.875rem;
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px !important;
    background: #ffffff;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

    .select2-container--default .select2-selection--single:hover {
        border-color: #cbd5e0 !important;
    }

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #667eea !important;
    background: #f7fafc;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #2d3748;
    line-height: 38px !important;
    padding-left: 0;
    font-size: 0.875rem;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #a0aec0;
    font-size: 0.8rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px !important;
    right: 12px;
}

.select2-dropdown {
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #667eea !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 2px solid #e2e8f0 !important;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.8rem;
}

    .select2-container--default .select2-search--dropdown .select2-search__field:focus {
        border-color: #667eea !important;
        outline: none;
    }

/* ===== FILE INPUT ===== */
.custom-file-input {
    position: relative;
}

    .custom-file-input input[type="file"],
    input[type="file"].form-input {
        padding: 4px 10px;
        font-size: 0.78rem;
        cursor: pointer;
        height: 34px !important;
        display: flex;
        align-items: center;
        box-sizing: border-box;
    }

        .custom-file-input input[type="file"]::file-selector-button,
        input[type="file"].form-input::file-selector-button {
            padding: 5px 10px;
            border: none;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border-radius: 6px;
            font-weight: 600;
            font-size: 0.72rem;
            cursor: pointer;
            margin-right: 8px;
            transition: all 0.3s ease;
            line-height: 1.2;
            vertical-align: middle;
        }

            .custom-file-input input[type="file"]::file-selector-button:hover,
            input[type="file"].form-input::file-selector-button:hover {
                transform: translateY(-1px);
                box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
            }

/* ===== HELPER TEXT ===== */
.auth-card small {
    font-size: 0.75rem;
    color: #718096;
    display: block;
    margin-top: 2px;
    line-height: 1.3;
}

.auth-card label {
    font-size: 0.78rem; /* KEY: was 0.875rem */
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 2px; /* KEY: was 6px */
    display: block;
}

/* ===== SIGN UP TEXT ===== */
.text.sign-up-text {
    text-align: center;
    color: #718096;
    font-size: 0.8rem; /* KEY: was 0.875rem */
    margin-top: 10px; /* KEY: was 20px */
}

    .text.sign-up-text a {
        color: #667eea;
        font-weight: 600;
        text-decoration: none;
        transition: color 0.3s ease;
    }

        .text.sign-up-text a:hover {
            color: #764ba2;
            text-decoration: underline;
        }

/* ===== LOADING STATE ===== */
.auth-card .btn-primary.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

    .auth-card .btn-primary.loading::after {
        content: '';
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        width: 14px;
        height: 14px;
        border: 2px solid white;
        border-top-color: transparent;
        border-radius: 50%;
        animation: spin 0.6s linear infinite;
    }

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .auth-container {
        padding: 16px 12px;
        min-height: calc(100vh - 70px - 200px);
    }

    .auth-card {
        padding: 20px 18px;
        max-width: 100%;
        border-radius: 16px;
    }

    .auth-tabs {
        padding: 3px;
    }

    .auth-tab {
        padding: 7px 10px;
        font-size: 0.85rem;
    }

    .input-boxes {
        gap: 5px;
    }

    .auth-card .form-input {
        padding: 8px 12px;
        font-size: 0.85rem;
        height: 36px;
    }

    .social-btn {
        width: 42px;
        height: 42px;
    }

        .social-btn svg {
            width: 18px;
            height: 18px;
        }

    .form-group.row {
        grid-template-columns: 1fr;
    }

    .remember-row {
        flex-direction: column;
        gap: 6px;
        align-items: flex-start;
    }

    .social-login {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 18px 16px;
    }

        .auth-card .btn-primary {
            padding: 10px 16px;
            font-size: 0.875rem;
        }
}
