/* ========================================= */
/* IMPORTS */
/* ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ========================================= */
/* VARIÁVEIS */
/* ========================================= */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #1bcfb4;
    --warning-color: #fed713;
    --danger-color: #fe7c96;
    --info-color: #8862e0;

    /* === LemmiCRM Brand (DS canonico) ===
       Navy 1: cor base da marca (sidebar, botoes, headers)
       Navy 2: variacao mais clara, usada em hover do navy solido
               e como segunda parada do gradiente de header de modal/secao
       Cream:  acento cremoso (texto sobre navy, badges, hover suaves)
       Os gradientes foram canonizados em --brand-gradient (135deg, header de modal)
       e --brand-gradient-x (to right, header de tabela / cards horizontais).      */
    --brand-navy: #22303d;
    --brand-navy-2: #2d4052;
    --brand-cream: #e8d9c5;
    --brand-gradient: linear-gradient(135deg, #22303d, #2d4052);
    --brand-gradient-x: linear-gradient(to right, #22303d, #2d4052);
}

/* Utilitarios reutilizaveis para hover do navy solido + gradient brand */
.bg-brand-navy { background-color: var(--brand-navy); }
.bg-brand-navy:hover { background-color: var(--brand-navy-2); }
.bg-brand-gradient { background: var(--brand-gradient); }
.bg-brand-gradient-x { background: var(--brand-gradient-x); }

/* === Tokens de largura de modal (DS) ===
   Padrao de uso (referencia para novos componentes):
     - modal-sm  -> confirmar / alertar acao destrutiva  (max-w-md  -> 448px)
     - modal-md  -> formulario curto / edicao simples    (max-w-2xl -> 672px)
     - modal-lg  -> formulario complexo / wizard         (max-w-4xl -> 896px)
     - modal-xl  -> detalhe full (drawer/full-screen)    (max-w-7xl -> 1280px)
   As classes abaixo nao substituem max-w-* existentes (mantem compat). Refatores
   futuros devem preferir a classe semantica (.modal-sm/md/lg/xl) ao Tailwind direto. */
.modal-sm { max-width: 28rem;  /* 448px ~ max-w-md  */ }
.modal-md { max-width: 42rem;  /* 672px ~ max-w-2xl */ }
.modal-lg { max-width: 56rem;  /* 896px ~ max-w-4xl */ }
.modal-xl { max-width: 80rem;  /* 1280px ~ max-w-7xl */ }

/* ========================================= */
/* RESET E BASE */
/* ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================= */
/* LOGIN PAGE */
/* ========================================= */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background: #22303d;
    min-height: 100vh;
}

.login-container {
    display: flex;
    width: 100%;
    max-width: 1100px;
    min-height: 600px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-left {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    background-image:
        radial-gradient(circle at 30% 20%, rgba(102, 126, 234, 0.18), transparent 55%),
        radial-gradient(circle at 70% 80%, rgba(27, 207, 180, 0.15), transparent 55%);
    padding: 40px;
    overflow: hidden;
}

.logo-container {
    width: 100%;
    max-width: 420px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    width: 100%;
    height: auto;
    max-height: 460px;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(102, 126, 234, 0.25));
}

.login-right {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 70px 60px;
}

.login-box {
    width: 100%;
    max-width: 420px;
}

.login-box h2 {
    font-size: 34px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 15px;
    color: #666;
    margin-bottom: 35px;
}

.input-group {
    margin-bottom: 22px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 7px;
    color: #1a1a1a;
}

input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 15px 16px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    background: #f9fafb;
    font-size: 15px;
    transition: 0.3s;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.input-group-checkbox {
    margin: 18px 0 28px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
}

