/**
 * Login Screen Styles
 * SEVOCOMM MTA - Background Carousel + Branding
 */

/* CSS Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #0066cc;
    --primary-hover: #0052a3;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --text-light: #ffffff;
    --text-dark: #212529;
    --card-bg: rgba(255, 255, 255, 0.40);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    --input-border: #ced4da;
    --input-focus: #80bdff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Background Carousel Layers */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    will-change: opacity;
    transition: opacity 1000ms ease-in-out;
    z-index: 0;
}

.bg-layer.active {
    opacity: 1;
}

/* Auth Container */
.auth-layout {
    margin: 0;
    padding: 0;
}

.auth-container {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* Auth Card */
.auth-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 40px;
    max-width: 440px;
    width: 100%;
}

/* Auth Header */
.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    height: 48px;
    margin-bottom: 16px;
    object-fit: contain;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.auth-header p {
    font-size: 14px;
    color: #6c757d;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-group input:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.form-group small {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 12px 24px;
    font-size: 15px;
    line-height: 1.5;
    border-radius: 6px;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
}

.btn-primary {
    color: var(--text-light);
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

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

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.btn-block {
    display: block;
    width: 100%;
}

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

.alert-error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #dee2e6;
}

.auth-footer p {
    font-size: 13px;
    color: #6c757d;
    margin: 0;
}

/* Accessibility - Focus Styles */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-card {
        padding: 24px;
        border-radius: 0;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .auth-header h1 {
        font-size: 24px;
    }

    .auth-logo {
        height: 40px;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 0;
    }

    .auth-card {
        max-width: 100%;
        box-shadow: none;
        background: var(--card-bg);
    }

    .form-group input {
        padding: 10px 14px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .btn {
        padding: 10px 20px;
    }
}

/* Loading State */
.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Form Validation States */
.form-group input.is-invalid {
    border-color: var(--danger-color);
}

.form-group input.is-invalid:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

.form-group input.is-valid {
    border-color: var(--success-color);
}

.form-group input.is-valid:focus {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.25);
}

/* WCAG AA Compliance - Ensure sufficient contrast */
.auth-card {
    /* Card must have minimum 4.5:1 contrast ratio against text */
    color: #212529; /* Ensures AA compliance */
}

/* Keyboard Navigation Enhancement */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .bg-layer {
        transition: none;
    }

    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .auth-card {
        border: 2px solid var(--text-dark);
    }

    .btn-primary {
        border: 2px solid var(--text-dark);
    }
}
