/* ============================================================
   GTAs Públicas — AGRODEFESA
   CSS Completo — Padrão VERDE FLORESTA
   ============================================================ */

* {
    box-sizing: border-box;
}

:root {
    --brand: #2d4a3e;
    --brand-dark: #1e3329;
    --brand-light: #e8f0ec;
    --brand-soft: #f2f7f4;
    --green: #4a8f68;
    --green-dark: #356e4c;
    --ink: #17324d;
    --ink-soft: #34495e;
    --muted: #64748b;
    --line: #dce7ef;
    --surface: #ffffff;
    --bg: #f2f7f8;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: 'DM Sans', 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    overflow-x: hidden;
}

/* ========== HEADER ========== */
.header {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    padding: 18px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 12px rgba(30, 51, 41, 0.3);
}

.header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.header .subtitle {
    font-size: 13px;
    opacity: 0.85;
    margin-top: 3px;
}

.header .badge {
    background: rgba(255, 255, 255, 0.14);
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ========== STEPPER ========== */
.stepper {
    background: var(--surface);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
    border-bottom: 1px solid var(--line);
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: transparent;
    font-family: inherit;
    user-select: none;
}

.step:hover {
    background: var(--brand-soft);
}

.step.active {
    background: var(--brand-light);
    border-color: var(--brand);
}

.step.completed .step-number {
    background: var(--green);
    color: #fff;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--line);
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.step.active .step-number {
    background: var(--brand);
    color: #fff;
}

.step-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}

.step.active .step-label {
    color: var(--brand-dark);
}

.step.completed .step-label {
    color: var(--ink);
}

.step-connector {
    width: 40px;
    height: 2px;
    background: var(--line);
    border-radius: 2px;
}

/* ============================================================
   PAINÉIS — Regra simples que funciona
   ============================================================ */
.step-panel {
    display: none;
    flex-direction: column;
}

.step-panel.active {
    display: flex;
}

/* ========== PAINEL INFO ========== */
.panel-info {
    background: var(--surface);
    padding: 16px 28px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.panel-info h2 {
    margin: 0;
    font-size: 17px;
    color: var(--ink);
}

.panel-info p {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: var(--muted);
}

.panel-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ========== BOTÕES ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--brand);
    color: #fff;
}

.btn-primary:hover {
    background: var(--brand-dark);
}

.btn-success {
    background: var(--green);
    color: #fff;
}

.btn-success:hover {
    background: var(--green-dark);
}

.btn-outline {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid #c9d8e1;
}

.btn-outline:hover {
    background: var(--brand-soft);
    border-color: var(--brand);
}

/* ========== IFRAMES ========== */
.iframe-container {
    position: relative;
    background: var(--surface);
    width: 100%;
}

.iframe-container iframe {
    width: 100%;
    border: 0;
    display: block;
}

#iframe-kibana {
    height: 10000px;
    overflow: hidden;
}

#iframe-php {
    height: 1400px;
    overflow: hidden;
}

/* ========== LOADING ========== */
.loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafb;
    color: var(--muted);
    font-size: 14px;
    flex-direction: column;
    gap: 12px;
    transition: opacity 0.4s;
    z-index: 5;
}

.loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--line);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   INSTRUÇÕES
   ============================================================ */
.instructions {
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 28px 60px;
}

.section-header {
    margin-bottom: 32px;
    text-align: left;
}

.section-header h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 800;
    color: var(--brand-dark);
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.section-header p {
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
    color: var(--muted);
    overflow-wrap: break-word;
}

.section-divider {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #d5e4db;
}

.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 40px;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(23, 50, 77, 0.06);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(23, 50, 77, 0.1);
}

.feature-head {
    padding: 24px 26px 20px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
}

.feature-head .icon {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
}