.btn-login {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    color: #e8d9c5;
    background: #22303d;
    transition: 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

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

.error, .success {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 18px;
    display: none;
}

.error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.success {
    background: #efe;
    border: 1px solid #cfc;
    color: #3c3;
}

/* Banner legado - mantido por compatibilidade caso alguma rota antiga use */
.trial-expired-banner {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 22px;
    background: rgba(254, 215, 19, 0.12);
    border: 1px solid rgba(254, 215, 19, 0.45);
    color: #92400e;
}
.trial-expired-banner strong {
    display: block;
    margin-bottom: 4px;
    color: #78350f;
    font-weight: 700;
}

/* Card moderno do trial expirado (login.php) */
.trial-expired-card {
    position: relative;
    margin-bottom: 24px;
    padding: 20px 18px 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    box-shadow: 0 8px 24px rgba(245, 158, 11, .10);
    overflow: hidden;
    animation: trialCardIn .4s cubic-bezier(0.16, 1, 0.3, 1);
}
.trial-expired-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f59e0b 0%, #fb923c 50%, #f59e0b 100%);
}
@keyframes trialCardIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.trial-expired-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}
.trial-expired-icon {
    flex-shrink: 0;
    width: 44px; height: 44px;
    border-radius: 12px;
    background: rgba(245, 158, 11, .18);
    color: #b45309;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .25);
}
.trial-expired-title {
    font-size: 15px;
    font-weight: 700;
    color: #78350f;
    margin: 0 0 4px;
    line-height: 1.3;
    letter-spacing: -.01em;
}
.trial-expired-text {
    font-size: 13px;
    color: #92400e;
    line-height: 1.5;
    margin: 0;
}

.trial-expired-cta {
    width: 100%;
    background: linear-gradient(135deg, #22303d 0%, #2d4052 100%);
    color: #e8d9c5;
    border: none;
    padding: 13px 18px;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 4px 16px rgba(34, 48, 61, .25);
    font-family: inherit;
}
.trial-expired-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(34, 48, 61, .32);
}
.trial-expired-cta:active {
    transform: translateY(0);
}
.trial-expired-cta i { font-size: 15px; }

.trial-expired-hint {
    margin: 12px 0 0;
    font-size: 11.5px;
    color: #a16207;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.4;
}
.trial-expired-hint i { font-size: 12px; }

/* ========================================= */
/* ANIMAÇÕES */
/* ========================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-item {
    position: relative;
    overflow: hidden;
}

.menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.menu-item.active::before {
    transform: scaleY(1);
}

/* Efeito Ripple */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Scrollbar Personalizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* ========================================= */
/* RESPONSIVO */
/* ========================================= */
@media (max-width: 991px) {
    .login-container {
        flex-direction: column;
        min-height: auto;
    }

    .login-left {
        height: auto;
        padding: 30px;
    }

    .logo-container {
        max-width: 220px;
    }

    .logo {
        max-height: 220px;
    }

    .login-right {
        padding: 40px 20px;
    }
}

/* Animação de Loading */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Smooth Transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

button, a {
    position: relative;
}
/* ========================================= */
/* PÁGINA DE REUNIÕES - RESPONSIVO MOBILE */
/* ========================================= */

