/* ---------------------------------------------------------------------------
   SSO Marreira - folha unica.
   Os tokens abaixo sao os mesmos do marreira.dev em producao, para o broker
   parecer parte do mesmo produto na hora do consentimento do Google.
   --------------------------------------------------------------------------- */

:root {
    --paper: #f6f8fc;
    --paper-2: #edf1f8;
    --card: #fff;
    --ink: #172033;
    --navy: #07162f;
    --navy-2: #0c2248;
    --blue: #3157e9;
    --cyan: #00aeea;
    --line: #dce2ed;
    --muted: #eef2f8;
    --muted-fg: #687386;
    --amber: #f99c00;
    --red: #d92d20;
    --emerald: #007956;

    --radius: 0.6875rem;
    --radius-lg: 1rem;
    --shadow-soft: 0 10px 32px #14264a0f;
    --shadow-card: 0 16px 42px #14264a1a;

    --font-sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "Roboto Mono", ui-monospace, "Cascadia Mono", monospace;

    --shell: 1120px;
    --prose: 720px;

    color-scheme: light;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.625;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img,
svg {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--blue);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover {
    color: var(--navy-2);
}

h1,
h2,
h3 {
    line-height: 1.25;
    letter-spacing: -0.015em;
    margin: 0 0 0.5em;
    font-weight: 800;
}

h1 {
    font-size: clamp(1.75rem, 1.2rem + 2.6vw, 3rem);
}

h2 {
    font-size: clamp(1.375rem, 1.05rem + 1.4vw, 1.875rem);
}

h3 {
    font-size: 1.125rem;
    font-weight: 700;
}

p {
    margin: 0 0 1rem;
    overflow-wrap: anywhere;
}

code,
kbd,
pre {
    font-family: var(--font-mono);
    font-size: 0.875em;
}

code {
    background: var(--muted);
    border-radius: 6px;
    padding: 0.15em 0.4em;
    overflow-wrap: anywhere;
}

pre {
    background: var(--navy);
    color: #e6ecf7;
    border-radius: var(--radius);
    padding: 1rem 1.125rem;
    overflow-x: auto;
    margin: 0 0 1rem;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* --- Estrutura ---------------------------------------------------------- */

.shell {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2rem);
}

.section {
    padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.section--muted {
    background: var(--paper-2);
    border-block: 1px solid var(--line);
}

.skip-link {
    position: absolute;
    left: -9999px;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    z-index: 10;
    background: var(--card);
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

/* --- Cabecalho ---------------------------------------------------------- */

.site-header {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding-top: env(safe-area-inset-top);
    position: sticky;
    top: 0;
    z-index: 5;
}

.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    min-height: 64px;
    padding-block: 0.75rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 800;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.brand:hover {
    color: var(--ink);
}

.brand__mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    color: #fff;
    font-size: 0.95rem;
    font-weight: 900;
    flex: none;
}

.brand__sub {
    color: var(--muted-fg);
    font-weight: 500;
    font-size: 0.8125rem;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1.25rem;
    margin-left: auto;
    font-size: 0.9375rem;
}

.site-nav a {
    color: var(--muted-fg);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 0;
    display: inline-block;
    min-height: 44px;
    line-height: 2;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    color: var(--blue);
}

/* --- Hero --------------------------------------------------------------- */

.hero {
    background:
        radial-gradient(90rem 32rem at 82% -18%, #17357a 0%, transparent 60%),
        var(--navy);
    color: #eaf0fa;
    padding-block: clamp(3rem, 8vw, 5.5rem);
}

.hero h1 {
    color: #fff;
    max-width: 20ch;
}

.hero__lead {
    font-size: clamp(1.0625rem, 1rem + 0.5vw, 1.25rem);
    color: #b9c6de;
    max-width: 62ch;
}

.eyebrow {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 0.85rem;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

/* --- Botoes ------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.7rem 1.15rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font: inherit;
    font-weight: 700;
    font-size: 0.9375rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

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

.btn--primary:hover {
    background: #2647c7;
    color: #fff;
}

.btn--ghost {
    background: transparent;
    border-color: #33507f;
    color: #dbe4f4;
}

.btn--ghost:hover {
    border-color: var(--cyan);
    color: #fff;
}

.btn--quiet {
    background: var(--card);
    border-color: var(--line);
    color: var(--ink);
}

.btn--quiet:hover {
    border-color: var(--blue);
    color: var(--blue);
}

/* --- Cartoes ------------------------------------------------------------ */

.grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 1.35rem;
}

.card h3 {
    margin-top: 0;
}

.card p:last-child {
    margin-bottom: 0;
}

.card__num {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
}

.lede {
    font-size: 1.0625rem;
    color: var(--muted-fg);
    max-width: 68ch;
}

/* --- Tabela ------------------------------------------------------------- */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow-soft);
}

table {
    border-collapse: collapse;
    width: 100%;
    min-width: 34rem;
    font-size: 0.9375rem;
}

th,
td {
    text-align: left;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

thead th {
    background: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted-fg);
    white-space: nowrap;
}

tbody tr:last-child td {
    border-bottom: 0;
}

td code {
    white-space: nowrap;
}

/* --- Selos -------------------------------------------------------------- */

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge--basic {
    background: #e6f6ef;
    color: var(--emerald);
    border-color: #bde4d3;
}

.badge--sensitive {
    background: #fff4e0;
    color: #b75000;
    border-color: #f7dcae;
}

.badge--restricted {
    background: #fdeceb;
    color: var(--red);
    border-color: #f6cdc9;
}

/* --- Avisos ------------------------------------------------------------- */

.note {
    border-left: 3px solid var(--blue);
    background: var(--card);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1rem 1.15rem;
    margin: 0 0 1.25rem;
    box-shadow: var(--shadow-soft);
}

.note--warn {
    border-left-color: var(--amber);
}

.note p:last-child {
    margin-bottom: 0;
}

/* --- Listas ------------------------------------------------------------- */

.list-check {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.list-check li {
    position: relative;
    padding-left: 1.6rem;
    margin-bottom: 0.55rem;
}

.list-check li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: var(--cyan);
}

/* --- Paginas de texto --------------------------------------------------- */

.prose {
    max-width: var(--prose);
}

.prose h2 {
    margin-top: 2.25rem;
    padding-top: 0.35rem;
}

.prose h3 {
    margin-top: 1.75rem;
}

.prose ul,
.prose ol {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}

.prose li {
    margin-bottom: 0.4rem;
}

.prose dl {
    margin: 0 0 1rem;
}

.prose dt {
    font-weight: 700;
    margin-top: 0.85rem;
}

.prose dd {
    margin: 0.15rem 0 0;
    color: var(--muted-fg);
}

.page-head {
    border-bottom: 1px solid var(--line);
    background: var(--card);
    padding-block: clamp(2rem, 5vw, 3rem);
}

.page-head p {
    margin-bottom: 0;
    color: var(--muted-fg);
}

.meta {
    font-size: 0.875rem;
    color: var(--muted-fg);
    font-family: var(--font-mono);
}

/* --- Rodape ------------------------------------------------------------- */

.site-footer {
    background: var(--navy);
    color: #97a6c2;
    padding-block: clamp(2rem, 5vw, 3rem);
    padding-bottom: calc(clamp(2rem, 5vw, 3rem) + env(safe-area-inset-bottom));
    font-size: 0.9375rem;
}

.site-footer a {
    color: #cfdaee;
    text-decoration: none;
}

.site-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem 2.5rem;
    justify-content: space-between;
    align-items: flex-start;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.site-footer__legal {
    margin: 1.75rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid #1b2f52;
    font-size: 0.8125rem;
    color: #7d8dab;
}

/* --- Consentimento ------------------------------------------------------ */

.consent {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2rem);
    padding-bottom: calc(clamp(1rem, 4vw, 2.5rem) + env(safe-area-inset-bottom));
}

