/* Estilos da tela de login.
   Extraidos de index.php: eram 742 linhas de CSS inline num arquivo de
   1030 linhas. Ficam AQUI e o <link> entra na mesma posicao onde estava o
   <style>, para o cascade nao mudar. */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --primary-color: #0d6efd;
            --primary-dark: #0b5ed7;
            --secondary-color: #059669;
            --gradient-start: #0f172a;
            --gradient-end: #1e293b;
            --surface-color: #ffffff;
            --surface-secondary: #f8fafc;
            --text-primary: #0f172a;
            --text-secondary: #64748b;
            --border-color: #e2e8f0;
            --success-color: #059669;
            --error-color: #dc2626;
            --warning-color: #d97706;
            --shadow-light: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
            --shadow-medium: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
            --shadow-large: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
            min-height: 100vh;
            height: auto;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0.5rem;
            position: relative;
            overflow: hidden;
        }

        /* Background Animation */
        body::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='m0 40l40-40h-40zm40 0v-40h-40z'/%3E%3C/g%3E%3C/svg%3E") repeat;
        }

        /* Floating Elements */
        .floating-elements {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            overflow: hidden;
        }

        .floating-element {
            position: absolute;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 50%;
            animation: float 15s infinite linear;
        }

        .floating-element:nth-child(1) {
            width: 100px;
            height: 100px;
            top: 20%;
            left: 10%;
            animation-delay: 0s;
        }

        .floating-element:nth-child(2) {
            width: 60px;
            height: 60px;
            top: 50%;
            right: 15%;
            animation-delay: -5s;
        }

        .floating-element:nth-child(3) {
            width: 80px;
            height: 80px;
            bottom: 30%;
            left: 20%;
            animation-delay: -10s;
        }

        @keyframes float {
            0%, 100% {
                transform: translateY(0px) rotate(0deg);
            }
            50% {
                transform: translateY(-20px) rotate(180deg);
            }
        }

        /* Override Bootstrap and maintain compatibility */
        .vh-100 {
            min-height: 100vh !important;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 1rem;
        }

        /* Main Container */
        .login-container {
            background: var(--surface-color);
            border-radius: 2rem;
            box-shadow: var(--shadow-large);
            overflow: hidden;
            width: 100%;
            max-width: 1000px;
            min-height: auto;
            max-height: 95vh;
            display: grid;
            grid-template-columns: 1fr 1fr;
            position: relative;
            z-index: 1;
        }

        /* Left Panel - Brand */
        .brand-panel {
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
            padding: 2rem 1.5rem;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
            color: white;
            position: relative;
            overflow: hidden;
            min-height: auto;
        }

        .brand-panel::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
        }

        .brand-content {
            position: relative;
            z-index: 1;
        }

        .brand-logo {
            width: 80px;
            height: 80px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2rem;
            margin-bottom: 1rem;
            backdrop-filter: blur(10px);
            border: 2px solid rgba(255, 255, 255, 0.2);
        }

        .brand-title {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        .brand-subtitle {
            font-size: 0.95rem;
            opacity: 0.9;
            font-weight: 400;
            line-height: 1.6;
            margin-bottom: 1.5rem;
        }

        .brand-features {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            align-items: flex-start;
        }

        .feature-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            font-size: 0.85rem;
            opacity: 0.9;
        }

        .feature-icon {
            width: 1.5rem;
            height: 1.5rem;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.75rem;
        }

        /* Right Panel - Login Form */
        .login-panel {
            padding: 2rem 1.5rem;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

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

        .osb-logo {
            max-width: 160px;
            height: auto;
            margin-bottom: 1rem;
        }

        .login-title {
            font-size: 1.25rem;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 1rem;
        }

        /* Enhanced Form Styles */
        .modern-form-group {
            margin-bottom: 1rem;
            position: relative;
        }

        .modern-form-label {
            font-weight: 500;
            color: var(--text-primary);
            font-size: 0.9rem;
            margin-bottom: 0.5rem;
            display: block;
        }

        .modern-form-input {
            position: relative;
        }

        .modern-form-input input {
            width: 100%;
            padding: 0.75rem 0.75rem 0.75rem 2.5rem;
            border: 2px solid var(--border-color);
            border-radius: 0.75rem;
            font-size: 1rem;
            transition: all 0.3s ease;
            background: var(--surface-color);
            outline: none;
        }

        .modern-form-input input:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
        }

        .modern-form-input input:invalid {
            border-color: var(--error-color);
        }

        .modern-form-input-icon {
            position: absolute;
            left: 0.75rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-secondary);
            font-size: 1.1rem;
        }

        .password-toggle {
            position: absolute;
            right: 0.75rem;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 1.1rem;
            padding: 0.25rem;
            border-radius: 0.25rem;
            transition: color 0.2s ease;
        }

        .password-toggle:hover {
            color: var(--text-primary);
        }

        /* Enhanced Button Styles */
        .btn-primary {
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
            border: none;
            padding: 0.75rem 1.5rem;
            border-radius: 0.75rem;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            margin-top: 0.25rem;
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-medium);
            background: linear-gradient(135deg, var(--primary-dark) 0%, #047857 100%);
        }

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

        .btn-primary:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        /* Forgot Password Link */
        .forgot-password {
            text-align: center;
            margin-top: 1rem;
        }

        .forgot-password a {
            color: var(--primary-color);
            text-decoration: none;
            font-size: 0.9rem;
            font-weight: 500;
            transition: color 0.2s ease;
        }

        .forgot-password a:hover {
            color: var(--primary-dark);
            text-decoration: underline;
        }

        /* Error Messages - Enhanced */
        .error-message {
            background: rgba(220, 38, 38, 0.1);
            color: var(--error-color);
            padding: 0.75rem;
            border-radius: 0.75rem;
            border: 1px solid rgba(220, 38, 38, 0.2);
            margin-bottom: 1rem;
            font-size: 0.8rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            animation: slideInDown 0.3s ease;
        }

        .error-icon {
            color: var(--error-color);
        }

        /* Loading Spinner */
        .spinner {
            width: 1.25rem;
            height: 1.25rem;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            border-top-color: white;
            animation: spin 1s ease-in-out infinite;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        @keyframes slideInDown {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Scrollbar personalizada para containers pequenos */
        .login-container::-webkit-scrollbar {
            width: 6px;
        }

        .login-container::-webkit-scrollbar-track {
            background: #f1f1f1;
        }

        .login-container::-webkit-scrollbar-thumb {
            background: #c1c1c1;
            border-radius: 3px;
        }

        /* ===== RESPONSIVIDADE PARA MONITORES MENORES ===== */
        
        /* Tablets e monitores pequenos */
        @media (max-width: 1024px) {
            .login-container {
                max-width: 800px;
                max-height: 90vh;
            }

            .brand-panel {
                padding: 1.5rem;
            }

            .login-panel {
                padding: 1.5rem;
            }

            .brand-logo {
                width: 70px;
                height: 70px;
                font-size: 1.75rem;
            }

            .brand-title {
                font-size: 1.75rem;
            }

            .brand-subtitle {
                font-size: 0.9rem;
            }
        }

        /* Tablets em modo portrait */
        @media (max-width: 768px) {
            body {
                padding: 0.25rem;
                min-height: 100vh;
                display: flex;
                align-items: flex-start;
                padding-top: 1rem;
            }

            .vh-100 {
                min-height: auto !important;
                height: auto !important;
            }

            .container {
                height: auto !important;
                min-height: auto !important;
            }

            .h-100 {
                height: auto !important;
                min-height: auto !important;
            }

            .row.d-flex.justify-content-center.align-items-center.h-100 {
                align-items: flex-start !important;
                min-height: auto !important;
                height: auto !important;
            }

            .login-container {
                grid-template-columns: 1fr;
                max-width: 100%;
                width: 100%;
                max-height: none;
                margin-top: 0;
            }

            /* Esconder brand panel em tablets */
            .brand-panel {
                display: none;
            }

            .login-panel {
                padding: 1.5rem;
                justify-content: flex-start;
            }

            .login-header {
                margin-bottom: 1.5rem;
            }

            .osb-logo {
                max-width: 140px;
                margin-bottom: 0.75rem;
            }

            .login-title {
                font-size: 1.1rem;
            }

            .floating-elements {
                display: none;
            }
        }

        /* Smartphones */
        @media (max-width: 480px) {
            body {
                padding: 0.125rem;
                padding-top: 0.5rem;
                background: var(--gradient-start);
            }

            .login-container {
                border-radius: 1rem;
                margin-top: 0;
            }

            .login-panel {
                padding: 1rem;
            }

            .login-header {
                margin-bottom: 1rem;
            }

            .osb-logo {
                max-width: 120px;
                margin-bottom: 0.5rem;
            }

            .login-title {
                font-size: 1rem;
                margin-bottom: 0.75rem;
            }

            .modern-form-group {
                margin-bottom: 0.875rem;
            }

            .modern-form-input input {
                padding: 0.625rem 0.625rem 0.625rem 2.25rem;
                font-size: 0.9rem;
            }

            .modern-form-input-icon {
                left: 0.625rem;
                font-size: 1rem;
            }

            .password-toggle {
                right: 0.625rem;
                font-size: 1rem;
            }

            .btn-primary {
                padding: 0.625rem 1.25rem;
                font-size: 0.9rem;
                background: var(--primary-color);
            }

            .btn-primary:hover {
                background: var(--primary-dark);
                transform: none;
            }

            .forgot-password a {
                font-size: 0.8rem;
            }

            .floating-elements,
            .floating-element {
                display: none !important;
            }
        }

        /* Smartphones pequenos */
        @media (max-width: 320px) {
            .login-panel {
                padding: 0.75rem;
            }

            .osb-logo {
                max-width: 100px;
            }

            .login-title {
                font-size: 0.95rem;
            }

            .modern-form-input input {
                padding: 0.5rem 0.5rem 0.5rem 2rem;
                font-size: 0.85rem;
            }

            .modern-form-input-icon {
                left: 0.5rem;
                font-size: 0.9rem;
            }

            .password-toggle {
                right: 0.5rem;
                font-size: 0.9rem;
            }
        }

        /* ===== AJUSTES PARA ALTURA REDUZIDA ===== */
        
        /* Dispositivos com altura pequena (paisagem) */
        @media (max-height: 600px) {
            body {
                align-items: flex-start;
                padding-top: 0.5rem;
                padding-bottom: 0.5rem;
            }

            .login-container {
                min-height: auto;
                max-height: 95vh;
            }

            .brand-panel {
                padding: 1rem;
            }

            .brand-logo {
                width: 60px;
                height: 60px;
                font-size: 1.5rem;
                margin-bottom: 0.75rem;
            }

            .brand-title {
                font-size: 1.5rem;
                margin-bottom: 0.25rem;
            }

            .brand-subtitle {
                font-size: 0.8rem;
                margin-bottom: 1rem;
            }

            .brand-features {
                gap: 0.5rem;
            }

            .feature-item {
                font-size: 0.75rem;
            }

            .login-panel {
                padding: 1rem;
            }

            .login-header {
                margin-bottom: 1rem;
            }

            .osb-logo {
                max-width: 120px;
                margin-bottom: 0.5rem;
            }
        }

        /* Muito baixo (ex: telefones em paisagem) */
        @media (max-height: 480px) {
            .brand-panel {
                display: none;
            }

            .login-container {
                grid-template-columns: 1fr;
                max-height: none;
            }

            .login-panel {
                padding: 0.75rem;
                justify-content: flex-start;
            }

            .login-header {
                margin-bottom: 0.75rem;
            }

            .osb-logo {
                max-width: 100px;
                margin-bottom: 0.25rem;
            }

            .login-title {
                font-size: 1rem;
                margin-bottom: 0.5rem;
            }

            .modern-form-group {
                margin-bottom: 0.75rem;
            }
        }

        /* Ajustar para telas ultra-wide */
        @media (min-width: 1400px) {
            .login-container {
                max-width: 1200px;
            }
        }

        /* Accessibility */
        @media (prefers-reduced-motion: reduce) {
            .floating-element,
            .spinner {
                animation: none;
            }

            .btn-primary:hover {
                transform: none;
            }
        }

        /* High contrast mode */
        @media (prefers-contrast: high) {
            .modern-form-input input {
                border-width: 3px;
            }

            .btn-primary {
                border: 2px solid white;
            }
        }
