/* Login Responsive Styles for Bootstrap 5 - Universal Assistance Theme */

/* Base styles - Universal Assistance Color Scheme with White Background */
.login-layout {
    font-family: 'Ubuntu', sans-serif;
    background: #ffffff; /* Fundo branco */
    min-height: 100vh;
}

/* Card improvements */
.login-card {
    box-shadow: 0 10px 30px rgba(0, 74, 164, 0.2);
    border-radius: 15px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 1);
    border: 1px solid rgba(0, 74, 164, 0.1);
}

.login-card-header {
    background: #6c757d;
    border: none;
    padding: 2rem;
}

/* Button styles - Universal Assistance Blue */
.btn-login {
    background: #004ba4;
    border: none;
    border-radius: 10px;
    font-weight: 500;
    padding: 12px 24px;
    transition: all 0.3s ease;
    min-height: 48px; /* Touch-friendly minimum height */
    color: #fff;
}

.btn-login:hover {
    background: #003d87;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 74, 164, 0.3);
    color: #fff;
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:focus {
    background: #004ba4;
    box-shadow: 0 0 0 0.2rem rgba(0, 74, 164, 0.25);
    color: #fff;
}

/* Form controls */
.form-control-login {
    border-radius: 10px;
    border: 1px solid #cce7ff;
    padding: 12px 16px;
    transition: all 0.3s ease;
    min-height: 48px; /* Touch-friendly minimum height */
    font-size: 16px; /* Prevents zoom on iOS */
    background-color: #ffffff;
}

.form-control-login:focus {
    border-color: #004ba4;
    box-shadow: 0 0 0 0.2rem rgba(0, 74, 164, 0.15);
    outline: none;
    background-color: #ffffff;
}

.input-group-text-login {
    border-radius: 10px 0 0 10px;
    border: 1px solid #cce7ff;
    background-color: #f0f8ff;
    color: #004ba4;
    min-height: 48px;
    display: flex;
    align-items: center;
}

/* Toast improvements */
.toast-custom {
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 74, 164, 0.1);
    background-color: #ffffff;
}

.toast-custom.border-primary {
    border-left: 4px solid #004ba4;
}

.toast-custom.border-success {
    border-left: 4px solid #28a745;
}

.toast-custom.border-danger {
    border-left: 4px solid #dc3545;
}

.toast-custom.border-warning {
    border-left: 4px solid #ffc107;
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.fade-out {
    animation: fadeOut 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Loading spinner */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    z-index: 1000;
}

.spinner-border {
    color: #004ba4;
}

/* Links and text colors */
a {
    color: #004ba4;
    text-decoration: none;
}

a:hover {
    color: #003d87;
    text-decoration: underline;
}

.text-primary {
    color: #004ba4 !important;
}

.text-secondary {
    color: #6c757d !important;
}

/* Form validation states */
.form-control-login.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15);
    background-color: #ffffff;
}

.form-control-login.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.15);
    background-color: #ffffff;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .login-layout {
        background: #ffffff; /* Manter fundo branco em mobile */
    }
    
    .login-card {
        margin: 15px;
        border-radius: 10px;
        box-shadow: 0 8px 25px rgba(0, 74, 164, 0.15);
        background: #ffffff;
    }
    
    .login-card-header {
        padding: 1.5rem;
        background: #6c757d;
    }
    
    .card-body {
        padding: 1.5rem !important;
        background: #ffffff;
    }
    
    /* Larger touch targets */
    .btn-login {
        min-height: 50px;
        font-size: 16px;
    }
    
    .form-control-login {
        min-height: 50px;
        font-size: 16px; /* Prevents zoom on iOS */
        background-color: #ffffff;
    }
    
    .input-group-text-login {
        min-height: 50px;
    }
    
    /* Better spacing on mobile */
    .mb-3 {
        margin-bottom: 1.5rem !important;
    }
    
    .mb-4 {
        margin-bottom: 2rem !important;
    }
    
    /* Toast positioning for mobile */
    .toast-container {
        position: fixed !important;
        top: 20px !important;
        left: 20px !important;
        right: 20px !important;
        bottom: auto !important;
        z-index: 1060;
    }
    
    .toast-custom {
        width: 100% !important;
        max-width: none !important;
        background-color: #ffffff;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    .login-card {
        margin: 10px;
        border-radius: 8px;
        background: #ffffff;
    }
    
    .login-card-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem !important;
        background: #ffffff;
    }
    
    /* Stack elements vertically with better spacing */
    .d-grid.gap-2.d-md-flex {
        gap: 0.75rem !important;
    }
    
    .d-grid.gap-2.d-md-flex .btn {
        width: 100%;
        margin: 0;
    }
    
    /* Logo adjustments */
    .img-fluid {
        max-height: 60px !important;
    }
    
    /* System requirements - hide on very small screens */
    .system-requirements {
        display: none !important;
    }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .login-card-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem !important;
        background: #ffffff;
    }
    
    .mb-3 {
        margin-bottom: 0.75rem !important;
    }
    
    .mb-4 {
        margin-bottom: 1rem !important;
    }
    
    .img-fluid {
        max-height: 40px !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-control-login {
        border: 2px solid #004ba4;
        background-color: #ffffff;
    }
    
    .form-control-login:focus {
        border-color: #004ba4;
        box-shadow: 0 0 0 3px rgba(0, 74, 164, 0.3);
        background-color: #ffffff;
    }
    
    .btn-login {
        border: 2px solid #004ba4;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .btn-login:hover {
        transform: none;
    }
}

