/* ==========================================================================
   appSwitch Theme - Variáveis Globais
   ========================================================================== */
:root {
    /* Cores Principais - Baseadas na logo appSwitch */
    --app-blue: #2173C5;
    --app-blue-dark: #1a5aa0;
    --app-green: #33DBC8;
    --app-green-dark: #2ab5a3;
    
    /* Cores de Background */
    --app-dark: #1a1a2e;
    --app-dark-secondary: #16213e;
    --app-light: #f5f7fa;
    --app-white: #ffffff;
    
    /* Cores de Texto */
    --app-text-primary: #333333;
    --app-text-secondary: #6c757d;
    --app-text-light: #ffffff;
    --app-text-muted: #9ca3af;
    
    /* Utilidades */
    --app-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --app-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --app-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --app-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --app-shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    --app-radius: 8px;
    --app-radius-lg: 12px;
    --app-blur-bg: rgba(26, 26, 46, 0.4);
}

/* ==========================================================================
   Reset e Estilos Base
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--app-light) 0%, var(--app-white) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 0;
    color: var(--app-text-primary);
    margin: 0;
    overflow-x: hidden;
}

/* ==========================================================================
   Navbar appSwitch - CINZA CLARO NEUTRO
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%) !important;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: var(--app-transition);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e5e7eb;
    height: 76px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.25rem;
    color: #374151 !important;
    transition: var(--app-transition);
}

.navbar-brand:hover {
    transform: translateX(5px);
    color: #1f2937 !important;
}

.navbar-brand img {
    height: 45px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: var(--app-transition);
}

.navbar-brand img:hover {
    transform: scale(1.1) rotate(5deg);
}

.navbar-nav .nav-link {
    color: #374151 !important;
    padding: 0.5rem 1rem;
    border-radius: var(--app-radius);
    transition: var(--app-transition);
    margin: 0 0.25rem;
    font-weight: 500;
}

.navbar-nav .nav-link:hover {
    background: rgba(33, 115, 197, 0.08);
    color: #2173C5 !important;
}

.navbar-nav .nav-link.active {
    background: rgba(33, 115, 197, 0.12);
    color: #2173C5 !important;
    font-weight: 600;
}

/* Ajuste do botão hamburger para mobile */
.navbar-toggler {
    border: 1px solid #d1d5db;
    color: #374151;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23374151' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Hover effect suave */
.navbar {
    position: relative;
    z-index: 1000;
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #cbd5e1, transparent);
    opacity: 0.5;
}

/* ==========================================================================
   Hero Section appSwitch - AJUSTADO PARA TELA ÚNICA
   ========================================================================== */
.full-screen-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 76px;
}

.hero-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: linear-gradient(135deg, var(--app-dark) 0%, var(--app-dark-secondary) 100%);
    overflow: hidden;
}

.hero-container.appswitch-hero {
    padding-top: 0;
    margin-top: 0;
}

/* Ajuste apenas para o main quando NÃO for hero */
main > *:not(.full-screen-container):first-child,
#listar > *:not(.full-screen-container):first-child {
    padding-top: 76px;
}

.hero-container::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle at 30% 50%, var(--app-green) 0%, transparent 25%),
                radial-gradient(circle at 70% 80%, var(--app-blue) 0%, transparent 25%);
    opacity: 0.1;
}

/* Container centralizado do hero */
.hero-container > .container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--app-radius-lg);
    max-width: 600px;
    color: var(--app-text-light);
    box-shadow: var(--app-shadow-xl);
}

.hero-content h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--app-green) 0%, var(--app-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p.lead {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

#listar {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.full-screen-container {
    min-height: 100vh;
    margin-top: -76px;
    padding-top: 76px;
}

/* ==========================================================================
   Features Section Integrado
   ========================================================================== */
.features-section {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.features-section .feature-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--app-radius-lg);
    padding: 1.25rem;
    height: 100%;
    transition: var(--app-transition);
    box-shadow: var(--app-shadow-md);
    position: relative;
    overflow: hidden;
}

.features-section .feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--app-green) 0%, var(--app-blue) 100%);
    transform: scaleX(0);
    transition: var(--app-transition);
}

.features-section .feature-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--app-shadow-xl);
    background: rgba(255, 255, 255, 0.08);
}

.features-section .feature-card:hover::before {
    transform: scaleX(1);
}

.features-section .icon-feature {
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--app-blue) 0%, var(--app-green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.features-section h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--app-green);
    font-weight: 600;
}

