/* ===== ROOT COLORS & VARIABLES ===== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --accent-color: #06b6d4;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
}

/* ===== GLOBAL RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    width: 100%;
}

body {
    font-size: 0.95rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", 
                 "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    scroll-behavior: smooth;
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    text-decoration: none;
}

/* ===== ANIMATIONS ===== */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== CONTAINER ===== */
.login-wrapper {
    width: 100%;
    max-width: 1120px;
}

.login-page {
    background: var(--bg-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.5s ease-out;
}

.login-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 550px;
    width: 100%;
}

/* ===== LEFT SIDE ===== */
.left-side {
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--bg-white);
}

/* ===== HEADER ===== */
.login-head {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-container {
    margin-bottom: 1.5rem;
}

.logo-img {
    width: 110px;
    height: auto;
    display: inline-block;
    animation: fadeInDown 0.6s ease-out;
}

.login-head h4 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0.75rem 0 0.5rem 0;
    letter-spacing: -0.3px;
}

.login-head p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 400;
}

/* ===== ALERTS ===== */
.alert {
    border-radius: 8px;
    border: 0;
    border-left: 4px solid;
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideDown 0.4s ease-out;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border-left-color: var(--success-color);
}

.alert-danger,
.alert-error {
    background-color: #fef2f2;
    color: #7f1d1d;
    border-left-color: var(--error-color);
}

.alert-warning {
    background-color: #fefce8;
    color: #713f12;
    border-left-color: #f59e0b;
}

.alert-info {
    background-color: #eff6ff;
    color: #0c2340;
    border-left-color: #0ea5e9;
}

.alert i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.alert-dismissible .btn-close {
    padding: 0;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.alert-dismissible .btn-close:hover {
    opacity: 1;
}

/* ===== FORM ===== */
.login-form form {
    width: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-label i {
    margin-right: 0.4rem;
    color: var(--primary-color);
}

.form-control {
    background-color: var(--bg-light);
    border: 2px solid var(--border-color);
    padding: 0.85rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: inherit;
    width: 100%;
    display: block;
}

.form-control::placeholder {
    color: #cbd5e1;
    opacity: 1;
}

.form-control:focus {
    background-color: var(--bg-white);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: 0;
}

.form-control:hover:not(:focus) {
    border-color: #cbd5e1;
    background-color: #f9fbfd;
}

.position-relative {
    position: relative;
}

.btn-sm {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    background-color: transparent;
    color: var(--text-secondary);
    border: 0;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-sm:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

/* ===== FORM CHECK ===== */
.form-check {
    display: flex;
    align-items: center;
    margin: 0;
}

.form-check-input {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 0.6rem;
    margin-top: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--bg-white);
    flex-shrink: 0;
}

.form-check-input:hover {
    border-color: var(--primary-color);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-check-label {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0;
    cursor: pointer;
}

/* ===== FORM FOOTER ===== */
.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.forgot-link {
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 600;
}

.forgot-link:hover {
    color: var(--primary-dark);
}

/* ===== BUTTONS ===== */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 0;
    cursor: pointer;
    display: inline-block;
}

.d-grid {
    display: grid;
    width: 100%;
}

.d-grid .btn {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    box-shadow: var(--shadow-md);
    padding: 0.95rem 1.75rem;
    font-size: 1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-dark) 0%, #0891b2 100%);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

.btn-primary:focus {
    box-shadow: var(--shadow-lg), 0 0 0 3px rgba(37, 99, 235, 0.2);
    outline: 0;
}

.btn-lg {
    padding: 0.95rem 1.75rem;
    font-size: 1rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-close {
    padding: 0;
    background: transparent;
    border: 0;
    opacity: 0.6;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    transition: opacity 0.3s ease;
}

.btn-close:hover {
    opacity: 1;
}

/* ===== FOOTER ===== */
.login-footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2rem;
    font-weight: 500;
}

.login-footer p {
    margin: 0;
}

.login-footer a {
    color: var(--primary-color);
}

.login-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== RIGHT SIDE ===== */
.right-side {
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

.right-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.right-side:hover img {
    transform: scale(1.05);
}

.right-side::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    pointer-events: none;
}

/* ===== ACCESSIBILITY ===== */
.mb-3 {
    margin-bottom: 1rem;
}

.translate-middle-y {
    transform: translateY(-50%);
}

.end-0 {
    right: 0;
}

.me-2 {
    margin-right: 0.5rem;
}

.top-50 {
    top: 50%;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .login-form {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .right-side {
        display: none !important;
    }

    .left-side {
        padding: 2.5rem 1.75rem;
    }

    .login-head h4 {
        font-size: 1.5rem;
    }

    .form-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .left-side {
        padding: 2rem 1.25rem;
    }

    .login-head h4 {
        font-size: 1.25rem;
    }

    .login-head .logo-img {
        width: 90px;
    }

    .form-label {
        font-size: 0.8rem;
    }

    .form-control {
        padding: 0.75rem 0.9rem;
        font-size: 0.9rem;
    }

    .btn-lg {
        padding: 0.85rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* ===== ACCESSIBILITY - REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== AUTH MODERN POLISH (NON-BREAKING OVERRIDES) ===== */
:root {
    --auth-bg-1: #eef2ff;
    --auth-bg-2: #e0e7ff;
    --auth-bg-3: #c7d2fe;
}

body {
    background: radial-gradient(circle at top left, var(--auth-bg-1) 0%, var(--auth-bg-2) 44%, var(--auth-bg-3) 100%);
}

.login-page,
.forgot-form {
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 22px 50px rgba(30, 41, 59, 0.16);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.93);
    backdrop-filter: blur(6px);
}

.forgot-page {
    width: 100%;
    max-width: 560px;
}

.forgot-form .left-side {
    padding: 2.5rem 2.25rem;
}

.login-head h4 {
    letter-spacing: -0.02em;
}

.form-control {
    border-radius: 12px;
    background: #fbfdff;
}

.form-control:focus {
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.14);
    border-color: #818cf8;
}

.btn-primary {
    border-radius: 12px;
    background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4338ca 0%, #1d4ed8 100%);
}

.right-side::after {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.18) 0%, rgba(79, 70, 229, 0.25) 100%);
}

@media (max-width: 768px) {
    .login-page,
    .forgot-form {
        border-radius: 16px;
    }

    .forgot-form .left-side {
        padding: 2rem 1.4rem;
    }
}
