/* ==========================================================================
   Inovify & REnovify - Folha de Estilo Modular (Light & Dark Theme)
   ========================================================================== */

:root {
    --grid-color: rgba(15, 23, 42, 0.04);
}

html.dark {
    --grid-color: rgba(255, 255, 255, 0.035);
}

.bg-tech-grid {
    background-size: 36px 36px;
    background-image:
        linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
}

/* ==========================================================================
   EMULAÇÃO AUTÊNTICA DELPHI 5 / 7 (WINDOWS CLASSIC clBtnFace #D4D0C8)
   ========================================================================== */
.delphi-window {
    background-color: #d4d0c8;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    box-shadow: inset 1px 1px 0 #dfdfdf, inset -1px -1px 0 #808080, 0 12px 24px rgba(0, 0, 0, 0.25);
    font-family: Tahoma, "MS Sans Serif", Geneva, sans-serif;
    color: #000000;
    user-select: none;
}

.delphi-titlebar {
    background: linear-gradient(90deg, #0a246a 0%, #a6caf0 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 11px;
    padding: 3px 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.delphi-win-btn {
    width: 15px;
    height: 14px;
    background-color: #d4d0c8;
    color: #000000;
    border-top: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
    border-right: 1px solid #404040;
    border-bottom: 1px solid #404040;
    font-size: 10px;
    line-height: 11px;
    text-align: center;
    font-weight: bold;
    display: inline-block;
}

.delphi-menubar {
    background-color: #d4d0c8;
    border-bottom: 1px solid #808080;
    padding: 2px 6px;
    font-size: 10px;
    display: flex;
    gap: 10px;
    color: #000;
}

.delphi-toolbar {
    background-color: #d4d0c8;
    border-top: 1px solid #ffffff;
    border-bottom: 1px solid #808080;
    padding: 3px 6px;
}

.delphi-speedbtn {
    background-color: #d4d0c8;
    border-top: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
    border-right: 1px solid #808080;
    border-bottom: 1px solid #808080;
    font-size: 9px;
    padding: 1px 4px;
    color: #000;
    font-family: monospace;
}

.delphi-tab {
    background-color: #c6c2ba;
    border-top: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
    border-right: 1px solid #404040;
    padding: 2px 7px;
    margin-right: 2px;
    color: #333;
}

.delphi-tab.active {
    background-color: #d4d0c8;
    font-weight: 700;
    color: #000;
    margin-bottom: -1px;
    padding-bottom: 3px;
    z-index: 2;
}

.delphi-panel {
    background-color: #d4d0c8;
    border-top: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
}

.delphi-groupbox {
    border: 1px groove #ffffff;
    padding: 4px 6px 6px 6px;
    margin: 0;
}

.delphi-groupbox legend {
    font-size: 9px;
    font-weight: 700;
    padding: 0 4px;
    color: #0a246a;
}

.delphi-input {
    width: 100%;
    background-color: #ffffff;
    border-top: 1px solid #404040;
    border-left: 1px solid #404040;
    border-right: 1px solid #ffffff;
    border-bottom: 1px solid #ffffff;
    padding: 1px 4px;
    font-size: 10px;
    color: #000;
    outline: none;
}

.delphi-combo {
    width: 100%;
    background-color: #ffffff;
    border-top: 1px solid #404040;
    border-left: 1px solid #404040;
    border-right: 1px solid #ffffff;
    border-bottom: 1px solid #ffffff;
    padding: 1px 2px 1px 4px;
    font-size: 10px;
    color: #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delphi-combo span:last-child {
    background: #d4d0c8;
    border: 1px outset #fff;
    padding: 0 2px;
    font-size: 8px;
}

.delphi-checkbox {
    width: 11px;
    height: 11px;
    background: #fff;
    border: 1px inset #808080;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: bold;
    color: #000;
}

.delphi-dbgrid {
    background-color: #ffffff;
    border-top: 1px solid #404040;
    border-left: 1px solid #404040;
    border-right: 1px solid #ffffff;
    border-bottom: 1px solid #ffffff;
}

.delphi-btn {
    background-color: #d4d0c8;
    border-top: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    color: #000;
}

.delphi-statusbar {
    background-color: #d4d0c8;
    border-top: 1px solid #808080;
    padding: 2px 6px;
    font-size: 9px;
    display: flex;
    justify-content: space-between;
    color: #222;
}

/* ==========================================================================
   CONTROLE SELETOR DO CARD 3 (ETAPA 3 - SEGMENTED CONTROL)
   ========================================================================== */
.step3-switch-btn {
    color: #475569;
    background: transparent;
}

html.dark .step3-switch-btn {
    color: #94a3b8;
}

.step3-switch-btn:hover {
    color: #0f172a;
}

html.dark .step3-switch-btn:hover {
    color: #f8fafc;
}

.step3-switch-btn.active {
    background-color: #4f46e5;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

/* ==========================================================================
   ANIMAÇÕES DO SIMULADOR RENOVIFY
   ========================================================================== */
@keyframes scanline {
    0% { top: 6%; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { top: 92%; opacity: 0; }
}

.scanner-bar {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #4f46e5, #06b6d4, transparent);
    box-shadow: 0 0 14px rgba(6, 182, 212, 0.85);
    animation: scanline 3.4s ease-in-out infinite;
    z-index: 10;
    pointer-events: none;
}

@keyframes pulse-cursor {
    0%, 100% { transform: translate(0, 0) scale(1); }
    35% { transform: translate(65px, 42px) scale(0.94); }
    70% { transform: translate(-15px, 95px) scale(1); }
}

.ai-cursor {
    animation: pulse-cursor 4.5s infinite ease-in-out;
    z-index: 15;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.animate-modal-in {
    animation: modalIn 0.2s ease-out forwards;
}

@keyframes flow-dots {
    0% { stroke-dashoffset: 24; }
    100% { stroke-dashoffset: 0; }
}

.animated-dash {
    stroke-dasharray: 6 6;
    animation: flow-dots 0.8s linear infinite;
}

/* ==========================================================================
   WIDGET DE CHAT ADAPTÁVEL AO TEMA CLARO E ESCURO (COMPATÍVEL COM CHAT.JS)
   ========================================================================== */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9990;
}

.chat-button {
    width: 60px;
    height: 60px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #4f46e5, #0284c7);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 12px 28px -4px rgba(79, 70, 229, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-button:hover {
    transform: translateY(-3px) scale(1.04);
}

.chat-button::before {
    content: "\F544";
    font-family: "bootstrap-icons";
}

.chat-container {
    position: fixed;
    bottom: 92px;
    right: 20px;
    width: 390px;
    max-width: calc(100vw - 24px);
    height: 540px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.28);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9995;
}

html.dark .chat-container {
    background: #0f172a;
    border-color: #1e293b;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85);
}

.chat-container.open {
    display: flex;
}

.chat-header {
    background: #0f172a;
    color: #ffffff;
    padding: 14px 18px;
    font-weight: 700;
    font-size: 0.92rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1e293b;
}

.close-button {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.88rem;
}

html.dark .chat-messages {
    background: #090d16;
}

.message {
    max-width: 86%;
    padding: 10px 14px;
    border-radius: 14px;
    line-height: 1.5;
}

.message p { margin-bottom: 6px; }
.message p:last-child { margin-bottom: 0; }

.message.assistant {
    background: #ffffff;
    color: #1e293b;
    align-self: flex-start;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 3px;
}

html.dark .message.assistant {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
}

.message.user {
    background: #4f46e5;
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 3px;
}

.chat-input {
    padding: 12px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
}

html.dark .chat-input {
    background: #0f172a;
    border-color: #1e293b;
}

.chat-input input {
    flex: 1;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.88rem;
    outline: none;
}

html.dark .chat-input input {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

.chat-input input:focus {
    border-color: #4f46e5;
}

.chat-input button {
    background: #4f46e5;
    color: #ffffff;
    border: none;
    padding: 0 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.84rem;
    cursor: pointer;
}

@media (max-width: 640px) {
    .chat-container {
        right: 12px;
        left: 12px;
        bottom: 84px;
        width: auto;
        height: 72vh;
    }
}

/* ==========================================================================
   ESTILO DAS ABAS DAS 6 SOLUÇÕES ORIGINAIS (TIER 2)
   ========================================================================== */
.solution-tab-btn {
    background-color: #ffffff;
    color: #475569;
    border: 1px solid #e2e8f0;
}

html.dark .solution-tab-btn {
    background-color: #0f172a;
    color: #94a3b8;
    border-color: #1e293b;
}

.solution-tab-btn:hover {
    border-color: #6366f1;
    color: #0f172a;
}

html.dark .solution-tab-btn:hover {
    border-color: #38bdf8;
    color: #ffffff;
}

.solution-tab-btn.active {
    background-color: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

html.dark .solution-tab-btn.active {
    background-color: #4f46e5;
    color: #ffffff;
    border-color: #6366f1;
}