.features-section p {
    font-size: 0.85rem;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

.features-section .card-body {
    padding: 0 !important;
}

/* ==========================================================================
   Botões appSwitch
   ========================================================================== */
.btn-appswitch {
    background: linear-gradient(135deg, var(--app-green) 0%, var(--app-green-dark) 100%);
    color: var(--app-text-light);
    border: none;
    border-radius: var(--app-radius);
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: var(--app-transition);
    box-shadow: 0 4px 15px rgba(51, 219, 200, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-appswitch:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(51, 219, 200, 0.4);
    color: var(--app-text-light);
}

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

.btn-custom {
    background: linear-gradient(135deg, var(--app-blue) 0%, var(--app-blue-dark) 100%);
    color: var(--app-text-light);
    border: none;
    border-radius: var(--app-radius);
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: var(--app-transition);
}

.btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: var(--app-shadow-md);
    color: var(--app-text-light);
}

/* ==========================================================================
   Login Section appSwitch
   ========================================================================== */
.usu-login-container {
    background: linear-gradient(135deg, var(--app-dark) 0%, var(--app-dark-secondary) 100%);
    min-height: 80vh;
    position: relative;
    overflow: hidden;
}

.usu-login-section {
    background: var(--app-light);
    padding: 2rem;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.usu-login-card {
    background: var(--app-white);
    border: none;
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow-xl);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
}

.usu-input {
    border: 2px solid #e2e8f0;
    border-radius: var(--app-radius);
    padding: 0.75rem;
    transition: var(--app-transition);
}

.usu-input:focus {
    border-color: var(--app-green);
    box-shadow: 0 0 0 3px rgba(51, 219, 200, 0.1);
    outline: none;
}

/* ==========================================================================
   Password Section appSwitch
   ========================================================================== */
.pass-login-container {
    background: linear-gradient(135deg, var(--app-dark) 0%, var(--app-dark-secondary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.main-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--app-radius-lg);
    overflow: hidden;
    box-shadow: var(--app-shadow-xl);
    max-width: 1000px;
    width: 100%;
}

.keyboard-section {
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
}

.form-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
}

.pass-welcome-content {
    text-align: center;
    color: var(--app-text-light);
}

.user-highlight {
    color: var(--app-green);
    font-weight: 600;
    position: relative;
}

.user-highlight::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--app-green);
    opacity: 0.5;
}

/* ==========================================================================
   Footer appSwitch - AJUSTADO
   ========================================================================== */
footer {
    background: rgba(26, 26, 46, 0.98);
    color: var(--app-text-light);
    padding: 1rem 0;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 100;
}

footer p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.85rem;
}

/* Footer especifico para páginas com hero */
.full-screen-container + footer {
    display: none;
}

/* ==========================================================================
   Loading Overlay
   ========================================================================== */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
    border-color: var(--app-green);
    border-right-color: transparent;
}

/* ==========================================================================
   Responsividade para Altura
   ========================================================================== */
@media (max-height: 768px) {
    .navbar {
        padding: 0.75rem 0;
        height: 62px;
    }
    
    .full-screen-container {
        padding-top: 62px;
    }
    
    .hero-content {
        padding: 1.5rem !important;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-content p.lead {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .features-section {
        padding: 1rem 0;
    }
    
    .features-section .feature-card {
        padding: 1rem;
    }
    
    .features-section .icon-feature {
        font-size: 1.5rem;
    }
    
    .features-section h4 {
        font-size: 0.95rem;
    }
    
    .features-section p {
        font-size: 0.8rem;
    }
}

@media (max-height: 600px) {
    .festive-message {
        display: none;
    }
    
    .hero-content {
        padding: 1rem !important;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .btn-appswitch {
        padding: 0.5rem 1.5rem;
    }
    
    .features-section {
        padding: 0.75rem 0;
    }
    
    .features-section .feature-card {
        padding: 0.75rem;
    }
}

/* ==========================================================================
   Responsividade Largura
   ========================================================================== */
@media (max-width: 768px) {
    body {
        padding-top: 62px;
    }
    
    .navbar {
        padding: 0.75rem 0;
        height: 62px;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
        color: #374151 !important;
    }
    
    .navbar-brand img {
        height: 35px;
    }
    
    .navbar-collapse {
        background: #ffffff;
        margin-top: 1rem;
        padding: 1rem;
        border-radius: var(--app-radius);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    }
    
    .full-screen-container {
        padding-top: 62px;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .features-section .feature-card {
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    .features-section .col-md-4 {
        margin-bottom: 0.5rem;
    }
    
    .features-section .feature-card {
        padding: 0.75rem;
    }
    
    .features-section .icon-feature {
        font-size: 1.3rem;
    }
    
    .features-section h4 {
        font-size: 0.9rem;
    }
    
    .features-section p {
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   Animações
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */
@media (prefers-color-scheme: dark) {
    .feature-card {
        background: var(--app-dark-secondary);
        color: var(--app-text-light);
    }
    
    .usu-login-card {
        background: var(--app-dark-secondary);
        color: var(--app-text-light);
    }
    
    .usu-input {
        background: rgba(0, 0, 0, 0.3);
        border-color: rgba(255, 255, 255, 0.2);
        color: var(--app-text-light);
    }
}

/* ==========================================================================
   Utilitários
   ========================================================================== */
.no-navbar-padding {
    padding-top: 0 !important;
}

.background-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.03;
    width: 400px;
    height: 400px;
    background: url('../../assets/img/appswitch-logo.png') no-repeat center center;
    background-size: contain;
    z-index: 0;
}