.feature-head h3 {
    margin: 0 0 6px 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.feature-head p {
    margin: 0;
    font-size: 13.5px;
    opacity: 0.85;
    line-height: 1.5;
}

.feature-body {
    padding: 24px 26px;
    flex: 1;
}

.feature-body h4 {
    margin: 0 0 12px 0;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--brand);
    line-height: 1.4;
}

.feature-list {
    list-style: none;
    margin: 0 0 20px 0;
    padding: 0;
}

.feature-list li {
    position: relative;
    padding: 10px 0 10px 32px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink-soft);
    border-bottom: 1px solid #f0f4f6;
    overflow-wrap: break-word;
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 11px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.columns-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 32px;
    box-shadow: 0 4px 16px rgba(23, 50, 77, 0.05);
}

.columns-section h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: var(--brand-dark);
    line-height: 1.4;
}

.columns-section>p {
    margin: 0 0 22px 0;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
}

.columns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.column-card {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: var(--brand-soft);
    border-radius: 10px;
    border-left: 3px solid var(--brand);
    min-width: 0;
}

.column-card:hover {
    background: var(--brand-light);
}

.column-card .num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.column-card .info {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
}

.column-card .info strong {
    display: block;
    font-size: 13.5px;
    color: var(--brand-dark);
    margin-bottom: 2px;
    font-weight: 700;
    line-height: 1.4;
}

.column-card .info span {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
    display: block;
    overflow-wrap: break-word;
}

.steps-guide {
    background: linear-gradient(135deg, var(--brand-light) 0%, var(--brand-soft) 100%);
    border-radius: 16px;
    padding: 28px 32px;
    border: 1px solid #d5e4db;
}

.steps-guide h3 {
    margin: 0 0 18px 0;
    font-size: 18px;
    color: var(--brand-dark);
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.steps-guide ol {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.steps-guide ol li {
    counter-increment: step;
    position: relative;
    padding: 12px 0 12px 44px;
    font-size: 14.5px;
    color: var(--ink-soft);
    line-height: 1.6;
    border-bottom: 1px solid #d5e4db;
    overflow-wrap: break-word;
}

.steps-guide ol li:last-child {
    border-bottom: none;
}

.steps-guide ol li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 11px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.notice-box {
    display: flex;
    gap: 14px;
    padding: 18px 22px;
    background: #fff8e1;
    border-left: 4px solid #f0ad4e;
    border-radius: 10px;
    margin-bottom: 32px;
}

.notice-box .icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
}

.notice-box>div {
    min-width: 0;
    flex: 1;
}

.notice-box strong {
    display: block;
    color: #8a6d3b;
    margin-bottom: 4px;
    font-size: 14px;
}

.notice-box p {
    margin: 0;
    color: #8a6d3b;
    font-size: 13.5px;
    line-height: 1.6;
}

/* ========== RESPONSIVO ========== */
@media (max-width: 900px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .step-label {
        display: none;
    }

    .step.active .step-label {
        display: inline;
    }

    .step-connector {
        width: 20px;
    }

    .panel-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .panel-actions {
        width: 100%;
    }

    .panel-actions .btn {
        flex: 1;
        justify-content: center;
    }

    #iframe-kibana {
        height: 8000px;
    }

    .instructions {
        padding: 24px 16px 40px;
    }

    .section-header h2 {
        font-size: 20px;
    }

    .header {
        padding: 12px 18px;
    }

    .header h1 {
        font-size: 16px;
    }

    .columns-section,
    .steps-guide {
        padding: 20px;
    }

    /* ============================================================
   AVISO VERDE — mesmo formato do notice-box amarelo
   ============================================================ */
    .notice-box.notice-green {
        background: var(--green-light);
        border-left-color: var(--green-dark);
        margin-bottom: 36px;
    }

    .notice-box.notice-green .icon {
        font-size: 24px;
    }

    .notice-box.notice-green strong {
        color: var(--green-dark);
        font-size: 15px;
    }

    .notice-box.notice-green p {
        color: var(--ink-soft);
        font-size: 13.5px;
        line-height: 1.65;
    }
}