/* ===================================
   Login Page Styles
   =================================== */

:root {
    --light-blue: #87CEEB;
    --dark-blue: #4A90A4;
    --yellow: #FFD700;
    --dark-yellow: #FFC700;
    --white: #FFFFFF;
    --gray-light: #F8F9FA;
    --gray-dark: #333333;
    --gray-text: #666666;
    --danger: #dc3545;
    --success: #28a745;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, rgba(135, 206, 235, 0.1) 0%, rgba(255, 215, 0, 0.1) 100%);
    overflow-x: hidden;
}

/* ===================================
   Login Container
   =================================== */

.login-container {
    display: flex;
    min-height: 100vh;
    background: var(--white);
}

/* Left Side - Branding */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--light-blue) 0%, var(--dark-blue) 100%);
    position: relative;
    overflow: hidden;
}

.bg-gradient-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none"><path d="M0,0 Q300,120 600,120 T1200,0 L1200,0 L0,0 Z" fill="rgba(255,255,255,0.1)"/></svg>');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.bg-gradient-primary .display-4 {
    font-size: 4rem;
    animation: slideInDown 0.6s ease-out;
}

.bg-gradient-primary h1 {
    font-size: 2.5rem;
    font-weight: 700;
    animation: slideInDown 0.8s ease-out;
}

.bg-gradient-primary .lead {
    font-size: 1.25rem;
    animation: slideInUp 0.8s ease-out;
}

/* Right Side - Login Form */
.login-form-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-form-container h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--dark-blue);
}

.login-form-container .text-muted {
    color: var(--gray-text);
}

/* ===================================
   Form Styling
   =================================== */

.form-label {
    font-weight: 600;
    color: var(--gray-dark);
    margin-bottom: 0.5rem;
}

.form-control {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--light-blue);
    box-shadow: 0 0 0 0.2rem rgba(135, 206, 235, 0.25);
    outline: none;
}

.form-control.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-valid {
    border-color: var(--success);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.input-group {
    position: relative;
}

.input-group-text {
    border: 2px solid #e0e0e0;
    border-right: none;
    background: var(--light-blue);
    color: var(--white);
    font-weight: 600;
}

.input-group .form-control {
    border-left: none;
}

.input-group .form-control:focus {
    border-left-color: var(--light-blue);
}

/* Password toggle button */
#togglePassword {
    border: 2px solid #e0e0e0;
    border-left: none;
    color: var(--gray-text);
    background: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
}

#togglePassword:hover {
    background: var(--gray-light);
    color: var(--dark-blue);
}

/* ===================================
   Button Styles
   =================================== */

.btn-primary {
    background: linear-gradient(135deg, var(--light-blue) 0%, var(--dark-blue) 100%);
    border: none;
    color: var(--white);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(135, 206, 235, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--light-blue) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(135, 206, 235, 0.4);
    color: var(--white);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(135, 206, 235, 0.3);
}

/* ===================================
   Checkbox Styles
   =================================== */

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.3rem;
    cursor: pointer;
    border: 2px solid #dee2e6;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.form-check-input:hover {
    border-color: var(--light-blue);
}

.form-check-input:checked {
    background-color: var(--dark-blue);
    border-color: var(--dark-blue);
}

.form-check-label {
    cursor: pointer;
    user-select: none;
    color: var(--gray-dark);
}

/* ===================================
   CAPTCHA Styling
   =================================== */

.g-recaptcha {
    margin: 1rem 0;
    display: flex;
    justify-content: center;
}

.g-recaptcha iframe {
    border-radius: 4px;
}

/* ===================================
   Alert Styling
   =================================== */

#alertContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.alert {
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out;
    margin-bottom: 10px;
    min-width: 300px;
}

.alert-success {
    background: linear-gradient(135deg, var(--success) 0%, #20c997 100%);
    color: var(--white);
}

.alert-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #c82333 100%);
    color: var(--white);
}

.alert-warning {
    background: linear-gradient(135deg, var(--yellow) 0%, var(--dark-yellow) 100%);
    color: var(--gray-dark);
}

.alert-info {
    background: linear-gradient(135deg, var(--light-blue) 0%, var(--dark-blue) 100%);
    color: var(--white);
}

.alert .btn-close {
    background: rgba(255, 255, 255, 0.3);
    opacity: 0.8;
}

.alert .btn-close:hover {
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
}

/* ===================================
   Animations
   =================================== */

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ===================================
   Loading State
   =================================== */

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.65;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 991px) {
    .login-form-container {
        max-width: 100%;
        padding: 2rem 1rem;
    }

    .bg-gradient-primary {
        padding: 2rem;
    }

    .bg-gradient-primary .display-4 {
        font-size: 2.5rem;
    }

    .bg-gradient-primary h1 {
        font-size: 1.75rem;
    }
}

@media (max-width: 576px) {
    .login-container {
        flex-direction: column;
    }

    .login-form-container {
        padding: 1.5rem;
    }

    .login-form-container h2 {
        font-size: 1.5rem;
    }

    .form-control, .btn-primary {
        font-size: 1rem;
        padding: 0.65rem;
    }

    #alertContainer {
        max-width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
    }

    .alert {
        min-width: auto;
    }
}

/* ===================================
   Text Styles
   =================================== */

.text-dark-blue {
    color: var(--dark-blue);
}

.text-light-blue {
    color: var(--light-blue);
}

.text-yellow {
    color: var(--yellow);
}

/* ===================================
   Link Styles
   =================================== */

a {
    color: var(--dark-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--light-blue);
    text-decoration: underline;
}

/* ===================================
   Small Text
   =================================== */

.form-text {
    font-size: 0.875rem;
    color: var(--gray-text);
}

small {
    display: block;
    margin-top: 0.25rem;
}

/* ===================================
   Accessibility
   =================================== */

.form-control:focus-visible,
.btn-primary:focus-visible {
    outline: 2px solid var(--light-blue);
    outline-offset: 2px;
}

::-webkit-input-placeholder {
    color: #bbb;
}

:-moz-placeholder {
    color: #bbb;
}

::-moz-placeholder {
    color: #bbb;
}

:-ms-input-placeholder {
    color: #bbb;
}
