
/* ==========================================================
   CONFIGURAÇÕES GERAIS
========================================================== */
:root {
    --primary-dark: #071b33;
    --primary: #0b4b78;
    --primary-medium: #0369a1;
    --primary-light: #0284c7;
    --primary-soft: #e0f2fe;
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: rgba(148, 163, 184, 0.30);
    --border-strong: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --success: #15803d;
    --success-light: #dcfce7;
    --warning: #b45309;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-dark: #b91c1c;
    --danger-light: #fee2e2;
    --shadow-small: 0 4px 14px rgba(15, 23, 42, 0.05);
    --shadow-medium: 0 8px 22px rgba(15, 23, 42, 0.07);
    --shadow-large: 0 14px 34px rgba(7, 27, 51, 0.20);
    --radius-small: 8px;
    --radius-medium: 14px;
    --radius-large: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background: var(--background);
    color: var(--text-primary);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button, input, select {
    font: inherit;
}

button {
    font-family: inherit;
}

img {
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

/* ==========================================================
   CONTAINER PRINCIPAL
========================================================== */
.app-container {
    width: min(1580px, calc(100% - 32px));
    margin: 0 auto;
    padding: 16px 0 30px 0;
}

/* ==========================================================
   CABEÇALHO
========================================================== */
.hero-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 26px 34px;
    margin-bottom: 20px;
    border-radius: 20px;
    background: linear-gradient(135deg, #071b33 0%, #0b4b78 100%);
    box-shadow: var(--shadow-large);
    overflow: hidden;
}

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

.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(255,255,255,0.38);
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.88);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.hero-title {
    margin: 0;
    color: #ffffff;
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.hero-subtitle {
    max-width: 820px;
    margin: 10px 0 0 0;
    color: rgba(255,255,255,0.88);
    font-size: 16px;
    line-height: 1.55;
}

/* ==========================================================
   STATUS DO SERVIDOR
========================================================== */
.server-status-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 17px;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.88);
    font-size: 12px;
    font-weight: 600;
}

.status-indicator {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.status-checking {
    background: #fbbf24;
    animation: pulse-status 1.3s infinite;
}

.status-online {
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74,222,128,0.85);
}

.status-offline {
    background: #f87171;
}

@keyframes pulse-status {
    0%, 100% {opacity: 1;}
    50% {opacity: 0.35;}
}

/* ==========================================================
   LOGOTIPOS
========================================================== */
.hero-logos {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    flex-shrink: 0;
}

.hero-logo-card {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 150px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.20);
    border-radius: 14px;
    background: rgba(255,255,255,0.97);
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
    overflow: hidden;
}

.hero-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ==========================================================
   CARTÕES SUPERIORES
========================================================== */
.top-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.top-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
    box-shadow: var(--shadow-small);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.top-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.top-label, .summary-label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.top-value, .summary-value {
    margin-top: 6px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 800;
}

/* ==========================================================
   ABAS PRINCIPAIS
========================================================== */
.main-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    padding: 5px;
    width: fit-content;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.main-tab-button {
    border: none;
    border-radius: 8px;
    padding: 9px 16px;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.main-tab-button:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.main-tab-button.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(11,75,120,0.22);
}

.main-tab-panel {
    width: 100%;
}

/* ==========================================================
   LAYOUT PRINCIPAL
========================================================== */
.simulation-layout {
    display: grid;
    grid-template-columns: minmax(360px, 0.95fr) minmax(600px, 2fr);
    gap: 16px;
    align-items: start;
}

/* ==========================================================
   PAINÉIS
========================================================== */
.control-panel, .result-panel {
    min-width: 0;
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
    background: var(--surface);
    box-shadow: var(--shadow-medium);
}

.panel-header {
    margin-bottom: 12px;
}

.panel-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 22px;
    line-height: 1.2;
    font-weight: 800;
}

.panel-description {
    margin: 5px 0 14px 0;
    color: var(--text-muted);
    font-size: 14px;
}

/* ==========================================================
   SEÇÕES DE CONFIGURAÇÃO
========================================================== */
.config-section {
    margin: 10px 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
}

.config-section-title {
    position: relative;
    padding: 14px 42px 14px 15px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: background 0.18s ease;
}

.config-section-title::-webkit-details-marker {
    display: none;
}

.config-section-title:hover {
    background: #f8fafc;
}

.config-section-title::after {
    content: "⌄";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 18px;
    transition: transform 0.18s ease;
}

.config-section[open] .config-section-title::after {
    transform: translateY(-50%) rotate(180deg);
}

.config-section-content {
    padding: 4px 14px 15px 14px;
    border-top: 1px solid #f1f5f9;
}

