 /* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, rgb(14, 47, 97), #357789);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    /* Improve text rendering */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Container split layout */
.container {
    display: flex;
    width: 100%;
    max-width: 900px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    min-height: 500px;
}

/* Left panel */
.branding-panel {
    flex: 1;
    background: #f8f9fa;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.logo {
    width: 160px;
    height: auto;
    margin-bottom: 20px;
    object-fit: contain;
}

.system-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    text-transform: uppercase;
    line-height: 1.2;
}

.school-name {
    font-size: 30px;
    font-weight: bold;
    color: #007bff;
    margin-top: 10px;
    line-height: 1.2;
}

/* Right panel (login) */
.login-container {
    flex: 1;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-header {
    text-align: center;
    margin-bottom: 25px;
}

.form-header h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 8px;
}

.form-header p {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #444;
    font-weight: 500;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: white;
}

input:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    font-weight: 500;
    min-height: 44px; /* Touch-friendly */
}

.submit-btn:hover {
    background: #005dc7;
    transform: translateY(-1px);
}

.submit-btn:active {
    transform: translateY(0);
}

.signup-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.signup-link a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.signup-link a:hover {
    text-decoration: underline;
}

.error-message {
    color: red;
    font-weight: bold;
    margin-bottom: 10px;
}

.form-error {
    color: red;
    font-weight: bold;
}

.form-warning {
    color: orange;
    font-weight: bold;
}

.form-danger {
    color: darkred;
    font-weight: bold;
}

.login-errors {
    margin-top: 10px;
    margin-bottom: 10px;
}

/* Style the select dropdown to match other form inputs */
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    appearance: none; /* Remove default styling */
    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: 16px;
    padding-right: 40px; /* Make room for the arrow */
    min-height: 44px; /* Touch-friendly */
}

select:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Style the options */
select option {
    padding: 10px;
    background-color: white;
    color: #333;
}

select option:hover {
    background-color: #f8f9fa;
}

/* Disabled state styling */
select:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Enhanced form group styling for better spacing */
.form-group select {
    margin-top: 5px;
}

/* Alternative: If you want a more modern look with custom styling */
.custom-select-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.custom-select-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #666;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 15px;
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .container {
        flex-direction: column;
        max-width: 100%;
        width: 100%;
        min-height: auto;
        max-height: none;
    }
    
    .branding-panel {
        padding: 30px 20px 25px;
        order: 1;
    }
    
    .logo {
        width: 120px;
        margin-bottom: 15px;
    }
    
    .system-title {
        font-size: 20px;
        margin-bottom: 5px;
    }
    
    .school-name {
        font-size: 24px;
        margin-top: 5px;
    }
    
    .login-container {
        padding: 25px 20px 30px;
        order: 2;
    }
    
    .form-header {
        margin-bottom: 20px;
    }
    
    .form-header h2 {
        font-size: 24px;
    }
    
    .form-header p {
        font-size: 13px;
    }
    
    .form-group {
        margin-bottom: 18px;
    }
    
    label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    input[type="text"],
    input[type="password"],
    select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px 12px; /* Slightly larger for better touch */
        min-height: 48px; /* Better touch target */
    }
    
    select {
        padding-right: 40px;
    }
    
    .submit-btn {
        font-size: 16px;
        padding: 14px 12px;
        min-height: 48px;
    }
    
    .signup-link {
        margin-top: 18px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
        padding-top: 15px;
    }
    
    .container {
        border-radius: 8px;
    }
    
    .branding-panel {
        padding: 25px 15px 20px;
    }
    
    .logo {
        width: 100px;
        margin-bottom: 12px;
    }
    
    .system-title {
        font-size: 18px;
        line-height: 1.3;
    }
    
    .school-name {
        font-size: 22px;
        line-height: 1.3;
    }
    
    .login-container {
        padding: 20px 15px 25px;
    }
    
    .form-header h2 {
        font-size: 22px;
    }
    
    .form-header p {
        font-size: 12px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    input[type="text"],
    input[type="password"],
    select {
        padding: 15px 12px;
        border-radius: 4px;
    }
    
    .submit-btn {
        padding: 15px 12px;
        border-radius: 4px;
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    body {
        padding: 8px;
        padding-top: 12px;
    }
    
    .branding-panel {
        padding: 20px 12px 18px;
    }
    
    .system-title {
        font-size: 16px;
    }
    
    .school-name {
        font-size: 20px;
    }
    
    .login-container {
        padding: 18px 12px 22px;
    }
    
    .form-header h2 {
        font-size: 20px;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        align-items: center;
        padding: 10px;
    }
    
    .container {
        flex-direction: row;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .branding-panel {
        padding: 20px 15px;
        flex: 0.8;
    }
    
    .logo {
        width: 80px;
        margin-bottom: 10px;
    }
    
    .system-title {
        font-size: 16px;
    }
    
    .school-name {
        font-size: 20px;
        margin-top: 5px;
    }
    
    .login-container {
        padding: 20px 15px;
        flex: 1.2;
        overflow-y: auto;
    }
    
    .form-header {
        margin-bottom: 15px;
    }
    
    .form-header h2 {
        font-size: 20px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    input[type="text"],
    input[type="password"],
    select {
        padding: 10px;
        min-height: 40px;
    }
    
    .submit-btn {
        padding: 10px;
        min-height: 40px;
    }
}

/* Very small landscape phones */
@media (max-width: 568px) and (orientation: landscape) and (max-height: 400px) {
    .container {
        min-height: auto;
        max-height: 95vh;
    }
    
    .branding-panel {
        padding: 15px 10px;
    }
    
    .logo {
        width: 60px;
        margin-bottom: 8px;
    }
    
    .system-title {
        font-size: 14px;
    }
    
    .school-name {
        font-size: 18px;
    }
    
    .login-container {
        padding: 15px 10px;
    }
    
    .form-header h2 {
        font-size: 18px;
    }
    
    .form-header p {
        font-size: 11px;
    }
    
    .form-group {
        margin-bottom: 10px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .submit-btn,
    input[type="text"],
    input[type="password"],
    select {
        min-height: 44px;
    }
    
    .signup-link a {
        padding: 8px 4px;
        display: inline-block;
    }
}

/* Focus styles for accessibility */
input:focus,
select:focus,
.submit-btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Prevent zoom on iOS when focusing inputs */
@supports (-webkit-touch-callout: none) {
    input[type="text"],
    input[type="password"],
    select {
        font-size: 16px !important;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* You can add dark mode styles here if needed in the future */
