﻿:root {
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --primary-light: #0066ff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-bg: #f5f6fa;
    --white: #ffffff;
    --text-dark: #1a1a1a;
    --text-light: #6c757d;
    --border-color: #dee2e6;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* ============================================================================
   LOGIN CONTAINER
   ============================================================================ */

.login-container {
    display: flex;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    background: var(--white);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    overflow: hidden;
}

/* ============================================================================
   BRAND SECTION (Left Side)
   ============================================================================ */

.login-brand-section {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 4rem 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

    .login-brand-section::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -50%;
        width: 100%;
        height: 100%;
        background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
        background-size: 50px 50px;
        animation: moveBackground 20s linear infinite;
    }

@keyframes moveBackground {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

.brand-content {
    position: relative;
    z-index: 1;
    text-align: center;
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.brand-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.brand-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.brand-tagline {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 3rem;
    font-weight: 500;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: left;
    margin-top: 3rem;
}

.feature-item {
    display: flex;
    gap: 1rem;
    animation: slideInLeft 0.6s ease-out;
    animation-fill-mode: both;
}

    .feature-item:nth-child(1) {
        animation-delay: 0.1s;
    }

    .feature-item:nth-child(2) {
        animation-delay: 0.2s;
    }

    .feature-item:nth-child(3) {
        animation-delay: 0.3s;
    }

.feature-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    transition: all var(--transition);
}

.feature-item:hover .feature-icon {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.feature-item h6 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--white);
}

.feature-item p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0.25rem 0 0 0;
    line-height: 1.4;
}

/* ============================================================================
   FORM SECTION (Right Side)
   ============================================================================ */

.login-form-section {
    flex: 1;
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.login-form-wrapper {
    width: 100%;
    max-width: 400px;
}

.login-header {
    margin-bottom: 2rem;
    text-align: center;
}

    .login-header h2 {
        font-size: 1.75rem;
        font-weight: 700;
        color: var(--text-dark);
        margin-bottom: 0.5rem;
    }

    .login-header p {
        font-size: 1rem;
        color: var(--text-light);
        margin: 0;
    }

/* ============================================================================
   FORM ELEMENTS
   ============================================================================ */

.login-form {
    animation: fadeIn 0.6s ease-out 0.2s backwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.form-group {
    position: relative;
}

.form-label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

    .form-label i {
        color: var(--primary-color);
    }

.form-control,
.form-control-lg,
.input-group .form-control {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all var(--transition);
    background-color: var(--white);
}

    .form-control:focus,
    .form-control-lg:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
        background-color: var(--white);
    }

    .form-control::placeholder,
    .form-control-lg::placeholder {
        color: #adb5bd;
    }

.input-group {
    position: relative;
}

    .input-group .form-control {
        border-right: none;
    }

.password-toggle {
    border-left: none;
    border-color: var(--border-color);
    color: var(--secondary-color);
    transition: all var(--transition);
}

    .password-toggle:hover {
        color: var(--primary-color);
        background-color: #f8f9fa;
    }

.input-group .password-toggle:focus {
    box-shadow: none;
}

.is-invalid {
    border-color: var(--danger-color) !important;
}

.invalid-feedback {
    display: block;
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ============================================================================
   FORM CONTROLS
   ============================================================================ */

.form-check-input {
    width: 1.25em;
    height: 1.25em;
    margin-top: 0.125em;
    cursor: pointer;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    transition: all var(--transition);
}

    .form-check-input:checked {
        background-color: var(--primary-color);
        border-color: var(--primary-color);
        box-shadow: inset 0 3px 4px rgba(0, 0, 0, 0.1);
    }

    .form-check-input:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
    }

.form-check-label {
    color: var(--text-dark);
    font-weight: 500;
    cursor: pointer;
    margin-left: 0.5rem;
}

.forgot-password-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition);
}

    .forgot-password-link:hover {
        color: var(--primary-dark);
        text-decoration: underline;
    }

/* ============================================================================
   BUTTONS
   ============================================================================ */

.login-btn {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    transition: all var(--transition);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

    .login-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
        color: var(--white);
    }

    .login-btn:active {
        transform: translateY(0);
    }

/* ============================================================================
   DIVIDER
   ============================================================================ */