/* Dark mode support - adapted for Universal Assistance with white base */
@media (prefers-color-scheme: dark) {
    .login-layout {
        background: #f8f9fa; /* Fundo muito claro, quase branco */
    }
    
    .login-card {
        background: #ffffff;
        color: #212529;
        box-shadow: 0 10px 30px rgba(0, 74, 164, 0.3);
        border: 1px solid rgba(0, 74, 164, 0.2);
    }
    
    .form-control-login {
        background-color: #ffffff;
        border-color: #cce7ff;
        color: #212529;
    }
    
    .form-control-login:focus {
        background-color: #ffffff;
        border-color: #004ba4;
        color: #212529;
    }
    
    .input-group-text-login {
        background-color: #f0f8ff;
        border-color: #cce7ff;
        color: #004ba4;
    }
    
    .card-body {
        background-color: #ffffff;
    }
    
    .toast-custom {
        background-color: #ffffff;
        color: #212529;
    }
}

/* Print styles */
@media print {
    .login-card {
        box-shadow: none;
        border: 1px solid #004ba4;
        background: #ffffff;
    }
    
    .login-card-header {
        background: #ffffff !important;
        color: #004ba4 !important;
    }
    
    .btn-login {
        background: #ffffff !important;
        color: #004ba4 !important;
        border: 1px solid #004ba4;
    }
    
    .login-layout {
        background: #ffffff;
    }
}

/* Focus improvements for accessibility */
.form-control-login:focus,
.btn-login:focus {
    outline: 2px solid #004ba4;
    outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #6c757d;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
    color: #fff;
}

/* Loading states */
.btn-loading {
    position: relative;
    pointer-events: none;
    background: #6c757d;
}

.btn-loading .spinner-border-sm {
    width: 1rem;
    height: 1rem;
    color: #fff;
}

/* Error states */
.form-control-error {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
    background-color: #ffffff;
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Success states */
.form-control-success {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
    background-color: #ffffff;
}

.success-message {
    color: #28a745;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Special styling for Universal Assistance brand */
.login-card-header h4 {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Captcha styling */
.cf-turnstile {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

/* Custom checkbox and radio styling for Universal Assistance */
.form-check-input:checked {
    background-color: #004ba4;
    border-color: #004ba4;
}

.form-check-input:focus {
    border-color: #004ba4;
    box-shadow: 0 0 0 0.25rem rgba(0, 74, 164, 0.25);
}

/* Tooltip styling */
[data-bs-toggle="tooltip"] {
    color: #6c757d;
    cursor: help;
}

[data-bs-toggle="tooltip"]:hover {
    color: #004ba4;
}

/* System requirements card styling */
.system-requirements .card {
    border: 1px solid #cce7ff;
    background: rgba(240, 248, 255, 0.8);
}

.system-requirements .card-body {
    color: #004ba4;
}

/* Universal Assistance specific brand elements */
.ua-brand-accent {
    color: #004ba4;
}

.ua-bg-primary {
    background-color: #004ba4;
}

.ua-bg-secondary {
    background-color: #0066cc;
}

.ua-border-primary {
    border-color: #004ba4;
}

/* White background utilities */
.bg-white-important {
    background-color: #ffffff !important;
}

.card-white {
    background-color: #ffffff;
    border: 1px solid rgba(0, 74, 164, 0.1);
}

/* Ensure all form elements have white background */
input[type="text"], 
input[type="password"], 
input[type="email"], 
select, 
textarea {
    background-color: #ffffff !important;
}

input[type="text"]:focus, 
input[type="password"]:focus, 
input[type="email"]:focus, 
select:focus, 
textarea:focus {
    background-color: #ffffff !important;
}