@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
    --ad-navy: #061f46;
    --ad-navy-2: #0a315f;
    --ad-gold: #d89308;
    --ad-gold-soft: #efb33b;
    --ad-ink: #0a1d39;
    --ad-muted: #667085;
    --ad-paper: #fbfaf7;
    --ad-white: #fff;
    --ad-line: #e5e2da;
    /* Fundo creme da arte da logo — usado onde a logo aparece sobre uma
       superfície clara, para não desenhar um retângulo visível em volta dela. */
    --ad-logo-bg: #fbf9f7;
    /* Os tokens do sistema antigo (--brand, --accent, --text…) vivem no app.css
       e já apontam para esta mesma paleta; aqui ficam só os do tema AD. */
    --ad-serif: "Fraunces", Georgia, "Times New Roman", serif;
    --ad-sans: "Manrope", Arial, sans-serif;
    --ad-shadow: 0 16px 40px rgba(6, 31, 70, .1);
    --ad-radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--ad-paper);
    color: var(--ad-ink);
    font-family: var(--ad-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
.ad-container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.ad-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(251,249,247,.98);
    border-bottom: 1px solid rgba(6,31,70,.08);
    backdrop-filter: blur(14px);
}
.ad-header__inner { min-height: 112px; display: flex; align-items: center; gap: 26px; }
/* logo-ad-lockup.png é o recorte da assinatura (emblema + "AD EDITORA
   E CURSOS") da prancha de marca; aqui basta escalar pela altura. */
