:root {
    --ink: #15251f;
    --muted: #64736d;
    --paper: #fbf6e9;
    --card: #fffdf5;
    --line: #e6dcc6;
    --forest: #17453b;
    --mint: #b8dcc8;
    --clay: #c86f43;
    --gold: #f0c35b;
    --danger: #a43d35;
    --shadow: 0 20px 60px rgba(36, 48, 40, .14);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "Aptos", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 10% 10%, rgba(240, 195, 91, .35), transparent 28rem),
        radial-gradient(circle at 90% 0%, rgba(184, 220, 200, .75), transparent 24rem),
        linear-gradient(135deg, #fffaf0, #edf7ef 60%, #f7efe2);
}

a { color: var(--forest); text-decoration: none; font-weight: 700; }
input, select, textarea, button {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: .85rem 1rem;
    font: inherit;
    background: #fffef8;
    color: var(--ink);
}
input[type="checkbox"] { width: auto; }
textarea { min-height: 110px; resize: vertical; }
label { display: grid; gap: .45rem; color: var(--muted); font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 4.3rem); line-height: .9; letter-spacing: -.06em; margin: 0 0 1rem; }
h2 { margin-top: 0; }
pre { white-space: pre-wrap; font-family: inherit; line-height: 1.65; }

.app-shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 1.5rem;
    background: rgba(255, 253, 245, .72);
    backdrop-filter: blur(18px);
    border-right: 1px solid rgba(23, 69, 59, .12);
}
.brand {
    display: inline-flex;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    letter-spacing: -.04em;
}
.brand::before {
    content: "";
    width: 1.05rem;
    height: 1.05rem;
    margin-right: .55rem;
    border-radius: 50% 50% 10% 50%;
    background: var(--clay);
    transform: rotate(-20deg);
}
nav { display: grid; gap: .45rem; }
nav a, .linklike {
    display: block;
    border: 0;
    background: transparent;
    text-align: left;
    color: var(--ink);
    padding: .8rem 1rem;
    border-radius: 16px;
}
nav a:hover, .linklike:hover { background: rgba(184, 220, 200, .45); }
.content { padding: clamp(1rem, 4vw, 3rem); max-width: 1280px; width: 100%; }
.public-page .app-shell { grid-template-columns: 1fr; }
.public-page .sidebar {
    position: static;
    height: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid rgba(23, 69, 59, .12);
}
.public-page .brand { margin-bottom: 0; }
.public-page .content { max-width: 1180px; margin: 0 auto; }

