/* ==========================================================================
   Personalizacao da Tela de Cadastro e Login de Clientes (Perfex CRM)
   Preserva 100% o design system nativo do Perfex
   ========================================================================== */

/* Esconde o seletor de idiomas do topo */
select#language,
.bootstrap-select:has(select#language),
.col-md-3:has(select#language) {
    display: none !important;
}

/* Centraliza ou expande o titulo quando o seletor de idioma e ocultado */
.register-heading {
    text-align: left !important;
}

/* Toggle PF / PJ */
.cc-tipo-pessoa-wrapper {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.cc-tipo-pessoa-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.cc-tipo-pessoa-options {
    display: flex;
    gap: 20px;
}

.cc-tipo-pessoa-options label {
    font-weight: normal;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
}

/* Secoes do Formulario */
.cc-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin-top: 15px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

/* Destaque para o campo Numero (manual) */
.cc-field-manual-attention {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
}

/* Borda de erro para validacao de CPF e CNPJ */
.cc-input-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.cc-doc-error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    display: none;
    font-weight: 500;
}

/* Modal/Banner de Duplicidade */
.cc-duplicate-banner {
    background-color: #fffbeb;
    border: 1px solid #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
    padding: 15px;
    margin-top: 8px;
    display: none;
}
.cc-duplicate-banner p {
    margin: 0 0 10px 0;
    color: #92400e;
    font-size: 14px;
    font-weight: 500;
}
.cc-duplicate-banner .cc-btn-group {
    display: flex;
    gap: 10px;
}
.cc-duplicate-banner .btn-login {
    background-color: #3b82f6;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;
}
.cc-duplicate-banner .btn-login:hover {
    background-color: #2563eb;
}
.cc-duplicate-banner .btn-forgot {
    background-color: #f3f4f6;
    color: #4b5563;
    border: 1px solid #d1d5db;
    padding: 6px 14px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;
}
.cc-duplicate-banner .btn-forgot:hover {
    background-color: #e5e7eb;
}

/* Bloco Empresa (escondido por padrao quando PF) */
#cc-bloco-empresa {
    display: none;
    margin-top: 20px;
    padding: 15px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
}

#cc-bloco-empresa.cc-visible {
    display: block;
}

/* Indicador de carregamento do CEP e API */
.cc-loading {
    position: relative;
}

.cc-loading::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 35px;
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: cc-spin 0.6s linear infinite;
}

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

/* Linha com Numero e Complemento lado a lado */
.cc-row-numero-comp {
    display: flex;
    gap: 15px;
}

.cc-col-numero {
    flex: 0 0 35%;
}

.cc-col-comp {
    flex: 1;
}

/* Mensagem de feedback de erro no CEP */
.cc-cep-error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

/* ==========================================================================
   Bloco de Termos e Condicoes Legais (LGPD)
   ========================================================================== */
.cc-legal-row {
    margin-top: 20px;
    clear: both;
}

.cc-legal-terms-wrapper {
    padding: 15px 20px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    width: 100%;
}

.cc-legal-term-item {
    margin-bottom: 10px;
}

.cc-legal-term-item:last-child {
    margin-bottom: 0;
}

.cc-legal-term-item label {
    font-weight: normal;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
    margin-bottom: 0;
}

.cc-legal-term-item input[type="checkbox"] {
    margin-top: 0;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.cc-legal-modal-body {
    max-height: 480px;
    overflow-y: auto;
    font-size: 13.5px;
    line-height: 1.6;
    color: #374151;
    padding: 20px;
}

.cc-legal-modal-body h4 {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin-top: 15px;
    margin-bottom: 8px;
}

/* ==========================================================================
   Estilos Especificos da Tela de Login
   ========================================================================== */
.cc-login-register-highlight {
    margin-bottom: 20px;
    text-align: center;
}

.cc-btn-register-top {
    font-size: 16px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 6px;
    display: block;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.cc-login-subheading {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-top: 15px;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

/* ==========================================================================
   NOVO DASHBOARD DO CLIENTE (PORTAL MODERNO & RESUMIDO)
   ========================================================================== */
.cc-client-dashboard-container {
    margin-top: 5px;
    margin-bottom: 25px;
    font-family: inherit;
}

/* 1. Header Hero / Boas-Vindas */
.cc-dashboard-welcome-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    padding: 24px 28px;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
}

.cc-welcome-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cc-welcome-avatar {
    font-size: 54px;
    color: #38bdf8;
    line-height: 1;
    display: flex;
    align-items: center;
}

.cc-welcome-badge {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 6px;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.cc-welcome-title {
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px 0;
    letter-spacing: -0.5px;
}

.cc-welcome-subtitle {
    color: #94a3b8;
    font-size: 14px;
    margin: 0;
}

.cc-welcome-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.cc-btn-agendar-hero {
    background-color: #10b981 !important;
    border-color: #059669 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    padding: 10px 18px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35) !important;
    transition: all 0.2s ease-in-out;
}

.cc-btn-agendar-hero:hover {
    background-color: #059669 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45) !important;
}

.cc-btn-ticket-hero {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    padding: 10px 18px !important;
    border-radius: 8px !important;
    transition: all 0.2s ease-in-out;
}

.cc-btn-ticket-hero:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
}

/* 2. Grid de Cards Resumidos */
.cc-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.cc-stat-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 22px;
    display: flex;
    gap: 18px;
    position: relative;
    text-decoration: none !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    cursor: pointer;
}

.cc-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.12);
    border-color: #cbd5e1;
}

