/* ===================================
   FUDMA UHS Portal - Optimized Styles
   Author: Ahmad J. Waziri (Optimized)
   =================================== */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Custom Properties for better maintainability */
:root {
    --primary-color: #0c411e;
    --accent-color: #0ef;
    --text-color: #fff;
    --text-secondary: #626262;
    --success-color: #30DDBC;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Typography */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--primary-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Main Wrapper */
.wrapper {
    position: relative;
    width: 100%;
    max-width: 750px;
    height: 450px;
    background: transparent;
    border: 2px solid var(--accent-color);
    border-radius: var(--border-radius);
    box-shadow: 0 0 25px var(--accent-color);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Animated Background */
.bg-animate {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--accent-color), var(--primary-color));
    opacity: 0.1;
    animation: backgroundShift 10s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(20px) translateY(-20px); }
    50% { transform: translateX(-20px) translateY(20px); }
    75% { transform: translateX(20px) translateY(20px); }
}

/* Form Box */
.form-box {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 60px 0 40px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.form-box.login {
    left: 0;
}

/* Header Styles */
header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    text-align: center;
}

header h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 2rem;
}

/* Input Box Styles */
.input-box {
    position: relative;
    width: 100%;
    height: 50px;
    margin: 25px 0;
}

.input-box input {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    border-bottom: 2px solid var(--text-color);
    padding-right: 23px;
    font-size: 16px;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
}

.input-box input:focus,
.input-box input:valid {
    border-bottom-color: var(--accent-color);
}

.input-box input:focus ~ label,
.input-box input:valid ~ label {
    top: -5px;
    color: var(--accent-color);
    font-size: 14px;
}

.input-box label {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--text-color);
    pointer-events: none;
    transition: var(--transition);
    background: var(--primary-color);
    padding: 0 5px;
}

.input-box i {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--text-color);
    transition: var(--transition);
}

.input-box input:focus ~ i,
.input-box input:valid ~ i {
    color: var(--accent-color);
}

/* Button Styles */
.btn {
    position: relative;
    width: 100%;
    height: 45px;
    background: var(--accent-color);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    transition: var(--transition);
    overflow: hidden;
}

.btn:hover {
    background: #0dd;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Alert Styles */
#sign_in_result {
    margin: 15px 0;
    padding: 10px;
    border-radius: var(--border-radius);
    font-size: 14px;
    text-align: center;
}

.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    font-size: 14px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Link Styles */
.logreg-link {
    text-align: center;
    margin-top: 20px;
}

.logreg-link a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.logreg-link a:hover {
    color: #0dd;
    text-decoration: underline;
}

/* Info Text Section */
.info-text {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, var(--primary-color), #0a2e0f);
}

.info-text h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.info-text p {
    font-size: 1rem;
    color: var(--text-color);
    opacity: 0.8;
}

.info-text img {
    max-width: 150px;
    height: auto;
    margin-bottom: 2rem;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
}

/* Loading Animation */
.ajax_loader {
    background: url(build/images/Preloader_8.gif);
    background-repeat: no-repeat;
    background-position: center;
    background-size: auto;
    height: 50px;
    cursor: default;
    z-index: -1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wrapper {
        width: 90%;
        height: auto;
        min-height: 500px;
    }
    
    .form-box {
        position: relative;
        width: 100%;
        padding: 40px 30px;
    }
    
    .info-text {
        position: relative;
        width: 100%;
        padding: 30px;
    }
    
    .info-text h2 {
        font-size: 2rem;
    }
    
    header h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .form-box {
        padding: 30px 20px;
    }
    
    .input-box {
        margin: 20px 0;
    }
    
    .btn {
        height: 50px;
        font-size: 16px;
    }
}

/* Focus Management for Accessibility */
.btn:focus,
.input-box input:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000;
        --accent-color: #fff;
        --text-color: #fff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .bg-animate {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .wrapper {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .bg-animate {
        display: none;
    }
    
    .btn {
        background: #f0f0f0 !important;
        color: #000 !important;
    }
}

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }
