/* Modern Sign-in Page Styles */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #059669;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --light-gray: #f8fafc;
    --medium-gray: #e2e8f0;
    --dark-gray: #475569;
    --white: #ffffff;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #182f93 0%, #636363 100%);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Login Container */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.login-container .row {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    max-width: 950px;
    width: 100%;
    max-height: 85vh;
}

/* Left Side - Branding */
.left-side {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.left-side::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url('../img/Pagb.png') center/cover;
    opacity: 0.1;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(1deg); }
}

.brand-content {
    position: relative;
    z-index: 2;
}

.logo-section {
    margin-bottom: 30px;
}

.logo-img {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.brand-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.brand-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.features-list {
    margin-top: 30px;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.feature-item i {
    font-size: 1.2rem;
    margin-right: 15px;
    color: #fbbf24;
}

/* Right Side - Form */
.login-form-container {
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.mobile-logo {
    text-align: center;
    margin-bottom: 20px;
}

.mobile-logo-img {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
}

.mobile-logo h3 {
    color: var(--primary-color);
    font-weight: 700;
    margin: 0;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-gray);
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--secondary-color);
    font-size: 1rem;
    margin-bottom: 0;
}

/* Form Styles */
.login-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

/* Form sections */
.form-section {
    margin-bottom: 35px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.section-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--medium-gray);
}

.section-title {
    font-size: 0.9rem; /* Smaller font size for section titles */
    font-weight: 600;
}

/* Row spacing for grid layout */
.login-form .row {
    margin-bottom: 15px;
}

.login-form .row:last-child {
    margin-bottom: 0;
}

.form-label {
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 3px; /* Reduced margin for a tighter layout */
    display: block;
    font-size: 0.7rem; /* Smaller font size */
}

.form-label i {
    margin-right: 6px;
    color: var(--primary-color);
    font-size: 0.85rem;
}

.form-control {
    border: 2px solid var(--medium-gray);
    border-radius: 6px; /* Reduced border radius for a tighter box */
    padding: 5px 8px; /* Reduced padding for smaller input box */
    font-size: 0.75rem; /* Smaller font size */
    transition: var(--transition);
    background-color: var(--light-gray);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background-color: var(--white);
    outline: none;
}

/* Select dropdown styling */
select.form-control {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Form validation states */
.form-control.is-invalid {
    border-color: var(--danger-color);
    background-color: #fef2f2;
}

.form-control.is-valid {
    border-color: var(--success-color);
    background-color: #ecfdf5;
}

/* Form text styling */
.form-text {
    font-size: 0.75rem;
    margin-top: 5px;
    display: block;
}

.text-muted {
    color: var(--secondary-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.password-input-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: var(--transition);
}

.password-toggle:hover {
    color: var(--primary-color);
    background-color: var(--light-gray);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 10px;
}

.form-check-label {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.forgot-password:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.login-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--white);
    width: 100%;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
}

.btn {
    padding: 6px 12px; /* Reduced padding for buttons */
    font-size: 0.75rem; /* Smaller font size */
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1e40af 100%);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn i {
    margin-right: 8px;
}

/* Footer */
.login-footer {
    text-align: center;
}

.login-footer p {
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.signup-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.signup-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.back-home {
    margin-top: 15px;
}

.back-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

.back-link:hover {
    color: var(--primary-color);
}

.back-link i {
    margin-right: 5px;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-light);
}

.alert i {
    margin-right: 8px;
}

.alert-success {
    background-color: #ecfdf5;
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: #fef2f2;
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background-color: #fffbeb;
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .login-container {
        padding: 10px;
    }
    
    .login-form-container {
        padding: 40px 30px;
    }
    
    .login-title {
        font-size: 2rem;
    }
    
    .brand-title {
        font-size: 2rem;
    }
}

@media (max-width: 575.98px) {
    .login-form-container {
        padding: 30px 20px;
    }
    
    .login-title {
        font-size: 1.75rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    /* Stack form fields on mobile */
    .login-form .row .col-md-6 {
        margin-bottom: 15px;
    }
}

/* Loading Animation */
.login-btn.loading {
    position: relative;
    color: transparent;
}

.login-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Focus improvements for accessibility */
.form-control:focus,
.login-btn:focus,
.password-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Smooth transitions */
* {
    transition: var(--transition);
}

/* Hide the footer links on Steps 2 and 3 */
.form-step#form-step-2 .registration-footer,
.form-step#form-step-3 .registration-footer {
    display: none;
}
