/* ============================================
   🔐 AUTH PAGES - MODERN GLASSMORPHISM THEME
   ============================================ */

.auth-body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #050814;
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Auth Background */
.auth-body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #050814 0%, #0d1428 50%, #050814 100%);
    z-index: -1;
}

/* ============================================
   AUTH CONTAINER
   ============================================ */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 5;
}

.auth-container.wide {
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================
   AUTH CARD - GLASSMORPHISM
   ============================================ */
.auth-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 450px;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-card:hover::before {
    opacity: 1;
}

/* Wide Auth Card for Role Selection */
.auth-card.wide {
    max-width: 800px;
    padding: 50px;
}

/* ============================================
   AUTH HEADER
   ============================================ */
.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

.auth-title {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #ffffff, #667eea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    font-weight: 500;
}

/* ============================================
   FORM STYLING
   ============================================ */
.auth-form {
    margin-bottom: 30px;
}

.form-floating {
    margin-bottom: 20px;
    position: relative;
}

.form-floating .form-control {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #ffffff;
    padding: 16px 20px;
    font-size: 1rem;
    height: auto;
    transition: all 0.3s ease;
}

.form-floating .form-control:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    color: #ffffff;
    outline: none;
}

.form-floating .form-control::placeholder {
    color: transparent;
}

