/* Professional Login Page Design */

/* Login Card Styles */
.login-card {
    max-width: 1200px; 
    width: 100%;
    height: auto;
}

/* Ensure proper flex layout on all screens */
.login-card .row {
    height: auto;
}

.login-card .col-lg-6 {
    height: auto;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow-x: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Left Panel - Branding Section */
.bg-primary-section {
    background: linear-gradient(135deg, #000032 0%, #1a1a5e 50%, #000032 100%);
    position: relative;
}

.bg-primary-section::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 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.brand-logo {
    height: 4rem;
    width: auto;
    margin: 0 auto;
    filter: drop-shadow(0 0.25rem 0.5rem rgba(0, 0, 0, 0.3));
}

.bg-primary-section h1 {
    font-weight: 700;
    font-size: 1.8rem;
    text-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.bg-primary-section .lead {
    font-size: 1rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.feature-list {
    position: relative;
    z-index: 1;
    margin-top: 3rem;
}

.feature-item {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.feature-item:hover {
    opacity: 1;
    transform: translateX(0.25rem);
}

.feature-item i {
    font-size: 1.3rem;
    color: #ffd700;
}

/* Right Panel - Form Section */
.bg-light-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 70vh;
}

.max-width-form {
    max-width: 28rem;
}

.text-primary {
    color: #000032 !important;
}

.text-muted {
    color: #6c757d !important;
}

/* Form Styling */
.form-floating > .form-control {
    height: 3.2rem;
    border: 2px solid #dee2e6;
    border-radius: 0.75rem !important;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-floating > .form-control:focus {
    border-color: #000032;
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 50, 0.15);
}

.form-floating > .form-control:not(:placeholder-shown) {
    border-color: #000032;
}

.form-floating > label {
    color: #6c757d;
    font-weight: 500;
    padding-left: 1rem;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: #000032;
    font-weight: 600;
}

/* Button Styling */
.btn-primary {
    background: linear-gradient(135deg, #000032 0%, #1a1a5e 100%);
    border: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.75rem 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 50, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1a1a5e 0%, #000032 100%);
    transform: translateY(-0.125rem);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 50, 0.3);
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 50, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Alert Styling */
.alert-danger {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border: 1px solid #fc8181;
    color: #c53030;
    font-weight: 500;
}

.alert-danger i {
    color: #e53e3e;
}

/* Mobile Responsiveness */
@media (max-width: 991.98px) {
    .bg-primary-section {
        min-height: 50vh;
        display: flex !important;
        align-items: center !important;
    }
    
    .bg-light-section {
        min-height: 50vh;
    }
    
    .brand-logo {
        height: 4rem;
    }
    
    .bg-primary-section h1 {
        font-size: 2rem;
    }
    
    .bg-primary-section .lead {
        font-size: 1.1rem;
    }
    
    .feature-list {
        margin-top: 2rem;
    }
    
    .feature-item {
        font-size: 1rem;
        margin-bottom: 1rem !important;
    }
    
    .max-width-form {
        max-width: 100%;
        padding: 2rem !important;
    }
}

@media (max-width: 767.98px) {
    .bg-primary-section {
        min-height: 40vh;
        padding: 2rem 1rem !important;
    }
    
    .brand-logo {
        height: 3rem;
        margin-bottom: 1.5rem !important;
    }
    
    .bg-primary-section h1 {
        font-size: 1.75rem;
        margin-bottom: 1rem !important;
    }
    
    .bg-primary-section .lead {
        font-size: 1rem;
        margin-bottom: 1.5rem !important;
    }
    
    .feature-list {
        margin-top: 1rem;
    }
    
    .feature-item {
        font-size: 0.9rem;
        margin-bottom: 0.75rem !important;
    }
    
    .max-width-form {
        padding: 1.5rem !important;
    }
    
    .form-floating > .form-control {
        height: 3.5rem;
        font-size: 1rem;
    }
    
    .btn-primary {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .bg-primary-section {
        min-height: 35vh;
        padding: 1.5rem 1rem !important;
    }
    
    .brand-logo {
        height: 2.5rem;
    }
    
    .bg-primary-section h1 {
        font-size: 1.5rem;
    }
    
    .feature-list {
        display: none;
    }
    
    .max-width-form {
        padding: 1rem !important;
    }
}

/* Loading Animation */
.btn-primary.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-primary.loading::after {
    content: "";
    width: 1rem;
    height: 1rem;
    margin-left: 0.5rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smooth entrance animations */
.bg-primary-section > div {
    animation: slideInLeft 0.8s ease-out;
}

.bg-light-section > div {
    animation: slideInRight 0.8s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-2rem);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(2rem);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
    margin: 2rem;
}

.login-container {
    display: contents;
}

/* Header Section - Left Branding Panel */
.login-header {
    background: #003f7f;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 2rem;
    color: white;
    position: relative;
}

.login-header::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 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="0.5" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    opacity: 0.3;
}

.brand-logo {
    width: 7.5rem;
    height: 7.5rem;
    margin-bottom: 2rem;
    border-radius: 1.25rem;
    overflow: hidden;
    border: 0.25rem solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(0.625rem);
    position: relative;
    z-index: 1;
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-info {
    text-align: center;
    position: relative;
    z-index: 1;
}

.brand-info .brand-title {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 1rem 0;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.brand-info .brand-subtitle {
    font-size: 1rem;
    margin: 0;
    font-weight: 400;
    opacity: 0.9;
    letter-spacing: 0.025em;
}

/* Login Card - Right Form Panel */
.login-card {
    background: white;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.login-form-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-form-header .form-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
    letter-spacing: -0.025em;
}

.login-form-header .form-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 400;
}

/* Form Styling */
.login-form .input-group {
    margin-bottom: 2rem;
    position: relative;
}

/* Input and Button Container Alignment */
.login-form {
    width: 100%;
}

.input-group {
    margin-bottom: 1.5rem;
    width: 100%;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-wrapper .input-icon {
    position: absolute;
    left: 1.25rem;
    color: var(--text-secondary);
    font-size: 1rem;
    z-index: 2;
    transition: color 0.3s ease;
}

.input-wrapper.focused .input-icon {
    color: var(--accent-color);
}

.input-wrapper .form-control {
    width: 100% !important;
    height: 3.5rem;
    padding: 1.25rem 1.25rem 1.25rem 3.25rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: #f8fafc;
    border: 0.125rem solid #e2e8f0;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box !important;
    margin: 0;
    flex: none;
}

.input-wrapper .form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.1875rem rgba(59, 130, 246, 0.1);
    background-color: white;
}

.input-wrapper .form-control::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.input-wrapper.focused .form-control::placeholder,
.input-wrapper .form-control:focus::placeholder {
    opacity: 0;
}

.input-wrapper label {
    position: absolute;
    left: 3.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--text-secondary);
    pointer-events: none;
    transition: all 0.3s ease;
    background: transparent;
    padding: 0;
    z-index: 1;
}

.input-wrapper.focused label,
.input-wrapper .form-control:focus + label,
.input-wrapper .form-control:not(:placeholder-shown) + label {
    top: -0.5rem;
    left: 2.75rem;
    font-size: 0.8rem;
    color: var(--accent-color);
    font-weight: 600;
    background: white;
    padding: 0 0.5rem;
    border-radius: 0.25rem;
    z-index: 2;
}

/* Button Styling - Match Input Width */
.btn-login {
    width: 100% !important;
    padding: 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    border: 0.125rem solid transparent;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.5rem 0 0 0;
    text-transform: uppercase;
    letter-spacing: 0.03125rem;
    box-sizing: border-box !important;
    height: 3.5rem;
    flex: none;
}

.btn-login:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.75rem 1.5rem rgba(59, 130, 246, 0.4);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 0.375rem 0.75rem rgba(59, 130, 246, 0.3);
}

.btn-login:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Alert Styling */
.alert-danger {
    background: #fef2f2;
    border: 0.0625rem solid #fecaca;
    color: var(--danger-color);
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Enhanced Responsive Design */
@media (max-width: 1024px) {
    .login-wrapper {
        max-width: 50rem;
        margin: 1.5rem;
    }
    
    .login-header,
    .login-card {
        padding: 2.5rem 2rem;
    }
}

@media (max-width: 768px) {
    .login-wrapper {
        grid-template-columns: 1fr;
        margin: 1rem;
        max-width: none;
        min-height: auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .login-header {
        padding: 1.5rem;
        order: 1;
        text-align: center;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
        order: 2;
    }
    
    .brand-logo {
        width: 5rem;
        height: 5rem;
        margin-bottom: 1.5rem;
    }
    
    .brand-info .brand-title {
        font-size: 1.5rem;
    }
    
    .brand-info .brand-subtitle {
        font-size: 0.9rem;
    }
    
    .login-form-header .form-title {
        font-size: 1.5rem;
    }
    
    .login-form-header .form-subtitle {
        font-size: 0.9rem;
    }
    
    .input-wrapper .form-control {
        height: 3.25rem;
        padding: 1rem 1rem 1rem 3rem;
        font-size: 0.9rem;
    }
    
    .input-wrapper .input-icon {
        left: 1rem;
        font-size: 0.9rem;
    }
    
    .input-wrapper label {
        left: 3rem;
        font-size: 0.9rem;
    }
    
    .input-wrapper.focused label,
    .input-wrapper .form-control:focus + label,
    .input-wrapper .form-control:not(:placeholder-shown) + label {
        left: 2.5rem;
        font-size: 0.75rem;
    }
    
    .btn-login {
        padding: 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    body {
        padding: 0.5rem;
    }
    
    .login-wrapper {
        margin: 0;
        border-radius: 0.75rem;
        min-height: calc(100vh - 1rem);
        max-height: calc(100vh - 1rem);
        overflow-y: auto;
    }
    
    .login-header,
    .login-card {
        padding: 1.25rem;
    }
    
    .login-header {
        padding-bottom: 1rem;
    }
    
    .brand-logo {
        width: 3.5rem;
        height: 3.5rem;
        margin-bottom: 0.75rem;
    }
    
    .brand-info .brand-title {
        font-size: 1.125rem;
        line-height: 1.3;
    }
    
    .brand-info .brand-subtitle {
        font-size: 0.8rem;
    }
    
    .login-form-header {
        margin-bottom: 1.5rem;
        text-align: center;
    }
    
    .login-form-header .form-title {
        font-size: 1.125rem;
    }
    
    .login-form-header .form-subtitle {
        font-size: 0.8rem;
    }
    
    .login-form .input-group {
        margin-bottom: 1.25rem;
    }
    
    .input-wrapper .form-control {
        height: 3.25rem;
        padding: 1rem 1rem 1rem 3rem;
        font-size: 1rem; /* Prevent zoom on iOS */
        border-radius: 0.75rem;
    }
    
    .input-wrapper .input-icon {
        left: 1rem;
        font-size: 0.9rem;
    }
    
    .input-wrapper label {
        left: 3rem;
        font-size: 0.9rem;
    }
    
    .input-wrapper.focused label,
    .input-wrapper .form-control:focus + label,
    .input-wrapper .form-control:not(:placeholder-shown) + label {
        left: 2.5rem;
        font-size: 0.75rem;
    }
    
    .btn-login {
        padding: 1rem;
        font-size: 0.9rem;
        margin-top: 0.5rem;
        border-radius: 0.75rem;
        min-height: 3.25rem;
    }
    
    .alert-danger {
        padding: 0.875rem;
        margin-bottom: 1.25rem;
        font-size: 0.85rem;
        border-radius: 0.75rem;
    }
}

/* Landscape Mobile Optimization */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        padding: 0.5rem;
    }
    
    .login-wrapper {
        grid-template-columns: 1fr 1fr;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .login-header {
        padding: 1rem;
    }
    
    .login-card {
        padding: 1rem 1.5rem;
    }
    
    .brand-logo {
        width: 3rem;
        height: 3rem;
    }
    
    .brand-info .brand-title {
        font-size: 1rem;
    }
    
    .brand-info .brand-subtitle {
        font-size: 0.75rem;
    }
    
    .login-form-header {
        margin-bottom: 1rem;
    }
    
    .login-form .input-group {
        margin-bottom: 1rem;
    }
}

/* Touch Device Optimizations */
@media (pointer: coarse) {
    .btn-login {
        min-height: 3rem;
        touch-action: manipulation;
    }
    
    .input-wrapper .form-control {
        min-height: 3rem;
        touch-action: manipulation;
    }
}