.card, .auth-card {
    background: rgba(255, 253, 245, .88);
    border: 1px solid rgba(23, 69, 59, .12);
    border-radius: 28px;
    padding: clamp(1rem, 3vw, 2rem);
    box-shadow: var(--shadow);
}
.stack { display: grid; gap: 1rem; }
.narrow, .auth-card { max-width: 560px; margin: 6vh auto; }
.auth-grid { display: grid; place-items: center; min-height: 80vh; }
.install-screen { display: grid; place-items: center; padding: 1rem; }
.form-grid, .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.cards { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 1rem 0; }
.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    border-radius: 36px;
    background:
        linear-gradient(135deg, rgba(23, 69, 59, .95), rgba(33, 92, 71, .88)),
        var(--forest);
    color: #fff8df;
    box-shadow: var(--shadow);
}
.hero p { color: rgba(255, 248, 223, .78); margin: 0; }
.stat strong {
    display: block;
    font-size: clamp(2rem, 5vw, 3.6rem);
    letter-spacing: -.07em;
}
.stat small, small { color: var(--muted); }
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: .5rem;
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    padding: .9rem 1.25rem;
    background: var(--mint);
    color: var(--ink);
    font-weight: 800;
}
.btn.primary { background: var(--forest); color: #fff8df; }
.btn.ghost { background: rgba(255, 255, 255, .18); color: #fff8df; border: 1px solid rgba(255,255,255,.3); }
.danger { color: var(--danger); }
.hidden { display: none; }
.quick-actions, .inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    margin: 1rem 0;
}
.quick-actions > *, .inline-form > * { flex: 1 1 170px; }
.disclaimer, .alert, .success {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 22px;
    background: #fff2c9;
    border: 1px solid #edcd73;
}
.alert { background: #ffe4df; border-color: #f1afa4; }
.success { background: #dff5e7; border-color: #a8d7b8; }
.chips { display: flex; flex-wrap: wrap; gap: .65rem; }
.chips span {
    padding: .7rem 1rem;
    border-radius: 999px;
    background: rgba(184, 220, 200, .55);
    font-weight: 800;
}
.table { display: grid; gap: .7rem; }
.table > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, .55);
}
.ad {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--card);
    border: 1px dashed var(--clay);
    border-radius: 24px;
}
.ad img { width: 72px; height: 72px; object-fit: cover; border-radius: 18px; }
.bars {
    min-height: 160px;
    display: flex;
    align-items: end;
    gap: .45rem;
    padding: 1rem;
    background: rgba(23, 69, 59, .07);
    border-radius: 20px;
}
.bars span { flex: 1; min-height: 12px; border-radius: 10px 10px 0 0; background: var(--clay); }
.empty { padding: 2rem; border-radius: 24px; background: rgba(255,255,255,.6); }
.public-hero {
    min-height: 420px;
    display: grid;
    align-items: end;
    padding: clamp(1.5rem, 5vw, 4rem);
    border-radius: 40px;
    color: #fff8df;
    background:
        radial-gradient(circle at 85% 20%, rgba(240, 195, 91, .85), transparent 12rem),
        linear-gradient(135deg, rgba(23, 69, 59, .98), rgba(200, 111, 67, .78)),
        var(--forest);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.public-hero p { max-width: 760px; color: rgba(255, 248, 223, .82); font-size: 1.1rem; }
.eyebrow {
    display: inline-flex;
    margin-bottom: 1rem;
    padding: .55rem .85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255,255,255,.28);
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: .78rem;
}
.tool-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 1.2rem 0;
}
.tool-card {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    border-radius: 30px;
    background: rgba(255, 253, 245, .9);
    border: 1px solid rgba(23, 69, 59, .12);
    box-shadow: var(--shadow);
    color: var(--ink);
    transition: transform .18s ease, box-shadow .18s ease;
    position: relative;
}
.tool-card:hover { transform: translateY(-4px); box-shadow: 0 28px 70px rgba(36,48,40,.18); }
.tool-card span {
    width: 4rem;
    height: 4rem;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: var(--forest);
    color: #fff8df;
    font-weight: 900;
}
.tool-card h2 { margin: 1rem 0 .4rem; letter-spacing: -.04em; }
.tool-card p, .muted { color: var(--muted); }
.tool-card::after {
    content: "Começar";
    display: inline-flex;
    justify-content: center;
    margin-top: 1rem;
    padding: .8rem 1rem;
    border-radius: 999px;
    background: var(--mint);
    color: var(--ink);
    font-weight: 900;
}
.wizard-card { margin-top: 1rem; }
.progress {
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(23, 69, 59, .1);
}
.progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--clay), var(--gold));
}
.wizard-step {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, .48);
    border: 1px solid rgba(23, 69, 59, .08);
}
.wizard-step > b { font-size: 1.15rem; }
.checkchips label {
    display: inline-flex;
    grid-template-columns: auto;
    align-items: center;
    gap: .45rem;
    color: var(--ink);
}
.result-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cta-card {
    margin-top: 1rem;
    background:
        linear-gradient(135deg, rgba(184, 220, 200, .75), rgba(255, 253, 245, .95));
}
.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: .75rem;
    align-items: center;
    padding: 1rem;
    border-radius: 24px;
    background: rgba(255, 253, 245, .96);
    border: 1px solid rgba(23, 69, 59, .18);
    box-shadow: var(--shadow);
}
.cookie-banner p { margin: .25rem 0 0; color: var(--muted); }
.inline-check {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .65rem;
}
.chip-btn {
    width: auto;
    border: 0;
    border-radius: 999px;
    padding: .7rem 1rem;
    background: rgba(184, 220, 200, .7);
    font-weight: 800;
    cursor: pointer;
}
.schema-change {
    padding: 1rem;
    margin: .75rem 0;
    border-radius: 18px;
    background: rgba(255,255,255,.55);
    border: 1px solid var(--line);
}