.form-floating label {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    padding: 16px 20px;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   MODERN INPUT DESIGN
   ============================================ */
.input-group-modern {
    position: relative;
    margin-bottom: 25px;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.form-control-modern {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: #ffffff;
    padding: 18px 20px 18px 55px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.form-control-modern::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.form-control-modern:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: #667eea;
    box-shadow: 
        0 0 0 4px rgba(102, 126, 234, 0.1),
        0 8px 30px rgba(102, 126, 234, 0.2);
    color: #ffffff;
    outline: none;
    transform: translateY(-2px);
}

.form-control-modern:focus + .input-icon,
.input-group-modern:focus-within .input-icon {
    color: #667eea;
    transform: translateY(-50%) scale(1.1);
}

/* Hover effect */
.input-group-modern:hover .form-control-modern {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.input-group-modern:hover .input-icon {
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   POP-UP NOTIFICATION SYSTEM
   ============================================ */
.notification-popup {
    position: fixed;
    top: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 18px 22px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    transform: translateX(350px) scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 380px;
    border-left: 4px solid #ff4757;
    pointer-events: auto;
}

.notification-popup.show {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.notification-popup.success {
    border-left-color: #2ed573;
    background: rgba(46, 213, 115, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(46, 213, 115, 0.2);
}

.notification-popup.error {
    border-left-color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 71, 87, 0.2);
}

.notification-popup.info {
    border-left-color: #3742fa;
    background: rgba(55, 66, 250, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(55, 66, 250, 0.2);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.notification-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.notification-popup.error .notification-icon {
    background: #ff4757;
}

.notification-popup.success .notification-icon {
    background: #2ed573;
}

.notification-popup.info .notification-icon {
    background: #3742fa;
}

.notification-text {
    color: #ebe4e4;
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.4;
}

.notification-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    color: #333;
}





/* ============================================
   BUTTONS
   ============================================ */
.auth-btn {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.auth-btn:hover::before {
    left: 100%;
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
    transform: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.auth-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Secondary Button */
.auth-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.auth-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #667eea;
    color: #ffffff;
}

/* ============================================
   ROLE SELECTION CARDS
   ============================================ */
.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.role-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.role-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.role-card:hover {
    transform: translateY(-10px);
    border-color: #667eea;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3);
}

.role-card:hover::before {
    opacity: 1;
}

.role-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: white;
    transition: all 0.3s ease;
}

.role-card:hover .role-icon {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

.role-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
}

.role-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ============================================
   ALERTS & MESSAGES
   ============================================ */
.auth-alert {
    background: rgba(255, 0, 85, 0.1);
    border: 1px solid rgba(255, 0, 85, 0.3);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    color: #ff0055;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-alert.success {
    background: rgba(0, 255, 136, 0.1);
    border-color: rgba(0, 255, 136, 0.3);
    color: #00ff88;
}

.auth-alert.info {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
    color: #00d4ff;
}

/* ============================================
   FOOTER LINKS
   ============================================ */
.auth-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10;
}

.auth-link {
    color: #667eea !important;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    z-index: 11;
    pointer-events: auto;
    display: inline-block;
    padding: 12px 20px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    margin-top: 10px;
}

.auth-link:hover {
    color: #764ba2 !important;
    text-decoration: none;
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

/* ============================================
   LOADING STATES
   ============================================ */
.auth-loading,
.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.auth-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

/* Button content states */
.btn-content,
.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-loading {
    color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   COMPREHENSIVE MOBILE RESPONSIVE DESIGN
   ============================================ */

/* Large Tablets */
@media (max-width: 1200px) {
    .auth-container {
        padding: 25px;
    }
    
    .auth-card {
        max-width: 500px;
    }
    
    .auth-card.wide {
        max-width: 900px;
    }
}

/* Tablets */
@media (max-width: 992px) {
    .auth-container {
        padding: 20px;
    }
    
    .auth-card {
        max-width: 450px;
        padding: 35px 30px;
    }
    
    .auth-card.wide {
        max-width: 700px;
        padding: 45px 35px;
    }
    
    .role-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 25px;
    }
}

/* Mobile Landscape and Small Tablets */
@media (max-width: 768px) {
    .auth-container {
        padding: 15px;
        min-height: 100vh;
    }
    
    .auth-card {
        padding: 30px 25px;
        margin: 10px;
        max-width: 100%;
        width: 100%;
    }
    
    .auth-card.wide {
        padding: 40px 30px;
        max-width: 100%;
    }
    
    .role-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .auth-title {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .auth-subtitle {
        font-size: 0.95rem;
    }
    
    .auth-logo {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    /* Form Adjustments Mobile */
    .form-floating {
        margin-bottom: 18px;
    }
    
    .form-floating .form-control {
        padding: 14px 18px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .form-floating label {
        padding: 14px 18px;
        font-size: 0.9rem;
        max-width: calc(100% - 60px);
    }
    
    /* Password toggle mobile */
    .password-toggle {
        right: 10px;
        width: 35px;
        height: 35px;
    }
    
    .form-floating .form-control.has-toggle {
        padding-right: 50px !important;
    }
    
    /* Button adjustments */
    .auth-btn {
        padding: 14px;
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .auth-btn-secondary {
        padding: 12px;
        font-size: 0.95rem;
    }
    
    /* Role cards mobile */
    .role-card {
        padding: 25px 20px;
        text-align: center;
    }
    
    .role-icon {
        width: 65px;
        height: 65px;
        font-size: 1.6rem;
        margin-bottom: 15px;
    }
    
    .role-title {
        font-size: 1.3rem;
        margin-bottom: 8px;
    }
    
    .role-description {
        font-size: 0.9rem;
    }
    
    /* Alert mobile */
    .auth-alert {
        padding: 12px 16px;
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    /* Footer mobile */
    .auth-footer {
        margin-top: 25px;
        padding-top: 15px;
    }
    
    .auth-link {
        font-size: 0.9rem;
    }
}

/* Mobile Portrait */
@media (max-width: 576px) {
    .auth-container {
        padding: 10px;
    }
    
    .auth-card {
        padding: 25px 20px;
        margin: 5px;
        border-radius: 20px;
    }
    
    .auth-card.wide {
        padding: 30px 25px;
    }
    
    .auth-header {
        margin-bottom: 30px;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    .auth-subtitle {
        font-size: 0.9rem;
    }
    
    .auth-logo {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
        margin-bottom: 12px;
    }
    
    /* Form mobile portrait */
    .form-floating {
        margin-bottom: 16px;
    }
    
    .form-floating .form-control {
        padding: 12px 16px;
        font-size: 16px;
        border-radius: 10px;
    }
    
    .form-floating label {
        padding: 12px 16px;
        font-size: 0.85rem;
        max-width: calc(100% - 55px);
    }
    
    .password-toggle {
        right: 8px;
        width: 32px;
        height: 32px;
    }
    
    .form-floating .form-control.has-toggle {
        padding-right: 45px !important;
    }
    
    /* Buttons mobile portrait */
    .auth-btn {
        padding: 12px;
        font-size: 0.95rem;
        border-radius: 10px;
    }
    
    /* Role cards mobile portrait */
    .role-card {
        padding: 20px 15px;
        border-radius: 16px;
    }
    
    .role-icon {
        width: 55px;
        height: 55px;
        font-size: 1.4rem;
        margin-bottom: 12px;
    }
    
    .role-title {
        font-size: 1.2rem;
        margin-bottom: 6px;
    }
    
    .role-description {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    /* Loading states mobile */
    .auth-spinner {
        width: 18px;
        height: 18px;
    }
    
    /* Alert mobile portrait */
    .auth-alert {
        padding: 10px 14px;
        font-size: 0.85rem;
        border-radius: 10px;
    }
}

/* Extra Small Mobile */
@media (max-width: 375px) {
    .auth-card {
        padding: 20px 15px;
        border-radius: 16px;
    }
    
    .auth-card.wide {
        padding: 25px 20px;
    }
    
    .auth-title {
        font-size: 1.3rem;
    }
    
    .auth-logo {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .form-floating .form-control {
        padding: 10px 14px;
        font-size: 16px;
    }
    
    .form-floating label {
        padding: 10px 14px;
        font-size: 0.8rem;
    }
    
    .auth-btn {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .role-card {
        padding: 18px 12px;
    }
    
    .role-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .role-title {
        font-size: 1.1rem;
    }
    
    .role-description {
        font-size: 0.8rem;
    }
}

/* Landscape Mobile Orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .auth-container {
        padding: 10px;
    }
    
    .auth-card {
        max-height: 90vh;
        overflow-y: auto;
        padding: 20px;
    }
    
    .auth-card.wide {
        padding: 25px;
    }
    
    .auth-header {
        margin-bottom: 20px;
    }
    
    .auth-logo {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        margin-bottom: 10px;
    }
    
    .role-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .role-card {
        padding: 15px 10px;
    }
    
    .role-icon {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .auth-btn:hover,
    .role-card:hover,
    .auth-btn-secondary:hover {
        transform: none;
    }
    
    .auth-btn,
    .auth-btn-secondary {
        min-height: 44px;
        transition: background-color 0.3s ease, border-color 0.3s ease;
    }
    
    .role-card {
        transition: background-color 0.3s ease, border-color 0.3s ease;
    }
    
    .password-toggle {
        min-height: 44px;
        min-width: 44px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .auth-logo,
    .role-icon {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ensure loading elements are visible */
.d-none {
    display: none !important;
}

.d-flex {
    display: flex !important;
}

.d-inline-flex {
    display: inline-flex !important;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

*:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */
@media (prefers-color-scheme: dark) {
    .auth-card {
        background: rgba(255, 255, 255, 0.03);
    }
    
    .form-floating .form-control {
        background: rgba(255, 255, 255, 0.05);
    }
}