/* PRODECON incorporado ao Joomla - estilos isolados */
.prodecon-app { width: 100%; max-width: 100%; }
.prodecon-app *, .prodecon-app *::before, .prodecon-app *::after { box-sizing: border-box; }
:root {
            --prd-primary: #005691;
            --prd-primary-dark: #003d66;
            --prd-secondary: #78B932;
            --prd-background: #f1f5f9;
            --prd-surface: #ffffff;
            --prd-text: #0f172a;
            --prd-muted: #475569;
            --prd-border: #cbd5e1;
            --prd-border-light: #e2e8f0;
            --prd-danger: #ef4444;
            --prd-danger-bg: #fef2f2;
            --prd-warning: #f59e0b;
            --prd-warning-bg: #fffbeb;
            --prd-radius: 6px;
            --prd-transition: all 0.2s ease-in-out;
        }

        /* Container do formulário PRODECON */
        .prodecon-wrapper {
            background: var(--prd-surface);
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
            padding: 32px;
            position: relative;
            margin-bottom: 40px;
            font-family: 'Inter', 'Open Sans', sans-serif;
        }

        /* Header do formulário */
        .prodecon-header {
            display: grid;
            grid-template-columns: 210px 1fr 210px;
            align-items: center;
            gap: 24px;
            border-bottom: 2px solid var(--prd-border-light);
            padding-bottom: 24px;
            margin-bottom: 20px;
        }
        .prodecon-header .prd-logo {
            max-height: 130px;
            width: auto;
            object-fit: contain;
        }
        
        .prodecon-header .prd-title-container {
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
        }
        .prodecon-header h2 {
            font-size: 1.35rem;
            font-weight: 700;
            color: var(--prd-primary);
            text-transform: uppercase;
            letter-spacing: 0.3px;
            line-height: 1.3;
            margin: 0;
        }
        .prd-header-badges {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            justify-content: center;
        }
        .prd-badge-legal {
            font-size: 0.68rem;
            font-weight: 600;
            color: #0369a1;
            background: #e0f2fe;
            padding: 3px 8px;
            border-radius: 4px;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            text-decoration: none;
            transition: var(--prd-transition);
        }
        .prd-badge-legal:hover { background: #bae6fd; color: #0c4a6e; text-decoration: none; }
        .prd-step-indicator {
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--prd-muted);
            background: var(--prd-background);
            padding: 6px 14px;
            border-radius: 20px;
            white-space: nowrap;
            border: 1px solid var(--prd-border-light);

            /* ======== CENTRALIZAÇÃO CIRÚRGICA ======== */
            display: inline-flex;       /* Faz a caixinha respeitar o tamanho do texto */
            align-items: center;        /* Centraliza o texto verticalmente (no meio) */
            justify-content: center;    /* Centraliza o texto horizontalmente */
            line-height: 1;             /* Remove qualquer folga invisível interna da fonte */
        }

        /* Progress Bar */
        .prd-progress-container {
            background: var(--prd-border-light);
            border-radius: 10px;
            height: 6px;
            width: 100%;
            margin-bottom: 32px;
            overflow: hidden;
        }
        .prd-progress-bar {
            background: var(--prd-secondary);
            height: 100%;
            width: 16.66%;
            transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        /* Steps */
        .prd-form-step { display: none; }
        .prd-form-step.active {
            display: block;
            animation: prdFadeIn 0.3s ease-in-out;
        }
        @keyframes prdFadeIn {
            from { opacity: 0; transform: translateY(4px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .prd-step-title {
            font-size: 1.1rem;
            color: #1e293b;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 4px;
        }
        .prd-step-title i { color: var(--prd-primary); font-size: 1.1rem; }
        .prd-step-subtitle { font-size: 0.88rem; color: var(--prd-muted); margin-bottom: 24px; }

        /* Cards de grupo */
        .prd-group-card {
            background: #ffffff;
            border: 1px solid var(--prd-border-light);
            border-radius: var(--prd-radius);
            padding: 24px;
            margin-bottom: 20px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.015);
        }
        .prd-group-card.no-padding { padding: 0; overflow: hidden; }
        .prd-group-card-title {
            font-size: 0.9rem;
            font-weight: 700;
            color: var(--prd-primary);
            margin-bottom: 20px;
            border-bottom: 1px solid var(--prd-border-light);
            padding-bottom: 8px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        /* Grid e inputs */
        .prd-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 20px; }
        .prd-input-block { display: flex; flex-direction: column; gap: 6px; }
        .prd-input-block.full-width { grid-column: span 2; }
        .prd-input-block label { font-size: 0.82rem; font-weight: 600; color: #334155; }
        .prd-input-block label .required { color: var(--prd-danger); margin-left: 2px; }

        .prd-input-block input[type="text"],
        .prd-input-block input[type="email"],
        .prd-input-block input[type="number"],
        .prd-input-block textarea {
            width: 100%;
            padding: 10px 14px;
            font-size: 0.88rem;
            color: var(--prd-text);
            background: #ffffff;
            border: 1px solid var(--prd-border);
            border-radius: var(--prd-radius);
            transition: var(--prd-transition);
            font-family: 'Inter', sans-serif;
        }
        .prd-input-block input:focus,
        .prd-input-block textarea:focus {
            outline: none;
            border-color: var(--prd-primary);
            box-shadow: 0 0 0 3px rgba(0, 86, 145, 0.12);
        }

        /* Tooltips */
        .prd-label-info-wrapper { display: flex; align-items: center; gap: 6px; }
        .prd-info-tooltip {
            color: var(--prd-primary);
            cursor: help;
            position: relative;
            font-size: 0.85rem;
        }
        .prd-info-tooltip::after {
            content: attr(data-tooltip);
            position: absolute;
            bottom: 130%;
            left: 50%;
            transform: translateX(-50%);
            background: #1e293b;
            color: #ffffff;
            padding: 8px 12px;
            font-size: 0.75rem;
            font-weight: 400;
            border-radius: 4px;
            width: 240px;
            line-height: 1.4;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s ease-in-out;
            z-index: 100;
            text-align: justify;
        }
        .prd-info-tooltip:hover::after { opacity: 1; }

        .prd-inline-alert {
            background: var(--prd-warning-bg);
            border: 1px solid #fde68a;
            color: #b45309;
            font-size: 0.76rem;
            font-weight: 500;
            padding: 6px 10px;
            border-radius: 4px;
            margin-top: 4px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .prd-field-warning { border-color: var(--prd-warning) !important; }
        .prd-conditional-field { animation: prdSlideDown 0.25s ease-out; }
        @keyframes prdSlideDown {
            from { opacity: 0; transform: translateY(-5px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Opções radio/checkbox */
        .prd-radio-vertical, .prd-checkbox-vertical {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-top: 4px;
            width: 100%;
        }
        .prd-custom-option {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 14px;
            background: #f8fafc;
            border: 1px solid var(--prd-border-light);
            border-radius: var(--prd-radius);
            cursor: pointer;
            transition: var(--prd-transition);
            font-size: 0.88rem;
            font-weight: 500;
            color: #334155;
            width: 100%;
        }
        .prd-custom-option:hover { background: #f1f5f9; border-color: #cbd5e1; }
        .prd-custom-option input { width: 15px; height: 15px; accent-color: var(--prd-primary); cursor: pointer; flex-shrink: 0; }
        
        /* Estilização para o estado ativo das opções */
        .prd-custom-option.checked { background: #e0f2fe; border-color: #38bdf8; color: #0369a1; }

        /* Tabela de perguntas (step 4) */
        .prd-layout-questions { display: flex; flex-direction: column; gap: 0; }
        .prd-question-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 14px 20px;
            border-bottom: 1px solid var(--prd-border-light);
            background: #ffffff;
            transition: var(--prd-transition);
            gap: 24px;
        }
        .prd-question-row:last-child { border-bottom: none; }
        .prd-question-row:hover { background: #f8fafc; }
        .prd-question-label { font-size: 0.88rem; font-weight: 500; color: #334155; line-height: 1.4; }
        .prd-question-options { display: flex; gap: 16px; flex-shrink: 0; }
        .prd-opt-inline { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 600; color: #475569; cursor: pointer; }
        .prd-opt-inline input { width: 15px; height: 15px; accent-color: var(--prd-primary); cursor: pointer; }

        .prd-border-dashed { border-bottom: 1px dashed var(--prd-border); padding-bottom: 16px; margin-bottom: 4px; }

        /* Erros */
        .prd-field-error {
            border-color: var(--prd-danger) !important;
            background-color: var(--prd-danger-bg) !important;
            animation: prdShake 0.2s ease-in-out 2;
        }
        .prd-question-row.prd-field-error {
            border-left: 4px solid var(--prd-danger);
            background-color: var(--prd-danger-bg);
        }
        @keyframes prdShake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-4px); }
            75% { transform: translateX(4px); }
        }

        /* Footer do formulário */
        .prd-form-footer {
            display: flex;
            justify-content: space-between;
            padding-top: 24px;
            margin-top: 32px;
            background: #ffffff;
            border-top: 2px solid var(--prd-border-light);
        }
        .prd-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 12px 24px;
            font-size: 0.88rem;
            font-weight: 600;
            border: none;
            border-radius: var(--prd-radius);
            cursor: pointer;
            transition: var(--prd-transition);
            font-family: 'Inter', sans-serif;
        }
        .prd-btn-primary { background: var(--prd-primary); color: white; }
        .prd-btn-primary:hover { background: var(--prd-primary-dark); }
        .prd-btn-secondary { background: #e2e8f0; color: #475569; }
        .prd-btn-secondary:hover { background: #cbd5e1; }
        .prd-btn-success { background: var(--prd-secondary); color: white; }
        .prd-btn-success:hover { background: #649d27; }
        .prd-btn:disabled { opacity: 0.4; cursor: not-allowed; }

        /* Modal Generico e Estilizado */
        .prd-modal-overlay {
            position: fixed;
            top: 0; left: 0;
            width: 100%; height: 100%;
            background: rgba(15, 23, 42, 0.6);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 99999;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s ease-in-out;
        }
        .prd-modal-overlay.active { opacity: 1; pointer-events: auto; }
        .prd-modal-card {
            background: white;
            padding: 30px;
            border-radius: 12px;
            max-width: 480px;
            width: 90%;
            text-align: center;
            box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
            transform: scale(0.9);
            transition: transform 0.2s ease-in-out;
            font-family: 'Inter', sans-serif;
        }
        .prd-modal-overlay.active .prd-modal-card { transform: scale(1); }
        .prd-modal-icon { font-size: 2.5rem; color: var(--prd-danger); margin-bottom: 12px; }
        .prd-modal-card h3 { font-size: 1.15rem; color: #1e293b; margin-bottom: 12px; font-weight: 700; }
        .prd-modal-card p { font-size: 0.88rem; color: var(--prd-muted); margin-bottom: 16px; line-height: 1.5; }
        
        /* Lista do Passo a Passo dentro do Modal de Sucesso */
        .prd-modal-steps-list {
            text-align: left;
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 16px;
            margin-bottom: 20px;
            list-style: none;
        }
        .prd-modal-steps-list li {
            font-size: 0.85rem;
            color: #334155;
            margin-bottom: 12px;
            position: relative;
            padding-left: 28px;
            line-height: 1.45;
        }
        .prd-modal-steps-list li:last-child { margin-bottom: 0; }
        .prd-modal-steps-list li i {
            position: absolute;
            left: 0;
            top: 2px;
            color: var(--prd-secondary);
            font-size: 0.95rem;
        }
        .prd-modal-steps-list a {
            color: var(--prd-primary);
            font-weight: 600;
            text-decoration: underline;
        }
        .prd-modal-steps-list a:hover { color: var(--prd-primary-dark); }

        .prd-btn-modal-close {
            background: #1e293b; color: white; border: none;
            width: 100%; padding: 11px;
            border-radius: var(--prd-radius);
            font-weight: 600; font-size: 0.88rem;
            cursor: pointer; transition: var(--prd-transition);
            font-family: 'Inter', sans-serif;
        }
        .prd-btn-modal-close:hover { background: #0f172a; }
        .prd-modal-card.success-state .prd-modal-icon { color: #16a34a; }
        .prd-modal-card.success-state .prd-btn-modal-close { background: #16a34a; }
        .prd-modal-card.success-state .prd-btn-modal-close:hover { background: #15803d; }

        /* Preview PDF */
        .prd-preview-scroll {
            max-height: 440px;
            overflow-y: auto;
            border: 1px solid var(--prd-border);
            border-radius: var(--prd-radius);
            background: #f8fafc;
            padding: 16px;
        }
        .prd-pdf-style {
            background: #ffffff;
            color: #0f172a;
            padding: 30px;
            border-radius: 4px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
            font-size: 0.85rem;
            line-height: 1.5;
        }
        .prd-preview-section-title {
            background: #f1f5f9;
            color: var(--prd-primary);
            font-weight: 700;
            padding: 6px 10px;
            margin: 20px 0 12px 0;
            font-size: 0.88rem;
            border-left: 4px solid var(--prd-primary);
        }
        .prd-preview-row { display: flex; margin-bottom: 12px; border-bottom: 1px dashed #e2e8f0; padding-bottom: 8px; }
        .prd-preview-label { width: 40%; font-weight: 600; color: #334155; font-size: 0.82rem; }
        .prd-preview-value { width: 60%; color: #475569; font-size: 0.85rem; }

        /* Responsive */
        @media (max-width: 768px) {
            .prodecon-wrapper { padding: 20px; }
            .prodecon-header { grid-template-columns: 1fr; justify-items: center; text-align: center; padding-bottom: 16px; gap: 16px; }
            .prd-grid-2 { grid-template-columns: 1fr; gap: 14px; }
            .prd-input-block.full-width { grid-column: span 1; }
            .prd-question-row { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px 14px; }
            .prd-question-options { width: 100%; justify-content: flex-start; gap: 24px; }
            .prd-form-footer { padding-top: 20px; gap: 10px; }
            .prd-btn { padding: 10px 16px; font-size: 0.82rem; }
            .prd-preview-row { flex-direction: column; gap: 4px; }
            .prd-preview-label, .prd-preview-value { width: 100%; }
        }
