:root {
    --porto-blue: #003087;
    --porto-blue-light: #0046b8;
    --porto-cyan: #00adef;
    --bg: #f4f7fb;
    --text: #1a2b3c;
    --muted: #5a6a7a;
    --ok: #1b7f4a;
    --warn: #b45309;
    --erro: #b42318;
    --card: #fff;
    --radius: 12px;
    --shadow: 0 8px 30px rgba(0, 24, 80, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container { width: min(1100px, 92%); margin: 0 auto; }

.topbar {
    background: linear-gradient(90deg, var(--porto-blue), var(--porto-blue-light));
    color: #fff;
    padding: 1rem 0;
}

.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

.brand small { font-weight: 400; opacity: .85; }

.brand-mark {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: var(--porto-cyan);
    display: grid; place-items: center;
    font-weight: 800;
}

.env-badge {
    font-size: .75rem;
    background: rgba(255,255,255,.15);
    padding: .35rem .7rem;
    border-radius: 999px;
}

.main { flex: 1; padding: 2rem 0 3rem; }

.footer {
    background: #e8edf5;
    color: var(--muted);
    font-size: .85rem;
    padding: 1.25rem 0;
    text-align: center;
}

.hero {
    background: linear-gradient(135deg, var(--porto-blue) 0%, #001f5c 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.hero h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: .75rem; }
.hero p { opacity: .9; max-width: 55ch; margin-bottom: 1.5rem; }

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
}

.card h3 { color: var(--porto-blue); margin-bottom: .5rem; }

.card-info { border-left: 4px solid var(--porto-cyan); }
.card-warn { border-left: 4px solid var(--warn); background: #fff8eb; }

.page-head { margin-bottom: 1.5rem; }
.page-head h1 { color: var(--porto-blue); font-size: 1.75rem; }
.page-head p { color: var(--muted); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .7rem 1.25rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    font-size: .95rem;
}

.btn-primary { background: var(--porto-cyan); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; border: 1px solid #c5d0e0; color: var(--text); }
.btn-block { width: 100%; }

.form { display: flex; flex-direction: column; gap: 1.25rem; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.field { display: flex; flex-direction: column; gap: .35rem; }
.field span { font-size: .85rem; font-weight: 600; color: var(--muted); }
.field input, .field select {
    padding: .65rem .75rem;
    border: 1px solid #cfd8e6;
    border-radius: 8px;
    font: inherit;
}
.field-readonly {
    background: #eef2f8;
    color: #1a2b3c;
    cursor: not-allowed;
}
.trace-step { margin-top: .75rem; border-top: 1px solid #e2e8f0; padding-top: .75rem; }
.trace-step summary { cursor: pointer; font-weight: 600; }
.trace-step pre { max-height: 320px; overflow: auto; font-size: .75rem; background: #f8fafc; padding: .75rem; border-radius: 6px; margin-top: .5rem; }
.field-full { grid-column: 1 / -1; }

.fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
}
.fieldset legend { font-weight: 600; padding: 0 .5rem; }

.idades-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; }

.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

.section-title { font-size: 1.1rem; color: var(--porto-blue); }

.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
}
.alert-ok { background: #e8f7ef; color: var(--ok); border: 1px solid #b7e4c7; }
.alert-erro { background: #fdecea; color: var(--erro); border: 1px solid #f5c2c0; }
.alert-warn { background: #fff4e5; color: var(--warn); border: 1px solid #ffd8a8; }

.planos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.plano-preco { font-size: 1.5rem; font-weight: 700; color: var(--porto-blue); margin: .5rem 0; }
.plano-hml { font-size: .85rem; margin-bottom: .75rem; }
.plano-ok { border-top: 3px solid var(--ok); }
.plano-warn { border-top: 3px solid var(--warn); }

.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.text-muted { color: var(--muted); font-size: .9rem; }
.text-center { text-align: center; }

.list-plain { list-style: none; margin-top: .75rem; }
.list-plain li { padding: .25rem 0; }

.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1.25rem; }
.mb-2 { margin-bottom: 1.25rem; }

pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    overflow: auto;
    font-size: .8rem;
    margin-top: .75rem;
}

.icon-ok, .icon-erro {
    width: 64px; height: 64px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
}
.icon-ok { background: #e8f7ef; color: var(--ok); }
.icon-erro { background: #fdecea; color: var(--erro); }

code { background: #eef2f8; padding: .1rem .35rem; border-radius: 4px; font-size: .9em; }