.divider-section {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-light);
    font-weight: 600;
}

    .divider-section::before,
    .divider-section::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--border-color);
    }

    .divider-section span {
        padding: 0 1rem;
        font-size: 0.9rem;
    }

/* ============================================================================
   SOCIAL LOGIN
   ============================================================================ */

.social-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-social {
    border: 2px solid var(--border-color);
    color: var(--text-dark);
    font-weight: 600;
    border-radius: 8px;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

    .btn-social:hover {
        border-color: var(--primary-color);
        color: var(--primary-color);
        background-color: rgba(0, 123, 255, 0.05);
    }

    .btn-social i {
        font-size: 1.1rem;
    }

/* ============================================================================
   SIGNUP SECTION
   ============================================================================ */

.signup-section {
    text-align: center;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.95rem;
}

    .signup-section p {
        margin: 0;
    }

.signup-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition);
}

    .signup-link:hover {
        color: var(--primary-dark);
        text-decoration: underline;
    }

/* ============================================================================
   ALERTS
   ============================================================================ */

.alert {
    border-radius: 8px;
    border: none;
    margin-bottom: 1.5rem;
    animation: slideInDown 0.4s ease-out;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #721c24;
}

    .alert-danger .btn-close {
        filter: invert(0.5);
    }

.alert ul {
    padding-left: 1.5rem;
}

.alert li {
    margin-bottom: 0.25rem;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

    .login-footer p {
        margin: 0.5rem 0;
        font-size: 0.85rem;
    }

    .login-footer a {
        color: var(--primary-color);
        text-decoration: none;
        transition: all var(--transition);
    }

        .login-footer a:hover {
            color: var(--primary-dark);
            text-decoration: underline;
        }

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 992px) {
    .login-container {
        max-height: auto;
        flex-direction: column;
    }

    .login-brand-section {
        padding: 2rem;
        min-height: 250px;
    }

    .brand-content h1 {
        font-size: 2rem;
    }

    .brand-features {
        flex-direction: row;
        gap: 1rem;
    }

    .feature-item {
        flex-direction: column;
        text-align: center;
    }

    .login-form-section {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .login-container {
        border-radius: 8px;
    }

    .login-brand-section {
        display: none;
    }

    .login-form-section {
        padding: 1.5rem;
        flex: 1;
    }

    .login-form-wrapper {
        max-width: 100%;
    }

    .brand-icon-wrapper {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .login-header h2 {
        font-size: 1.5rem;
    }

    .login-header p {
        font-size: 0.9rem;
    }

    .social-login {
        grid-template-columns: 1fr;
    }

    .form-control,
    .form-control-lg {
        padding: 0.65rem 0.875rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 480px) {
    .login-form-section {
        padding: 1rem;
    }

    .login-form-wrapper {
        max-width: 100%;
    }

    .form-group {
        margin-bottom: 1rem !important;
    }

    .login-header {
        margin-bottom: 1.5rem;
    }

        .login-header h2 {
            font-size: 1.25rem;
        }

        .login-header p {
            font-size: 0.85rem;
        }

    .divider-section span {
        padding: 0 0.5rem;
        font-size: 0.8rem;
    }
}

/* ============================================================================
   ANIMATIONS & TRANSITIONS
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2c3e50 0%, #1a1a2e 100%);
    }

    .login-container {
        background: #1a1a2e;
    }

    .login-form-section {
        background: #16213e;
    }

    .login-header h2,
    .form-label {
        color: #f5f5f5;
    }

    .login-header p {
        color: #b0b0b0;
    }

    .form-control,
    .form-control-lg {
        background-color: #2c3e50;
        border-color: #3d5e7a;
        color: #f5f5f5;
    }

        .form-control:focus,
        .form-control-lg:focus {
            background-color: #2c3e50;
            color: #f5f5f5;
        }

    .form-check-label {
        color: #f5f5f5;
    }

    .divider-section {
        color: #b0b0b0;
    }

        .divider-section::before,
        .divider-section::after {
            background: #3d5e7a;
        }

    .login-footer {
        border-top-color: #3d5e7a;
    }

        .login-footer p,
        .signup-section {
            color: #b0b0b0;
        }
}