/* Otimizações gerais para mobile */
@media (max-width: 768px) {
    /* Ajustar padding geral */
    .p-4 {
        padding: 0.75rem !important;
    }
    
    /* Header de reuniões */
    .mb-6 {
        margin-bottom: 1rem !important;
    }
    
    /* Títulos menores em mobile */
    h1 {
        font-size: 1.5rem !important;
    }
    
    /* Cards de resumo em coluna */
    .grid.grid-cols-1.md\:grid-cols-3 {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    /* Navegação de datas mais compacta */
    .bg-white.rounded-xl.shadow-sm.p-6 {
        padding: 1rem !important;
    }
    
    /* Botões de navegação menores */
    .flex.items-center.gap-2.px-4.py-2 {
        padding: 0.5rem !important;
        font-size: 0.875rem !important;
    }
    
    /* Timeline de reuniões */
    .flex.hover\:bg-gray-50 {
        flex-direction: column !important;
    }
    
    /* Horário da timeline */
    .w-24.flex-shrink-0 {
        width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid #e5e7eb !important;
        padding: 0.5rem !important;
    }
    
    /* Card de reunião */
    .mb-3.p-4.bg-gradient-to-r {
        padding: 0.75rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Reorganizar informações da reunião em mobile */
    .flex.items-start.justify-between {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    /* Nome da reunião menor */
    .font-bold.text-gray-900.text-lg {
        font-size: 1rem !important;
    }
    
    /* Telefone e horário em coluna */
    .flex.items-center.gap-4.text-sm {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        font-size: 0.8rem !important;
    }
    
    /* Tags de status e qualificação menores */
    .inline-flex.items-center.px-4.py-2.rounded-full {
        padding: 0.375rem 0.75rem !important;
        font-size: 0.75rem !important;
    }
    
    .inline-flex.items-center.px-4.py-2.rounded-full i {
        font-size: 0.875rem !important;
        margin-right: 0.25rem !important;
    }
    
    /* Botão editar menor */
    .ml-4.w-12.h-12.bg-blue-500 {
        width: 2.5rem !important;
        height: 2.5rem !important;
        margin-left: 0 !important;
    }
    
    /* Ícones de ação menores */
    button i, a i {
        font-size: 0.875rem !important;
    }
    
    /* Botão Nova Reunião flutuante em mobile */
    .px-6.py-3.bg-green-500 {
        position: fixed !important;
        bottom: 1rem !important;
        right: 1rem !important;
        z-index: 40 !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
        padding: 0.875rem 1.25rem !important;
    }
    
    /* Modais em mobile */
    .max-w-md {
        max-width: 95% !important;
        margin: 0.5rem !important;
    }
    
    .max-w-lg {
        max-width: 95% !important;
        margin: 0.5rem !important;
    }
    
    /* Formulários em modais */
    .p-6.space-y-4 {
        padding: 1rem !important;
        max-height: calc(100vh - 120px) !important;
        overflow-y: auto !important;
    }
    
    /* Inputs menores em mobile */
    input[type="text"],
    input[type="tel"],
    input[type="date"],
    input[type="time"],
    select {
        padding: 0.75rem !important;
        font-size: 0.875rem !important;
    }
    
    /* Labels menores */
    label {
        font-size: 0.8rem !important;
    }
    
    /* Botões do modal */
    .flex.gap-3.pt-4 button {
        padding: 0.75rem !important;
        font-size: 0.875rem !important;
    }
}

/* iPhone 15 específico (390x844) */
@media (max-width: 430px) and (max-height: 932px) {
    /* Ajustes específicos para iPhone 15 */
    body {
        font-size: 14px;
    }
    
    /* Sidebar ocupar tela toda em mobile */
    #sidebar {
        width: 100% !important;
    }
    
    /* Conteúdo principal sem margem lateral em mobile */
    .lg\:ml-64 {
        margin-left: 0 !important;
    }
    
    /* Navbar ajustada */
    nav.fixed.top-0 {
        padding: 0.5rem !important;
    }
    
    /* Logo menor */
    nav img {
        height: 2rem !important;
    }
    
    /* Dia da semana menor */
    .text-2xl.font-bold {
        font-size: 1.25rem !important;
    }
    
    /* Data menor */
    .text-gray-600.mt-1 {
        font-size: 0.8rem !important;
    }
    
    /* Info agendamento menor */
    .text-xs.text-gray-500 {
        font-size: 0.7rem !important;
    }
    
    /* Safe area para iPhone (notch) */
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    /* Botão flutuante acima da área segura */
    .px-6.py-3.bg-green-500 {
        bottom: calc(1rem + env(safe-area-inset-bottom)) !important;
    }
}

/* Landscape mobile */
@media (max-width: 932px) and (orientation: landscape) {
    /* Modais ocupam mais espaço em landscape */
    .max-w-md, .max-w-lg {
        max-width: 80% !important;
        max-height: 90vh !important;
    }
    
    /* Scroll nos modais em landscape */
    .p-6.space-y-4 {
        max-height: calc(90vh - 100px) !important;
        overflow-y: auto !important;
    }
}

/* Touch targets mínimos para mobile */
@media (max-width: 768px) {
    button, a[role="button"], input[type="submit"] {
        min-height: 44px !important; /* Apple HIG recomendação */
        min-width: 44px !important;
    }
    
    /* Checkbox e radio maiores */
    input[type="checkbox"],
    input[type="radio"] {
        min-width: 20px !important;
        min-height: 20px !important;
    }
}

/* Animações suaves para mobile */
@media (max-width: 768px) {
    * {
        transition-duration: 0.2s !important;
    }
    
    /* Remover hover effects em touch devices */
    .hover\:bg-gray-50:hover,
    .hover\:bg-gray-100:hover,
    .hover\:shadow-md:hover {
        background-color: inherit !important;
        box-shadow: inherit !important;
    }
}

/* Prevenir zoom ao focar em inputs (iOS) */
@media (max-width: 768px) {
    input[type="text"],
    input[type="tel"],
    input[type="email"],
    input[type="password"],
    input[type="date"],
    input[type="time"],
    select,
    textarea {
        font-size: 16px !important; /* Previne zoom automático no iOS */
    }
}