.consent__card {
    width: min(100%, 30rem);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: clamp(1.35rem, 4vw, 2rem);
}

.consent__target {
    background: var(--muted);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.9375rem;
}

.consent__host {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.consent__scopes {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    border-top: 1px solid var(--line);
}

.consent__scopes li {
    border-bottom: 1px solid var(--line);
    padding: 0.8rem 0;
}

.consent__scopes strong {
    display: block;
    font-size: 0.9375rem;
}

.consent__scopes span {
    color: var(--muted-fg);
    font-size: 0.875rem;
}

.consent__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.consent__actions .btn {
    flex: 1 1 12rem;
}

/* Botao oficial do Google - proporcoes e cores nao podem ser alteradas. */
.btn--google {
    background: #fff;
    border: 1px solid #747775;
    color: #1f1f1f;
    font-family: "Roboto", var(--font-sans);
    font-weight: 500;
}

.btn--google:hover {
    background: #f7f8f8;
    color: #1f1f1f;
}

.btn--google svg {
    width: 18px;
    height: 18px;
    flex: none;
}

/* --- Acessibilidade ----------------------------------------------------- */

:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 30rem) {
    .site-nav {
        width: 100%;
        margin-left: 0;
        gap: 0 1rem;
    }
}

/* ---------------------------------------------------------------------------
   Utilitários.

   Estas classes existem porque a CSP do broker é `style-src 'self'`, sem
   'unsafe-inline': atributo `style=` no HTML é BLOQUEADO pelo navegador. A
   alternativa seria afrouxar a CSP ou carimbar um nonce em cada elemento —
   as duas piores que simplesmente ter as classes aqui.
   --------------------------------------------------------------------------- */

.u-muted        { color: var(--muted-fg); }
.u-white        { color: #fff; }
.u-bold         { font-weight: 600; }
.u-small        { font-size: 0.9375rem; }
.u-smaller      { font-size: 0.8125rem; }
.u-narrow       { max-width: 68ch; }

.u-mt-xs        { margin-top: 0.35rem; }
.u-mt-sm        { margin-top: 1.25rem; }
.u-mt           { margin-top: 1.5rem; }
.u-mt-lg        { margin-top: 1.75rem; }
.u-mt-xl        { margin-top: 2rem; }
.u-mb           { margin-bottom: 1.5rem; }
.u-my           { margin-block: 1.25rem; }

.u-flush        { margin: 0.35rem 0 0; }
.u-note-end     { margin: 1.5rem 0 0; }

/* Legenda da tabela de escopos, abaixo dela. */
.table-note {
    padding: 0.75rem 1rem;
    text-align: left;
    caption-side: bottom;
}

/* Título do cartão de consentimento e da lista de escopos. */
.consent__title  { font-size: 1.375rem; }
.consent__legend { font-size: 1rem; margin-bottom: 0.35rem; }