/* ==========================================================
   FORMULÁRIOS
========================================================== */
.form-group {
    margin-top: 14px;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.form-label {
    display: block;
    width: fit-content;
    margin-bottom: 5px;
    padding: 4px 7px;
    border-radius: 6px;
    background: #e8eaff;
    color: #5d69ff;
    font-size: 14px;
    font-weight: 800;
}

.form-info {
    margin: 0 0 8px 0;
    color: #94a3b8;
    font-size: 12.5px;
    line-height: 1.42;
}

.value-badge {
    flex-shrink: 0;
    min-width: 64px;
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: #ffffff;
    color: var(--text-primary);
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}

.section-description {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

/* ==========================================================
   INPUTS
========================================================== */
.number-input, .select-input {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    background: #ffffff;
    color: var(--text-primary);
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(15,23,42,0.03);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.number-input:hover, .select-input:hover {
    border-color: #94a3b8;
}

.number-input:focus, .select-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(2,132,199,0.12);
}

.number-input[readonly] {
    background: #f8fafc;
    color: var(--text-secondary);
    cursor: default;
}

.number-input:disabled, .select-input:disabled {
    opacity: 0.60;
    cursor: not-allowed;
    background: #f1f5f9;
}

/* ==========================================================
   SLIDERS
========================================================== */
.range-input {
    width: 100%;
    height: 6px;
    margin: 8px 0;
    border-radius: 999px;
    outline: none;
    cursor: pointer;
    accent-color: #6366f1;
}

.range-input::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: #e5e7eb;
}

.range-input::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    margin-top: -6px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #6366f1;
    box-shadow: 0 2px 7px rgba(15,23,42,0.25);
    -webkit-appearance: none;
}

.range-input::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: #e5e7eb;
}

.range-input::-moz-range-progress {
    height: 6px;
    border-radius: 999px;
    background: #6366f1;
}

.range-input::-moz-range-thumb {
    width: 17px;
    height: 17px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #6366f1;
    box-shadow: 0 2px 7px rgba(15,23,42,0.25);
}

.range-limits {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 3px;
    color: #94a3b8;
    font-size: 11px;
}

/* ==========================================================
   CAMPOS EM DUAS COLUNAS
========================================================== */
.two-column-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

/* ==========================================================
   MATERIAL
========================================================== */
.material-info {
    margin: 16px 0 5px 0;
    padding: 11px 13px;
    border-left: 3px solid #0284c7;
    border-right: 3px solid #0284c7;
    border-radius: 7px;
    background: #f8fcff;
    color: var(--text-primary);
}

.material-info h3 {
    margin: 0 0 7px 0;
    font-size: 16px;
    font-weight: 800;
}

.material-info p {
    margin: 4px 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.material-info.material-pec {
    border-color: #64748b;
    background: #f8fafc;
}

.material-info.material-pec h3 {
    color: #334155;
}

/* ==========================================================
   AVISO TEMPO REAL
========================================================== */
.live-note {
    margin: 15px 0;
    padding: 13px 14px;
    border-left: 4px solid #0284c7;
    border-right: 4px solid #0284c7;
    border-radius: 7px;
    background: #f8fcff;
    color: var(--text-secondary);
    font-size: 13px;
}

.live-note strong {
    color: var(--text-primary);
}

.live-note p {
    margin: 4px 0 0 0;
}

/* ==========================================================
   BOTÕES
========================================================== */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 45px;
    padding: 10px 15px;
    border: none;
    border-radius: 9px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:active:not(:disabled) {
    transform: translateY(0);
}

.button:focus-visible {
    outline: 3px solid rgba(2,132,199,0.22);
    outline-offset: 2px;
}

.button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
    transform: none;
}

.button-icon {
    line-height: 1;
}

.button-primary {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #ffffff;
    box-shadow: 0 5px 14px rgba(79,70,229,0.24);
}

.button-primary:hover:not(:disabled) {
    box-shadow: 0 7px 18px rgba(79,70,229,0.32);
}

.button-stop {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #ffffff;
    box-shadow: 0 5px 14px rgba(220,38,38,0.20);
}

.button-video {
    width: 100%;
    margin-top: 10px;
    background: #0f172a;
    color: #ffffff;
    box-shadow: 0 5px 14px rgba(15,23,42,0.18);
}

.button-video:hover:not(:disabled) {
    background: #1e293b;
}

.button-secondary {
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid #cbd5e1;
}

.button-secondary:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #94a3b8;
}

.live-buttons-row, .secondary-buttons-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.secondary-buttons-row {
    margin-top: 9px;
}

/* ==========================================================
   ABAS DOS RESULTADOS
========================================================== */
.result-tabs {
    display: flex;
    gap: 5px;
    margin: 8px 0 14px 0;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
}

