/* ===================================
   Unified Login Styles for Mawared Plus
   Based on Ministry of Health Branding
   =================================== */

/* Local Font - DroidKufi */
@font-face {
    font-family: 'DroidKufi';
    src: url('../fonts/DroidKufi-Regular.woff') format('woff'),
         url('../fonts/DroidKufi-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Ministry of Health Colors */
:root {
    --moh-gold: #a48f62;
    --moh-green: #018a60;
    --moh-dark-green: #016647;
    --moh-light-gold: #c4ab7f;
    --moh-light-green: #00a651;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.2);
    --shadow-dark: rgba(0, 0, 0, 0.3);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'DroidKufi', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-image:
        linear-gradient(135deg, rgba(1, 102, 71, 0.85) 0%, rgba(1, 138, 96, 0.8) 50%, rgba(164, 143, 98, 0.85) 100%),
        url('../images/directorate2024_02.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header Styles */
.site-header {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    padding: 10px 0;
    position: relative;
    z-index: 100;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 60px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.portal-title {
    color: var(--moh-green);
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    overflow-y: auto;
    overflow-x: hidden;
}

.login-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Card */
.login-card {
    background-color: rgba(255, 255, 255, 0.98);
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(15px);
    animation: cardSlideIn 0.6s ease-out;
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Header */
.login-header {
    background: linear-gradient(135deg, var(--moh-green) 0%, var(--moh-dark-green) 100%);
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(0, 0); opacity: 0; }
    50% { transform: translate(30px, 30px); opacity: 1; }
}

.login-logo {
    width: 70px;
    height: 70px;
    background-color: white;
    border-radius: 50%;
    padding: 12px;
    margin: 0 auto 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.login-logo i {
    color: var(--moh-green);
    font-size: 2rem;
}

.login-title {
    color: white;
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 400;
    margin-top: 6px;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

/* Login Body */
.login-body {
    padding: 25px 20px;
    background: white;
}

/* Form Styles */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    display: block;
    font-size: 14px;
}

.input-group {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.input-group:focus-within {
    box-shadow: 0 5px 15px rgba(1, 138, 96, 0.2);
    transform: translateY(-2px);
}

.input-group-prepend {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--moh-green) 0%, var(--moh-dark-green) 100%);
    color: white;
    z-index: 2;
}

.input-group-prepend i {
    font-size: 1.1rem;
}

.input-group-text {
    background: transparent;
    border: none;
    color: white;
}

.form-control {
    height: 48px;
    padding-right: 15px;
    padding-left: 65px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    width: 100%;
}

.form-control:focus {
    border-color: var(--moh-green);
    box-shadow: none;
    background-color: white;
    outline: none;
}

.form-control::placeholder {
    color: #adb5bd;
    font-weight: 400;
}

.form-text {
    font-size: 12px;
    color: #6c757d;
    margin-top: 6px;
    display: block;
}

/* Buttons */
.login-btn {
    background: linear-gradient(135deg, var(--moh-green) 0%, var(--moh-dark-green) 100%);
    border: none;
    height: 48px;
    font-weight: 700;
    font-size: 16px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(1, 138, 96, 0.3);
    transition: all 0.3s ease;
    color: white;
    width: 100%;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.login-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;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(1, 138, 96, 0.4);
    background: linear-gradient(135deg, var(--moh-dark-green) 0%, var(--moh-green) 100%);
}

.login-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(1, 138, 96, 0.3);
}

.home-btn {
    color: var(--moh-green);
    border: 2px solid var(--moh-green);
    border-radius: 10px;
    font-weight: 600;
    padding: 10px 20px;
    transition: all 0.3s ease;
    background: white;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
}

.home-btn:hover {
    background: var(--moh-green);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1, 138, 96, 0.2);
    text-decoration: none;
}

/* Error Message */
.error-message {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
    color: #e53e3e;
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 18px;
    text-align: center;
    font-weight: 600;
    border-right: 4px solid #e53e3e;
    box-shadow: 0 3px 10px rgba(229, 62, 62, 0.15);
    animation: shake 0.5s ease;
    font-size: 14px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.error-message i {
    margin-left: 6px;
}

/* Success Message */
.success-message {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #16a34a;
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 18px;
    text-align: center;
    font-weight: 600;
    border-right: 4px solid #16a34a;
    box-shadow: 0 3px 10px rgba(22, 163, 74, 0.15);
    font-size: 14px;
}

.success-message i {
    margin-left: 6px;
}

/* Info Message */
.info-message {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    color: #0284c7;
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 18px;
    text-align: center;
    font-weight: 500;
    border-right: 4px solid #0284c7;
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.15);
    font-size: 14px;
}

.info-message i {
    margin-left: 6px;
}

/* Login Footer */
.login-footer {
    text-align: center;
    margin-top: 15px;
    padding: 12px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 13px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    background: rgba(1, 138, 96, 0.25);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.login-footer i {
    margin-left: 5px;
    color: var(--moh-gold);
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo-img {
        height: 55px;
    }

    .portal-title {
        font-size: 20px;
    }

    .login-container {
        max-width: 100%;
    }

    .login-body {
        padding: 20px 18px;
    }

    .login-title {
        font-size: 20px;
    }
}

@media (max-width: 576px) {
    .site-header {
        padding: 8px 0;
    }

    .logo-img {
        height: 50px;
    }

    .portal-title {
        font-size: 18px;
    }

    .main-content {
        padding: 10px;
    }

    .login-card {
        border-radius: 12px;
    }

    .login-header {
        padding: 18px 15px;
    }

    .login-logo {
        width: 65px;
        height: 65px;
    }

    .login-logo i {
        font-size: 1.8rem;
    }

    .login-title {
        font-size: 20px;
    }

    .login-subtitle {
        font-size: 13px;
    }

    .login-body {
        padding: 20px 15px;
    }

    .form-control {
        height: 46px;
        font-size: 14px;
    }

    .login-btn {
        height: 46px;
        font-size: 15px;
    }

    .form-group {
        margin-bottom: 15px;
    }
}

@media (max-height: 700px) {
    .site-header {
        padding: 8px 0;
    }

    .logo-img {
        height: 50px;
    }

    .login-header {
        padding: 15px;
    }

    .login-logo {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
    }

    .login-logo i {
        font-size: 1.6rem;
    }

    .login-title {
        font-size: 18px;
    }

    .login-body {
        padding: 18px 15px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .login-footer {
        margin-top: 10px;
        padding: 10px;
        font-size: 12px;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.btn-block {
    width: 100%;
    display: block;
}

/* Additional Effects */
.login-card:hover {
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.15);
}

/* Loading State for Button */
.login-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.login-btn.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-left: -9px;
    margin-top: -9px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
