:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #1f2937;
    --muted: #64748b;
    --line: #dbe4ef;
    --primary: #006b7a;
    --primary-strong: #004d61;
    --accent: #f26f3d;
    --success: #168a52;
    --warning: #b46b00;
    --danger: #b42318;
    --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background:
        linear-gradient(135deg, rgba(0, 107, 122, 0.12), rgba(242, 111, 61, 0.10)),
        var(--bg);
    color: var(--text);
}

.page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
}

.consulta {
    width: min(100%, 760px);
    background: var(--panel);
    border: 1px solid rgba(219, 228, 239, 0.9);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 32px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.brand-mark {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 6px;
    font-size: clamp(1.45rem, 3vw, 2rem);
    line-height: 1.15;
}

.brand p,
#status-descricao,
.label {
    color: var(--muted);
}

.form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
}

label {
    grid-row: 1;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
}

input {
    grid-row: 2;
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 13px;
    font: inherit;
    color: var(--text);
    background: #fff;
}

input:focus {
    outline: 3px solid rgba(0, 107, 122, 0.18);
    border-color: var(--primary);
}

button {
    grid-row: 2;
    min-height: 46px;
    border: 0;
    border-radius: 6px;
    padding: 0 20px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

button:hover,
button:focus {
    background: var(--primary-strong);
}

button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.feedback {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 6px;
    background: #fff4e8;
    color: #7a3f00;
    border: 1px solid #ffd7a8;
}

.resultado {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.resultado-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #e8f5ef;
    color: var(--success);
    font-size: 0.85rem;
    font-weight: 700;
}

.status-badge[data-etapa="negada"],
.status-badge[data-etapa="devolvida"] {
    background: #fff0ee;
    color: var(--danger);
}

.status-badge[data-etapa="analise"] {
    background: #fff7e8;
    color: var(--warning);
}

.label {
    margin-bottom: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.timeline {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-bottom: 24px;
}

.timeline-step {
    height: 8px;
    border-radius: 999px;
    background: var(--line);
}

.timeline-step.is-active {
    background: var(--accent);
}

h2 {
    margin-bottom: 10px;
    font-size: 1.35rem;
}

.detalhes {
    display: grid;
    gap: 12px;
    margin: 22px 0 0;
}

.detalhes div {
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

dt {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

dd {
    margin: 0;
    line-height: 1.5;
}

dd a {
    display: inline-block;
    margin-left: 10px;
    color: var(--primary);
    font-weight: 700;
}

[hidden] {
    display: none !important;
}

@media (max-width: 720px) {
    .consulta {
        padding: 22px;
    }

    .brand,
    .resultado-header {
        align-items: flex-start;
        flex-direction: column;
    }

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

    label,
    input,
    button {
        grid-row: auto;
    }

    button {
        width: 100%;
    }

    dd a {
        display: block;
        margin: 8px 0 0;
    }
}