.result-tab-button {
    flex: 1;
    padding: 9px 14px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.result-tab-button:hover {
    background: #ffffff;
}

.result-tab-button.active {
    background: #ffffff;
    color: #4f46e5;
    box-shadow: 0 2px 8px rgba(15,23,42,0.09);
}

.result-tab-panel {
    width: 100%;
}

.result-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.result-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 750;
}

/* ==========================================================
   ESTADOS
========================================================== */
.state-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.state-idle {
    background: #f1f5f9;
    color: #64748b;
}

.state-running {
    background: #dbeafe;
    color: #1d4ed8;
}

.state-success {
    background: var(--success-light);
    color: var(--success);
}

.state-stopped {
    background: var(--warning-light);
    color: var(--warning);
}

.state-error {
    background: var(--danger-light);
    color: var(--danger-dark);
}

/* ==========================================================
   ÁREA DE VISUALIZAÇÃO
========================================================== */
.visualization-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 560px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #ffffff;
    overflow: hidden;
}

.result-placeholder {
    max-width: 440px;
    padding: 40px 20px;
    color: #94a3b8;
    text-align: center;
}

.placeholder-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 13px auto;
    border-radius: 50%;
    background: #f1f5f9;
    color: #6366f1;
    font-size: 33px;
    font-weight: 700;
}

.result-placeholder h3 {
    margin: 0 0 8px 0;
    color: var(--text-secondary);
    font-size: 17px;
}

.result-placeholder p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
}

/* ==========================================================
   IMAGEM E VÍDEO
========================================================== */
.live-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 750px;
    object-fit: contain;
    background: #ffffff;
}

.video-output {
    display: block;
    width: 100%;
    max-height: 750px;
    background: #ffffff;
}

/* ==========================================================
   CARREGAMENTO
========================================================== */
.loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(255,255,255,0.90);
    backdrop-filter: blur(2px);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.spinner {
    width: 38px;
    height: 38px;
    border: 4px solid #e2e8f0;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spinner-animation 0.75s linear infinite;
}

@keyframes spinner-animation {
    to {transform: rotate(360deg);}
}

/* ==========================================================
   ESTATÍSTICAS TEMPO REAL
========================================================== */
.live-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-top: 11px;
}

.live-stat-card {
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
    text-align: center;
}

