/* Lightweight Login Styles */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #f3f4f6;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* Flash Messages */
.alert {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-info,
.alert-notice {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.alert-danger,
.alert-alert,
#error_explanation {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

#error_explanation h2 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 10px;
}

#error_explanation ul {
    margin: 0;
    padding-left: 20px;
}

/* Split Screen Layout */
.split-screen-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Left Side: Branding */
.brand-side {
    flex: 1;
    position: relative;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    color: white;
    overflow: hidden;
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

.brand-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('https://images.unsplash.com/photo-1557821552-17105176677c?ixlib=rb-4.0.3&auto=format&fit=crop&w=1600&q=80') center/cover no-repeat;
    opacity: 0.1;
    mix-blend-mode: overlay;
    z-index: 1;
}

.brand-glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 60px 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 2;
    max-width: 450px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brand-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 30px;
    animation: float 4s ease-in-out infinite;
}

.brand-logo {
    font-size: 96px;
    font-weight: 700;
    line-height: 1;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.2));
}

.brand-logo-img {
    max-height: 160px;
    width: auto;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.2));
}

.brand-name {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -1px;
    text-transform: uppercase;
    background: linear-gradient(to bottom, #ffffff, #e2e8f0);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.brand-content h1 {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 24px;
}

.brand-content p {
    font-size: 18px;
    line-height: 1.6;
    opacity: 0.9;
}

/* Right Side: Form */
.form-side {
    width: 50%;
    max-width: 600px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background-color: #ffffff;
    padding: 15px 15px 15px 15px;
    /* Top aligned with 80px padding */
}

.auth-wrapper {
    width: 100%;
    max-width: 360px;
    /* Reduced from 400px */
}

.login-card {
    width: 100%;
}

.card-header {
    text-align: center;
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 24px;
    /* Reduced from 28px */
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-dark);
}

.text-muted {
    color: var(--text-muted);
    font-size: 13px;
    /* Reduced from 14px */
    margin: 0;
}

/* Form Styles */
.form-group {
    margin-bottom: 25px;
    position: relative;
    /* Increased from 12px to reserve space for absolute error message */
}

.form-label {
    display: block;
    font-size: 13px;
    /* Reduced from 14px */
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i:not(.password-eye),
.input-group-custom i:not(.password-eye) {
    position: absolute;
    left: 14px;
    top: 21px;
    /* Fixed center position based on 42px input height */
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.password-eye {
    position: absolute;
    right: 14px;
    top: 21px;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 5;
    color: var(--text-muted);
    transition: color 0.2s;
    pointer-events: auto !important;
    font-size: 14px;
}

.password-eye:hover {
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    padding: 10px 14px 10px 40px;
    /* Reduced padding */
    border: 1px solid var(--border-color);
    border-radius: 6px;
    /* Slightly tighter radius */
    font-size: 14px;
    transition: all 0.2s;
    box-sizing: border-box;
    color: var(--text-dark);
    background-color: #f9fafb;
    height: 42px;
    /* Explicit height control */
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.login-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    padding: 10px;
    /* Reduced from 14px */
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    /* Reduced from 16px */
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 8px;
}

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

.simple-footer {
    margin-top: 40px;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}

/* SSO Focus Styles */
.sso-section {
    margin-top: 20px;
}

.btn-google-sso-custom {
    background-color: #fff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-google-sso-custom:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

/* Responsive */
@media (max-width: 900px) {
    .brand-side {
        display: none;
        /* Hide branding on mobile/tablet */
    }

    .form-side {
        width: 100%;
        max-width: 100%;
        background-color: #f3f4f6;
        /* Use light grey background on mobile */
    }

    .auth-wrapper {
        background: white;
        padding: 30px;
        border-radius: 12px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }
}

/* Validation Styles */
.form-control.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5zM6 8.2af.6.6 0 110-1.2.6.6 0 010 1.2z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Adjust for password toggle icon when invalid */
.input-with-icon .form-control.is-invalid,
.input-group-custom .form-control.is-invalid {
    padding-right: 64px !important;
}

.form-control.is-invalid~.password-eye {
    right: 38px !important;
}

.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.invalid-feedback {
    display: none;
    position: absolute;
    bottom: -18px;
    left: 0;
    width: 100%;
    margin-top: 0;
    font-size: 0.75rem;
    color: #dc3545;
}

/* Show feedback when sibling input is invalid */
.form-control.is-invalid~.invalid-feedback {
    display: block;
}
