/* Área pública do Painel.
   Tokens do design system Caferon (seção 12.1 do PRD). */
:root {
    --teal: #157065;
    --teal-mid: #145454;
    --teal-deep: #0b3d38;
    --teal-ink: #072824;
    --lime: #61a229;
    --lime-dark: #4e8221;
    --gold: #ffb900;
    --gold-bright: #ffec21;
    --paper: #f3f6f4;
    --white: #ffffff;
    --ink: #1a2e24;
    --muted: #4d5f57;
    --line: #d5e0db;
    --focus: #ffb900;
}

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

body.public {
    font-family: 'Source Sans 3', system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background: var(--paper);
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
}

a { color: inherit; }

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

/* ── Painel de marca ── */
.public-aside {
    position: relative;
    background:
        linear-gradient(105deg, rgba(7, 40, 36, 0.94) 0%, rgba(21, 112, 101, 0.82) 48%, rgba(78, 130, 33, 0.6) 100%),
        var(--teal-deep);
    color: #fff;
    padding: 3.5rem 4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.public-aside::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.22;
    background: repeating-linear-gradient(-18deg, transparent 0 18px, rgba(255, 255, 255, 0.07) 18px 19px);
    pointer-events: none;
}

.public-aside > * { position: relative; z-index: 1; }

/* A logo é policromática sobre fundo claro; a placa branca a mantém
   legível sobre o gradiente escuro do aside. */
.public-brand {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    padding: 1.4rem 1.85rem;
    border-radius: 22px;
    background: var(--white);
    box-shadow: 0 18px 48px rgba(7, 40, 36, 0.38);
    text-decoration: none;
}

.public-brand img {
    display: block;
    height: 132px;
    width: auto;
}

.public-kicker {
    display: inline-flex;
    align-items: center;
    font-family: 'Barlow Condensed', system-ui, sans-serif;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--gold-bright);
    border-left: 3px solid var(--lime);
    padding-left: 0.75rem;
    margin-bottom: 1.1rem;
}

.public-aside h1 {
    font-family: 'Barlow Condensed', system-ui, sans-serif;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: clamp(2.2rem, 3.6vw, 3.4rem);
    line-height: 0.94;
    max-width: 16ch;
}

.public-aside h1 em { font-style: normal; color: var(--gold-bright); }

.public-lede {
    margin-top: 1.25rem;
    max-width: 42ch;
    font-size: 1.05rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.82);
}

.public-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    padding-top: 1.4rem;
    gap: 1rem;
}

.public-strip strong {
    display: block;
    font-family: 'Barlow Condensed', system-ui, sans-serif;
    font-size: 1.3rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.public-strip span {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
    display: block;
}

/* ── Formulário ── */
.public-main {
    display: grid;
    place-items: center;
    padding: 3rem 2rem;
    background: var(--white);
}

.public-card { width: min(420px, 100%); }

.public-card h2 {
    font-family: 'Barlow Condensed', system-ui, sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: 2.1rem;
    line-height: 1.05;
    color: var(--teal-deep);
}

.public-card .sub {
    margin-top: 0.5rem;
    color: var(--muted);
    line-height: 1.6;
}

.field { margin-top: 1.4rem; }

.field label {
    display: block;
    font-family: 'Barlow Condensed', system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--teal-deep);
    margin-bottom: 0.4rem;
}

.field input {
    width: 100%;
    min-height: 48px;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--white);
    font-family: inherit;
    font-size: 1rem;
    color: var(--ink);
    transition: border-color 160ms ease;
}

.field input:focus { border-color: var(--teal); }

.field .help {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
}

.field .error { margin-top: 0.35rem; font-size: 0.85rem; color: #b42318; }

.btn-public {
    width: 100%;
    margin-top: 1.8rem;
    min-height: 48px;
    border: 2px solid transparent;
    border-radius: 2px;
    background: var(--gold);
    color: var(--teal-ink);
    font-family: 'Barlow Condensed', system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 1.05rem;
    cursor: pointer;
    transition: 180ms ease;
}

.btn-public:hover { background: var(--gold-bright); transform: translateY(-1px); }

.btn-public.ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--teal-deep);
}

.btn-public.ghost:hover { border-color: var(--teal); background: var(--paper); transform: none; }

.public-links {
    margin-top: 1.4rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.92rem;
}

.public-links a { color: var(--teal); font-weight: 600; text-decoration: none; }
.public-links a:hover { color: var(--lime-dark); text-decoration: underline; }

.alert-public {
    margin-top: 1.4rem;
    padding: 0.9rem 1rem;
    border-left: 4px solid var(--teal);
    background: var(--paper);
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--muted);
}

.alert-public.is-error { border-left-color: #b42318; color: #7a271a; background: #fef3f2; }
.alert-public.is-success { border-left-color: var(--lime); color: var(--teal-deep); }

.public-foot {
    margin-top: 2.5rem;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.5;
}

/* ── Erros ── */
.error-page {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 2rem;
    text-align: center;
}

.error-code {
    font-family: 'Barlow Condensed', system-ui, sans-serif;
    font-weight: 800;
    font-size: clamp(5rem, 16vw, 10rem);
    line-height: 0.85;
    color: var(--teal);
    letter-spacing: 0.02em;
}

.error-page h1 {
    font-family: 'Barlow Condensed', system-ui, sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 2rem;
    color: var(--teal-deep);
    margin-top: 1rem;
}

.error-page p { margin-top: 0.75rem; color: var(--muted); max-width: 46ch; line-height: 1.6; }
.error-page .error-actions { margin-top: 1.5rem; }

.error-page .btn-public {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    padding-inline: 2rem;
    text-decoration: none;
}

@media (max-width: 980px) {
    body.public { grid-template-columns: 1fr; }
    .public-aside { padding: 2.5rem 1.75rem; }
    .public-brand { padding: 0.9rem 1.15rem; border-radius: 16px; }
    .public-brand img { height: 76px; }
    .public-aside h1 { font-size: 2.2rem; }
    .public-strip { grid-template-columns: 1fr; gap: 0.75rem; }
    .public-main { padding: 2.5rem 1.5rem; }
}