@media (max-width: 920px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(23, 69, 59, .12);
    }
    nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .cards, .form-grid, .tool-grid, .result-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cookie-banner { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .content { padding: 1rem; }
    .hero { display: grid; padding: 1.4rem; border-radius: 28px; }
    .cards, .form-grid, .grid, .tool-grid, .result-cards { grid-template-columns: 1fr; }
    nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    h1 { font-size: 2.5rem; }
    .public-hero { min-height: auto; border-radius: 28px; }
    .tool-card { min-height: 180px; }
}

/* Public professional layout overrides */
.app-shell { display: block; min-height: auto; }
.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem clamp(1rem, 4vw, 3rem);
    background: rgba(255, 253, 245, .9);
    border-bottom: 1px solid rgba(23, 69, 59, .12);
    backdrop-filter: blur(18px);
}
.site-nav {
    display: flex;
    align-items: center;
    gap: .35rem;
}
.site-nav a {
    color: var(--ink);
    padding: .78rem .95rem;
    border-radius: 999px;
    white-space: nowrap;
}
.site-nav a:hover {
    background: rgba(184, 220, 200, .45);
    transform: translateY(-1px);
}
.site-nav .nav-cta {
    background: var(--forest);
    color: #fff8df;
    margin-left: .35rem;
}
.menu-toggle {
    display: none;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 14px;
    background: var(--forest);
    padding: .65rem;
}
.menu-toggle span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: #fff8df;
    border-radius: 999px;
}
.hero-actions {
    display: flex;
    gap: .8rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}
.tool-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.1rem;
    margin: 1.5rem 0;
}
.tool-card {
    min-height: 245px;
    background: linear-gradient(180deg, rgba(255, 253, 245, .98), rgba(246, 239, 222, .9));
}
.tool-card::after { content: "Abrir"; }
.disclaimer {
    display: flex;
    gap: .65rem;
    align-items: flex-start;
    padding: .85rem 1rem;
    border-radius: 18px;
    font-size: .92rem;
    line-height: 1.45;
}
.disclaimer::before {
    content: "!";
    flex: 0 0 1.6rem;
    width: 1.6rem;
    height: 1.6rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #f0c35b;
    color: #5a3a00;
    font-weight: 900;
}
.site-footer {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 2rem 1rem 7rem;
    color: var(--muted);
}
.admin-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.admin-login-card { margin-top: 8vh; }

@media (max-width: 920px) {
    .menu-toggle { display: block; }
    .site-nav {
        position: fixed;
        top: 72px;
        right: 1rem;
        left: 1rem;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        border-radius: 24px;
        background: rgba(255, 253, 245, .98);
        border: 1px solid rgba(23,69,59,.14);
        box-shadow: var(--shadow);
    }
    .site-nav.open { display: flex; }
    .site-nav a {
        padding: 1rem;
        font-size: 1.05rem;
    }
    .site-nav .nav-cta {
        margin-left: 0;
        text-align: center;
    }
    .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    body { overflow-x: hidden; }
    .site-header { padding: .75rem 1rem; }
    .brand { font-size: 1.25rem; }
    .public-hero { padding: 1.35rem; }
    .hero-actions .btn { width: 100%; }
    .tool-grid { grid-template-columns: 1fr; }
    .tool-card { min-height: 210px; }
    .site-footer { padding-bottom: 8rem; }
}