.cc-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.cc-icon-projects   { background: #eff6ff; color: #2563eb; }
.cc-icon-estimates  { background: #f5f3ff; color: #7c3aed; }
.cc-icon-invoices   { background: #ecfdf5; color: #059669; }
.cc-icon-tickets    { background: #fff7ed; color: #ea580c; }
.cc-icon-files      { background: #f0fdf4; color: #16a34a; }
.cc-icon-contracts  { background: #fdf2f8; color: #db2777; }
.cc-icon-schedule   { background: #ecfeff; color: #0891b2; }

.cc-card-content {
    flex: 1;
    min-width: 0;
}

.cc-card-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.cc-card-number {
    font-size: 28px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.1;
    margin-bottom: 10px;
}

.cc-card-footer-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cc-tag-info {
    font-size: 12.5px;
    color: #475569;
    font-weight: 500;
}

.cc-tag-danger {
    font-size: 12px;
    font-weight: 700;
    color: #dc2626;
    background: #fef2f2;
    padding: 3px 8px;
    border-radius: 6px;
}

.cc-tag-success {
    font-size: 12px;
    font-weight: 700;
    color: #16a34a;
    background: #f0fdf4;
    padding: 3px 8px;
    border-radius: 6px;
}

.cc-tag-warning {
    font-size: 12px;
    font-weight: 700;
    color: #d97706;
    background: #fffbeb;
    padding: 3px 8px;
    border-radius: 6px;
}

.cc-card-arrow {
    color: #94a3b8;
    font-size: 16px;
    transition: transform 0.2s ease;
}

.cc-stat-card:hover .cc-card-arrow {
    transform: translateX(4px);
    color: #3b82f6;
}

/* Card Especial de Agendamento */
.cc-card-schedule {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 100%);
    border: 2px dashed #0d9488;
}

.cc-card-schedule:hover {
    border-color: #0f766e;
    background: linear-gradient(135deg, #ffffff 0%, #ccfbf1 100%);
}

.cc-schedule-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #0d9488;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.cc-schedule-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f766e;
    margin-bottom: 4px;
}

.cc-schedule-desc {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
    line-height: 1.4;
}

.cc-btn-schedule-action {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: #0d9488;
}

/* Modal de Agendamento */
.cc-modal-header {
    background: #0f172a;
    color: #ffffff;
    border-radius: 6px 6px 0 0;
    padding: 16px 20px;
}

.cc-modal-header .modal-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 18px;
}

.cc-modal-header .close {
    color: #ffffff;
    opacity: 0.8;
}

.cc-modal-body {
    padding: 24px;
}

.cc-schedule-service-box {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.cc-service-icon {
    width: 44px;
    height: 44px;
    background: #e0f2fe;
    color: #0284c7;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.cc-service-info h4 {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 2px 0;
}

.cc-service-info p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.cc-schedule-alert {
    display: flex;
    gap: 12px;
    font-size: 13px;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.cc-schedule-alert .cc-alert-icon {
    font-size: 18px;
    line-height: 1;
}

.cc-modal-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.cc-btn-confirm-schedule {
    background-color: #0d9488 !important;
    border-color: #0f766e !important;
    font-weight: 700 !important;
}

.cc-btn-confirm-schedule:hover {
    background-color: #0f766e !important;
}

