/* Reset básico */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container { max-width: 1200px; margin: 0 auto; width: 100%; }

header { text-align: center; color: white; margin-bottom: 30px; }
header h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 700; margin-bottom: 8px; text-shadow: 2px 2px 4px rgba(0,0,0,0.3); }
header p { font-size: 1rem; opacity: 0.9; }

.test-panel {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* Input Group */
.input-group { margin-bottom: 15px; }
.input-group label { display: block; font-weight: 600; margin-bottom: 8px; color: #1e3c72; }
.input-with-button { display: flex; gap: 12px; flex-wrap: wrap; }
.input-with-button input {
    flex: 1; min-width: 250px; padding: 15px 20px;
    border: 2px solid #e0e0e0; border-radius: 12px; font-size: 1rem;
    transition: border-color 0.3s;
}
.input-with-button input:focus { outline: none; border-color: #2a5298; }

.btn-primary {
    padding: 15px 30px;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white; border: none; border-radius: 12px;
    font-size: 1rem; font-weight: 600; cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex; align-items: center; gap: 8px;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(30, 60, 114, 0.4); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.quick-tips { font-size: 0.9rem; color: #666; margin-top: 10px; }

/* Progresso */
.progress-section { margin-top: 25px; padding: 20px; background: #f8f9fa; border-radius: 12px; }
.progress-info { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 8px; color: #1e3c72; }
.progress-bar { width: 100%; height: 10px; background: #e0e0e0; border-radius: 5px; overflow: hidden; }
.progress { height: 100%; width: 0%; background: linear-gradient(90deg, #1e3c72, #2a5298); transition: width 0.3s ease; }

/* Grid de Resultados */
.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

/* Cartões de Análise */
.analysis-card {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}
.analysis-card:hover { transform: translateY(-2px); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.card-header h2 { font-size: 1.1rem; font-weight: 600; color: #1e3c72; }

/* Métrica Principal */
.main-metric { grid-column: 1 / -1; text-align: center; } /* Ocupa a linha toda */
.metric-value { font-size: 3.5rem; font-weight: 700; color: #1e3c72; margin: 10px 0; }
.metric-desc { color: #666; font-size: 0.95rem; margin-bottom: 20px; }
.badge { padding: 4px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; }
.badge.good { background: #d4edda; color: #155724; }
.badge.average { background: #fff3cd; color: #856404; }
.badge.poor { background: #f8d7da; color: #721c24; }

.ttfb-scale { display: flex; width: 100%; height: 12px; border-radius: 6px; overflow: hidden; margin-top: 10px; }
.scale-segment { display: flex; align-items: center; justify-content: center; font-size: 0.7rem; color: #fff; font-weight: 600; }
.scale-segment.good { background: #28a745; flex: 1; }
.scale-segment.average { background: #ffc107; flex: 1; }
.scale-segment.poor { background: #dc3545; flex: 1; }

/* Listas de Configuração/Segurança */
.config-list, .security-list { list-style: none; }
.config-list li, .security-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.95rem;
}
.config-list li:last-child, .security-list li:last-child { border-bottom: none; }
.item-status { font-weight: 600; }
.status-ok { color: #28a745; }
.status-warn { color: #ffc107; }
.status-fail { color: #dc3545; }

/* Redirecionamentos */
.redirect-chain { font-family: monospace; font-size: 0.9rem; background: #f8f9fa; padding: 12px; border-radius: 8px; word-break: break-all; }
.redirect-hop { margin-bottom: 5px; color: #555; }
.redirect-hop .code { color: #2a5298; font-weight: 600; }

/* Preview */
.preview-card { grid-column: 1 / -1; }
.preview-wrapper { position: relative; width: 100%; height: 400px; background: #f8f9fa; border-radius: 12px; overflow: hidden; border: 1px solid #eef0f3; }
.preview-wrapper iframe { width: 100%; height: 100%; border: none; }
.preview-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.9); font-weight: 600; color: #666; }

/* Footer */
.footer { margin-top: 30px; text-align: center; }
.footer-card { color: rgba(255,255,255,0.8); font-size: 0.9rem; }
.footer-card a { color: #fff; text-decoration: underline; }

/* Responsividade */
@media (max-width: 600px) {
    .input-with-button { flex-direction: column; }
    .btn-primary { width: 100%; justify-content: center; }
    .metric-value { font-size: 2.5rem; }
}