﻿/* Modern Credential Pages Styling */

/* Body and Form Overrides for Credential Pages */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #151515 50%, #0a0a0a 100%);
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

body.credential-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #151515 50%, #0a0a0a 100%);
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

form {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 100vh;
}

form.credential-form {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 100vh;
}

/* Animated Background Grid */
.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(25, 55, 109, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(25, 55, 109, 0.1) 1px, transparent 1px);
    background-size: 80px 80px;
    background-position: 0 0, 0 0;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(80px, 80px); }
}

/* Floating Dots */
.floating-dots {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, var(--accent-color), transparent);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

/* Dot positions and animations will be set dynamically via JavaScript */

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-20px) translateX(10px) scale(1.2);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-10px) translateX(-5px) scale(0.8);
        opacity: 1;
    }
    75% {
        transform: translateY(-30px) translateX(15px) scale(1.1);
        opacity: 0.4;
    }
}

/* Modern Form Container */
#formContainer {
    background: linear-gradient(145deg, 
        rgba(25, 55, 109, 0.15) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(25, 55, 109, 0.12) 100%);
    border: 1px solid rgba(25, 55, 109, 0.3);
    border-radius: 24px;
    padding: 40px;
    width: 90%;
    max-width: 380px;
    box-shadow: 
        0 8px 32px rgba(25, 55, 109, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    text-align: center;
    position: relative;
    z-index: 10;
    animation: containerEntrance 1.2s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
    min-height: auto;
    height: auto;
}

@keyframes containerEntrance {
    0% { 
        opacity: 0; 
        transform: translateY(50px) scale(0.9); 
        filter: blur(10px);
    }
    60% {
        opacity: 0.8;
        transform: translateY(10px) scale(1.02);
        filter: blur(2px);
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
        filter: blur(0px);
    }
}

/* Legacy styles for backwards compatibility */
#LogoImageDiv {
    margin-bottom: 2rem;
}

.inputDiv {
    margin: auto;
    width: auto;
    height: auto;
    background: none;
}

#loginDiv {
    padding: 0;
}

/* Support for older rectangle div */
#rectangleDiv {
    display: none;
}

.InputBox {
    width: 100%;
    padding: 14px 18px;
    margin-bottom: 1rem;
    border: 2px solid rgba(25, 55, 109, 0.2);
    border-radius: 12px;
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.08) 0%,
        rgba(25, 55, 109, 0.05) 50%,
        rgba(255, 255, 255, 0.08) 100%);
    color: var(--text-color);
    font-size: 15px;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-sizing: border-box;
}

.InputBox:focus {
    outline: none;
    border-color: var(--accent-color);
    background: linear-gradient(145deg, 
        rgba(25, 55, 109, 0.15) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(25, 55, 109, 0.15) 100%);
    box-shadow: 
        0 0 20px rgba(25, 55, 109, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.InputBox::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.InputBox:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px rgba(25, 55, 109, 0.3) inset;
    -webkit-text-fill-color: black;
    caret-color: black;
}

/* Role Selection Styles */
.role-selection {
    margin: 1rem 0 1.5rem 0;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.role-option {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-color);
    font-size: 13px;
    padding: 6px 12px;
    border: 1px solid rgba(25, 55, 109, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
}

.role-option:hover {
    background: rgba(25, 55, 109, 0.1);
    border-color: rgba(25, 55, 109, 0.4);
}

.role-option input[type="radio"] {
    width: 14px;
    height: 14px;
    accent-color: var(--accent-color);
}

.role-option.admin {
    background: rgba(25, 55, 109, 0.15);
    border: 2px solid rgba(25, 55, 109, 0.4);
    padding: 8px 14px;
    box-shadow: 0 2px 8px rgba(25, 55, 109, 0.2);
}

.role-option.admin:hover {
    background: rgba(25, 55, 109, 0.2);
    box-shadow: 0 4px 12px rgba(25, 55, 109, 0.3);
}

/* Utility Text Styles */
.welcome-title, .page-title {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    text-align: center;
    letter-spacing: -1px;
    text-shadow: 
        0 0 20px rgba(25, 55, 109, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.3);
}

.instruction-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    margin: 0 0 2rem 0;
    line-height: 1.5;
    text-align: center;
    font-weight: 400;
}

.info-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    margin-top: 4px;
    text-align: center;
}

.logoImage {
    width: 200px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(25, 55, 109, 0.3));
    margin-bottom: -2rem;
}

/* Modal Styles for Signup Page */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(145deg, 
        rgba(25, 55, 109, 0.15) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(25, 55, 109, 0.1) 100%);
    border: 1px solid rgba(25, 55, 109, 0.3);
    border-radius: 20px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(25, 55, 109, 0.4);
    transform: scale(0.8) translateY(50px);
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.modal-overlay.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.modal-icon {
    font-size: 2.5rem;
}

.modal-title {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 0 20px rgba(25, 55, 109, 0.4);
}

.modal-body {
    color: black;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 25px;
}

.modal-button {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 3px solid var(--accent-primary);
    border-right: 3px solid var(--accent-primary);
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.modal-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    border-left-color: var(--accent-primary);
    border-right-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 0 20px rgba(74, 222, 128, 0.1);
}

.modal-button:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.08);
}

/* Login/SignUp Page Specific Button Adjustments */
.btnDefault {
    max-width: 280px;
    margin: 10px auto;
}

/* Forgot Password Button - Glass Style */
#btnForgot {
    background: rgba(255, 255, 255, 0.04) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    color: var(--text-secondary, #ffffff) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1) !important;
    width: 170px !important;
    max-width: 170px !important;
    margin: 8px auto !important;
    display: block;
    text-align: center;
    text-transform: none !important;
    letter-spacing: normal !important;
    position: relative !important;
    overflow: visible !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

#btnForgot:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    color: var(--text-primary, #ffffff) !important;
}

/* Back Button - Glass Style */
#btnBack,
.BackClass {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-primary, #ffffff);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 500;
    margin: 10px 0 5px 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    max-width: 200px;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    text-align: center;
    text-decoration: none;
    display: block;
    width: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

#btnBack:hover,
.BackClass:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

#btnBack:active,
.BackClass:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.06);
}

/* Responsive Design */
@media (max-width: 768px) {
    #formContainer {
        padding: 30px 25px;
        width: 95%;
        max-width: none;
    }

    .welcome-title, .page-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .instruction-text {
        font-size: 14px;
        margin-bottom: 1.5rem;
    }

    .role-selection {
        flex-direction: column;
        gap: 12px;
    }
    
    .role-option {
        justify-content: center;
    }

    .modal-content {
        padding: 25px 20px;
        margin: 20px;
    }

    .modal-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    #formContainer {
        padding: 25px 20px;
    }

    .welcome-title, .page-title {
        font-size: 1.6rem;
    }

    .InputBox {
        padding: 14px 16px;
    }


    .logoImage {
        width: 180px;
        margin-bottom: -1.5rem;
    }
}