.live-stat-label {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.live-stat-value {
    margin-top: 4px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

/* ==========================================================
   STATUS
========================================================== */
.status-box {
    margin-top: 11px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 9px;
    font-size: 13px;
}

.status-box p {
    margin: 4px 0 0 0;
}

.status-neutral {
    border-color: #e2e8f0;
    background: #f8fafc;
    color: var(--text-secondary);
}

.status-info {
    border-color: #bae6fd;
    background: #f0f9ff;
    color: #075985;
}

.status-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.status-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

/* ==========================================================
   DOWNLOAD
========================================================== */
.download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 11px;
    min-height: 42px;
    padding: 9px 15px;
    border-radius: 8px;
    background: #0284c7;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(2,132,199,0.20);
    transition: all 0.18s ease;
}

.download-button:hover {
    background: #0369a1;
    transform: translateY(-1px);
}

/* ==========================================================
   RESUMO
========================================================== */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.summary-card {
    padding: 14px 10px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #f8fafc;
    box-shadow: var(--shadow-small);
    text-align: center;
}

.summary-card.summary-success {
    border-color: rgba(2,132,199,0.30);
    background: #f0f9ff;
}

/* ==========================================================
   RELATÓRIO
========================================================== */
.execution-report {
    margin-top: 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #ffffff;
    overflow: hidden;
}

.execution-report-title {
    position: relative;
    padding: 13px 40px 13px 14px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
    list-style: none;
}

.execution-report-title::-webkit-details-marker {
    display: none;
}

.execution-report-title::after {
    content: "⌄";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.execution-report[open] .execution-report-title::after {
    transform: translateY(-50%) rotate(180deg);
}

.execution-report-content {
    padding: 13px 14px 15px 14px;
    border-top: 1px solid #f1f5f9;
}

.report-status {
    color: var(--text-secondary);
    font-size: 13px;
}

.report-status p {
    margin: 5px 0;
}

.report-table-container {
    width: 100%;
    margin-top: 12px;
    overflow-x: auto;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.report-table th, .report-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
}

.report-table th {
    width: 48%;
    color: var(--text-secondary);
    font-weight: 700;
    background: #f8fafc;
}

.report-table td {
    color: var(--text-primary);
    font-weight: 550;
}

.report-table tr:last-child th, .report-table tr:last-child td {
    border-bottom: none;
}

/* ==========================================================
   INFORMAÇÕES TÉCNICAS
========================================================== */
.technical-header {
    margin-bottom: 14px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #ffffff;
    box-shadow: var(--shadow-small);
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 14px;
}

.tech-card {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--shadow-small);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.tech-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.tech-title {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 800;
}

.tech-text {
    color: var(--text-secondary);
    line-height: 1.65;
}

.technical-flow {
    margin-top: 14px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--shadow-small);
}

.technical-flow h3 {
    margin: 0 0 12px 0;
    color: var(--text-primary);
    font-size: 19px;
}

.technical-flow ol {
    margin: 0;
    padding-left: 24px;
    color: var(--text-secondary);
}

.technical-flow li {
    margin: 7px 0;
}

.technical-note {
    margin-top: 14px;
    padding: 12px 14px;
    border-left: 4px solid var(--primary-light);
    border-radius: 6px;
    background: #f0f9ff;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* ==========================================================
   RODAPÉ
========================================================== */
.footer {
    margin-top: 20px;
    padding: 17px 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    text-align: center;
    font-size: 12px;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px 20px;
}

.footer strong {
    color: var(--text-secondary);
}

/* ==========================================================
   TOASTS
========================================================== */
.toast-container {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 9px;
    width: min(360px, calc(100vw - 36px));
    pointer-events: none;
}

.toast {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    color: var(--text-primary);
    box-shadow: 0 10px 28px rgba(15,23,42,0.17);
    font-size: 13px;
    pointer-events: auto;
    animation: toast-in 0.25s ease-out;
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-info {
    border-left: 4px solid var(--primary-light);
}

.toast-warning {
    border-left: 4px solid #f59e0b;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(18px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================================
   SELEÇÃO E SCROLL
========================================================== */
::selection {
    background: rgba(99,102,241,0.20);
    color: #0f172a;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    border: 2px solid #f1f5f9;
    border-radius: 999px;
    background: #cbd5e1;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================
   RESPONSIVIDADE
========================================================== */
@media (max-width: 1200px) {
    .simulation-layout {
        grid-template-columns: minmax(330px, 0.9fr) minmax(500px, 1.7fr);
    }

    .hero-logo-card {
        width: 130px;
        height: 130px;
    }

    .visualization-container {
        min-height: 500px;
    }
}

@media (max-width: 1000px) {
    .simulation-layout {
        grid-template-columns: 1fr;
    }

    .control-panel, .result-panel {
        width: 100%;
    }

    .visualization-container {
        min-height: 520px;
    }
}

@media (max-width: 950px) {
    .hero-box {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-logos {
        width: 100%;
        justify-content: center;
    }

    .top-grid, .summary-grid {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }

    .tech-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .app-container {
        width: calc(100% - 20px);
        padding-top: 10px;
    }

    .hero-box {
        padding: 22px 18px;
        gap: 20px;
        border-radius: 15px;
    }

    .hero-title {
        font-size: 26px;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    .hero-logo-card {
        width: 110px;
        height: 110px;
        padding: 7px;
    }

    .main-tabs {
        width: 100%;
    }

    .main-tab-button {
        flex: 1;
    }

    .control-panel, .result-panel {
        padding: 13px;
        border-radius: 14px;
    }

    .two-column-inputs {
        grid-template-columns: 1fr;
    }

    .live-buttons-row, .secondary-buttons-row {
        grid-template-columns: 1fr;
    }

    .live-stats {
        grid-template-columns: 1fr;
    }

    .result-title-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .visualization-container {
        min-height: 380px;
    }

    .top-grid, .summary-grid {
        grid-template-columns: 1fr;
    }

    .report-table th {
        width: 52%;
    }

    .footer-content {
        flex-direction: column;
    }
}

@media (max-width: 460px) {
    .hero-logos {
        gap: 8px;
    }

    .hero-logo-card {
        width: 95px;
        height: 95px;
    }

    .hero-title {
        font-size: 23px;
    }

    .hero-badge {
        font-size: 10px;
    }

    .visualization-container {
        min-height: 310px;
    }

    .panel-title {
        font-size: 19px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ==========================================================
   EXECUÇÃO LOCAL FDTD
========================================================== */
canvas.live-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 780px;
    background: white;
}

.local-runtime {
    border-color: #bbf7d0 !important;
    background: #f0fdf4 !important;
    color: #166534 !important;
}


#liveCanvas {
    background: #ffffff !important;
    background-color: #ffffff !important;
}
.live-canvas {
    background: #ffffff !important;
    background-color: #ffffff !important;
}
canvas {
    background-color: transparent;
}