.ad-brand { flex: 0 0 auto; display: block; }
.ad-brand img { width: auto; height: 92px; }
.ad-nav { display: flex; align-items: center; gap: 24px; font-size: .9rem; font-weight: 700; white-space: nowrap; }
.ad-nav a { position: relative; padding: 12px 0; }
.ad-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 4px; height: 2px; background: var(--ad-gold); transition: .2s; }
.ad-nav a:hover::after, .ad-nav a:focus-visible::after { right: 0; }
.ad-header__actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.ad-search { display: flex; width: min(260px, 20vw); height: 44px; border: 1px solid #d6dbe4; border-radius: 12px; overflow: hidden; background: #fff; }
.ad-search input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 0 14px; color: var(--ad-ink); font-size: .82rem; }
.ad-search button { width: 48px; border: 0; background: var(--ad-navy); color: #fff; font-size: 1.35rem; cursor: pointer; }
.ad-round-link { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #dce0e7; border-radius: 50%; font-size: .83rem; }
.ad-language { display: inline-flex; align-items: center; gap: 4px; padding: 8px 4px; font-size: .82rem; font-weight: 800; }
.ad-login, .ad-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid var(--ad-navy);
    border-radius: 12px;
    background: var(--ad-navy);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}
.ad-button--gold { border-color: var(--ad-gold); background: var(--ad-gold); }
.ad-button--light { border-color: #fff; background: #fff; color: var(--ad-navy); }
.ad-button--outline { background: transparent; color: var(--ad-navy); }
/* Menu da conta no header (biblioteca, pedidos e, para superusuário, o painel) */
.ad-account { position: relative; }
.ad-account__button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 14px 0 6px;
    border: 1px solid var(--ad-line);
    border-radius: 999px;
    background: #fff;
    color: var(--ad-navy);
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
}
.ad-account__button:hover { border-color: rgba(6,31,70,.28); }
.ad-account__name { max-width: 15ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--ad-navy); color: #fff; font-size: .82rem; font-weight: 800; }
.ad-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    width: 260px;
    padding: 10px;
    border: 1px solid var(--ad-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 50px rgba(6,31,70,.18);
}
.ad-menu__title { padding: 8px 12px 10px; color: var(--ad-navy); font-size: .88rem; font-weight: 800; overflow-wrap: anywhere; }
.ad-menu__label { padding: 4px 12px 6px; color: var(--ad-gold); font-size: .66rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.ad-menu a { padding: 10px 12px; border-radius: 9px; color: var(--ad-ink); font-size: .85rem; font-weight: 600; }
.ad-menu a:hover { background: #f3f5f9; }
.ad-menu__sep { height: 1px; margin: 7px 4px; background: var(--ad-line); }
[x-cloak] { display: none !important; }

.ad-menu-toggle { display: none; margin-left: auto; border: 0; background: none; }
.ad-menu-toggle span { display: block; width: 26px; height: 2px; margin: 5px; background: var(--ad-navy); }

.ad-messages { position: fixed; z-index: 80; top: 122px; left: 50%; transform: translateX(-50%); }
.ad-message { margin-left: auto; width: fit-content; max-width: 560px; padding: 12px 18px; border-radius: 10px; background: #fff; box-shadow: var(--ad-shadow); border-left: 4px solid var(--ad-gold); }

.ad-kicker { color: var(--ad-gold); font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.ad-title { margin: 0; font-family: var(--ad-serif); font-size: clamp(2.1rem, 5vw, 4.4rem); line-height: 1.04; letter-spacing: -.035em; }
/* app.css fixa `color: var(--text-strong)` em h1–h3, o que anula a cor herdada
   e deixa títulos escuros em cima de seções escuras (rodapé, faixas navy,
   heros). Devolvemos a herança: superfície clara herda --ad-ink do body,
   escura herda o próprio branco. */
h1, h2, h3, h4, h5, h6 { color: inherit; }
/* Kicker das páginas do sistema antigo, no mesmo dourado do tema AD. */
.section-kicker-light, .section-kicker-gold { color: var(--ad-gold-soft); }
.ad-section-title { margin: 0; font-family: var(--ad-serif); font-size: clamp(1.8rem, 3.5vw, 3rem); line-height: 1.12; letter-spacing: -.025em; }
.ad-gold { color: var(--ad-gold-soft); }

.ad-footer { margin-top: 80px; background: var(--ad-navy); color: #fff; }
.ad-footer__grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 50px; padding: 58px 0 44px; }
/* Mesma altura da assinatura do topo, sobre um selo claro porque a arte é navy. */
.ad-footer__brand img { width: auto; height: 92px; padding: 8px 12px; background: var(--ad-logo-bg); border-radius: 12px; }
.ad-footer h2 { margin: 0 0 16px; font-size: .92rem; }
.ad-footer a, .ad-footer p { display: block; margin: 7px 0; color: rgba(255,255,255,.74); font-size: .82rem; }
.ad-footer__bottom { padding: 20px 0; border-top: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.65); font-size: .76rem; }

@media (max-width: 1080px) {
    .ad-round-link, .ad-language { display: none; }
    .ad-nav { gap: 14px; }
}
@media (max-width: 860px) {
    .ad-header__inner { min-height: 82px; }
    .ad-brand img { height: 62px; }
    .ad-menu-toggle { display: block; }
    .ad-nav { display: none; position: absolute; inset: 82px 0 auto; padding: 24px 20px; background: var(--ad-logo-bg); box-shadow: var(--ad-shadow); flex-direction: column; align-items: stretch; }
    .ad-nav.is-open { display: flex; }
    .ad-search { display: none; }
    .ad-header__actions { margin-left: 0; }
    .ad-login { min-height: 40px; padding: 0 14px; }
    .ad-footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .ad-container { width: min(100% - 24px, 1180px); }
    .ad-footer__grid { grid-template-columns: 1fr; gap: 24px; }
}

/* Conta */
.ad-auth-page {
    min-height: 68vh;
    display: grid;
    place-items: center;
    padding: 64px 20px;
    background: linear-gradient(145deg, #f7f3ea, #eef1f5);
}
.ad-auth-card {
    width: min(100%, 560px);
    padding: clamp(28px, 5vw, 52px);
    border: 1px solid var(--ad-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--ad-shadow);
}
.ad-auth-card h1 {
    margin: 6px 0 12px;
    color: var(--ad-navy);
    font-family: var(--ad-serif);
    font-size: clamp(2rem, 5vw, 3rem);
}
.ad-auth-card > p:not(.ad-eyebrow) { color: var(--ad-muted); }
.ad-auth-form { display: grid; gap: 18px; margin: 28px 0 18px; }
.ad-field { display: grid; gap: 7px; }
.ad-field label { color: var(--ad-navy); font-weight: 700; }
.ad-field input, .ad-field select, .ad-field textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid #cbd1da;
    border-radius: 8px;
    font: inherit;
}
.ad-field small, .ad-field .helptext { color: var(--ad-muted); font-size: .78rem; }
.ad-field .errorlist { margin: 0; padding-left: 18px; color: #9d2828; font-size: .82rem; }
.ad-text-link {
    display: inline-block;
    margin-top: 14px;
    color: var(--ad-navy);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Formulário padrão (login, cadastro, recuperação de senha) */
.ad-form { display: grid; gap: 18px; }
.ad-form__field { display: grid; gap: 7px; }
.ad-form__field > label { color: var(--ad-navy); font-size: .8rem; font-weight: 700; }
.ad-form input:not([type="checkbox"]):not([type="radio"]),
.ad-form select,
.ad-form textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #d5dae2;
    border-radius: 10px;
    background: #fff;
    color: var(--ad-ink);
    font: inherit;
}
.ad-form input:focus, .ad-form select:focus, .ad-form textarea:focus {
    outline: 0;
    border-color: var(--ad-navy);
    box-shadow: 0 0 0 3px rgba(6,31,70,.1);
}
.ad-form__field.has-error input { border-color: #c0563f; }
/* O checkbox fica no tamanho natural; a regra de largura acima o esticava. */
.ad-form__check { display: flex; align-items: center; gap: 10px; color: var(--ad-ink); font-size: .84rem; font-weight: 600; cursor: pointer; }
.ad-form__check input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--ad-navy); }
.ad-form__help { color: var(--ad-muted); font-size: .74rem; line-height: 1.5; }
.ad-form__help ul { margin: 0; padding-left: 16px; }
.ad-form__help li + li { margin-top: 3px; }
.ad-form__errors { margin: 0; padding-left: 16px; color: #9d2828; font-size: .78rem; }
.ad-form__alert { padding: 12px 15px; border-left: 3px solid #c0563f; border-radius: 8px; background: #fdf1ee; color: #8f2d1a; font-size: .82rem; }
.ad-form__alert p { margin: 0; }

/* Página de conta em duas colunas: painel da marca + formulário */
.ad-auth-split { display: grid; grid-template-columns: 1fr 1fr; min-height: 680px; background: #fff; }
.ad-auth-split__story { display: flex; align-items: center; padding: 70px max(40px, 6vw); color: #fff; background: linear-gradient(140deg, #031730, #0a3765); }
.ad-auth-split__story h1 { margin: 14px 0; font-family: var(--ad-serif); font-size: clamp(2.2rem, 4.4vw, 4rem); line-height: 1.05; }
.ad-auth-split__story p { max-width: 520px; margin: 0; color: rgba(255,255,255,.75); }
.ad-auth-split__panel { display: grid; place-items: center; padding: 50px; }
.ad-auth-split__form { width: min(430px, 100%); }
.ad-auth-split__form h2 { margin: 8px 0 6px; color: var(--ad-navy); font-family: var(--ad-serif); font-size: 2.3rem; }
.ad-auth-split__form > p { margin: 0 0 26px; color: var(--ad-muted); font-size: .9rem; }
.ad-auth-split__form .ad-button { width: 100%; margin-top: 22px; }
.ad-auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 20px; font-size: .8rem; }
.ad-auth-links a { color: var(--ad-navy); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) {
    .ad-auth-split { grid-template-columns: 1fr; min-height: 0; }
    .ad-auth-split__story { min-height: 300px; padding: 52px 24px; }
    .ad-auth-split__panel { padding: 44px 24px 60px; }
}
