/* ===== PORTAL DO PARCEIRO =====
   Estilos compartilhados por /parceiros/ e /parceiros/<parceiro>/.
   Cada página de parceiro define as variáveis de marca no <html style="...">:
   --hero, --hero-text, --hero-cta, --hero-cta-text, --accent, --accent-text, --ink, --soft */

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

:root {
    --hero: #1C1B4B;
    --hero-text: #FFFFFF;
    --hero-cta: #FFFFFF;
    --hero-cta-text: #1C1B4B;
    --accent: #5B3FD6;
    --accent-text: #FFFFFF;
    --ink: #5B3FD6;
    --soft: #F1EEFC;

    --bg: #FFFFFF;
    --bg-alt: #F7F8FA;
    --text: #16181D;
    --text-muted: #5A6070;
    --border: #E6E8EE;
    --radius: 16px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== HEADER ===== */
.portal-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.portal-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 68px;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-width: 0;
}

.brand-lockup img.sp-icon {
    height: 30px;
    width: auto;
    display: block;
}

.brand-lockup .sp-name {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.02em;
    color: var(--text);
}

.brand-lockup .divider {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 18px;
}

.partner-wordmark {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.02em;
    color: var(--ink);
    white-space: nowrap;
}

.partner-logo {
    height: 24px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    display: block;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-nav a {
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
}

.header-nav a:hover {
    color: var(--text);
}

/* Link com cara de botão no menu: mantém a cor do botão */
.header-nav a.btn-accent,
.header-nav a.btn-accent:hover {
    color: var(--accent-text);
}

/* ===== BOTÕES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 999px;
    font: inherit;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-hero {
    background: var(--hero-cta);
    color: var(--hero-cta-text);
}

.btn-hero-ghost {
    background: transparent;
    color: var(--hero-text);
    box-shadow: inset 0 0 0 1.5px currentColor;
}

.btn-accent {
    background: var(--accent);
    color: var(--accent-text);
}

.btn-outline {
    background: #fff;
    color: var(--text);
    box-shadow: inset 0 0 0 1.5px var(--border);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* ===== HERO ===== */
.portal-hero {
    background: var(--hero);
    color: var(--hero-text);
    padding: 88px 0 96px;
    position: relative;
    overflow: hidden;
}

.portal-hero::after {
    content: "";
    position: absolute;
    right: -120px;
    top: -120px;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.06;
    pointer-events: none;
}

.portal-hero .container {
    position: relative;
    z-index: 1;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 20px;
}

.eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.portal-hero h1 {
    font-size: clamp(34px, 5.4vw, 60px);
    line-height: 1.05;
    letter-spacing: -0.035em;
    font-weight: 800;
    max-width: 820px;
    text-wrap: balance;
}

.portal-hero h1 .plus {
    opacity: 0.55;
    font-weight: 500;
}

.portal-hero p.lead {
    font-size: clamp(17px, 2vw, 20px);
    max-width: 640px;
    margin-top: 20px;
    opacity: 0.9;
    text-wrap: pretty;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
}

/* ===== NÚMEROS ===== */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: -48px;
    position: relative;
    z-index: 2;
    box-shadow: var(--shadow);
}

.stat {
    background: #fff;
    padding: 24px;
}

.stat strong {
    display: block;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ink);
    line-height: 1.1;
}

.stat span {
    font-size: 14px;
    color: var(--text-muted);
}

/* ===== SEÇÕES ===== */
.section {
    padding: 88px 0;
}

.section-alt {
    background: var(--soft);
}

.section-head {
    max-width: 680px;
    margin-bottom: 40px;
}

.section-head .kicker {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 10px;
}

.section-head h2 {
    font-size: clamp(28px, 3.6vw, 40px);
    line-height: 1.15;
    letter-spacing: -0.03em;
    font-weight: 800;
    text-wrap: balance;
}

.section-head p {
    margin-top: 12px;
    font-size: 17px;
    color: var(--text-muted);
    text-wrap: pretty;
}

/* ===== MATERIAIS ===== */
.materials {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.materials-subhead {
    margin: 40px 0 16px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.materials.materials-3 {
    grid-template-columns: repeat(3, 1fr);
}

.material {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.material:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.material-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--soft);
    color: var(--ink);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.material-icon svg {
    width: 24px;
    height: 24px;
}

.material-body {
    flex: 1;
    min-width: 0;
}

.material-body h3 {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.material-body p {
    font-size: 14.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

.material-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    font-size: 13px;
    font-weight: 600;
}

.material-meta .format {
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--bg-alt);
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.material-meta .action {
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.material-meta .action svg {
    width: 16px;
    height: 16px;
}

.material-meta .soon {
    display: none;
    color: var(--text-muted);
}

/* Arquivo ainda não publicado: marcado pelo portal.js */
.material.is-unavailable {
    pointer-events: none;
    background: var(--bg-alt);
}

.material.is-unavailable .material-icon {
    background: #fff;
    color: var(--text-muted);
}

.material.is-unavailable .action {
    display: none;
}

.material.is-unavailable .soon {
    display: inline;
}

/* ===== PASSOS ===== */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    counter-reset: step;
}

.step {
    background: #fff;
    border-radius: var(--radius);
    padding: 28px;
    border: 1px solid var(--border);
}

.step::before {
    counter-increment: step;
    content: counter(step);
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-text);
    font-weight: 800;
    margin-bottom: 18px;
}

.step h3 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.step p {
    font-size: 15px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ===== LINK PARA CLIENTE ===== */
.share-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: var(--shadow);
}

.share-box h3 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.share-box p {
    color: var(--text-muted);
    margin-top: 6px;
    max-width: 560px;
}

.share-url {
    display: block;
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    word-break: break-all;
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
}

/* ===== CTA FINAL ===== */
.cta-band {
    background: var(--hero);
    color: var(--hero-text);
    border-radius: 24px;
    padding: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.cta-band h2 {
    font-size: clamp(26px, 3.2vw, 36px);
    line-height: 1.15;
    letter-spacing: -0.03em;
    font-weight: 800;
    max-width: 620px;
}

.cta-band p {
    margin-top: 10px;
    opacity: 0.88;
    max-width: 560px;
}

/* ===== HUB /parceiros ===== */
.hub-hero {
    padding: 96px 0 72px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
}

.hub-hero h1 {
    font-size: clamp(36px, 5.6vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.035em;
    font-weight: 800;
    max-width: 780px;
    text-wrap: balance;
}

.hub-hero p {
    font-size: clamp(17px, 2vw, 20px);
    color: var(--text-muted);
    max-width: 620px;
    margin-top: 18px;
}

.partner-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.partner-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    background: #fff;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.partner-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.partner-card-top {
    background: var(--hero);
    color: var(--hero-text);
    padding: 28px 24px;
    min-height: 132px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
}

.partner-card-top .tag {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.8;
}

.partner-card-top .name {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}

/* Card "Seja parceiro": abre o modal de integração */
.partner-card-cta {
    font: inherit;
    text-align: left;
    padding: 0;
    cursor: pointer;
    border-style: dashed;
    border-color: #C9BFF2;
    /* 10 parceiros: ocupa as colunas restantes da última linha (3 col.) ou a linha inteira (2 col.) */
    grid-column: span 2;
}

.partner-card-cta .partner-card-top {
    background: var(--soft);
    color: var(--ink);
}

.partner-card-cta .partner-card-bottom {
    width: 100%;
}

.partner-card-logo {
    display: block;
    height: 36px;
    width: auto;
    max-width: 70%;
    object-fit: contain;
    object-position: left center;
}

/* Logos empilhados (quase quadrados) precisam de mais altura para ficar legíveis */
.partner-card-logo.is-stacked {
    height: 46px;
    margin: -5px 0;
}

.partner-card-bottom {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.partner-card-bottom svg {
    width: 18px;
    height: 18px;
    color: var(--ink);
    transition: transform 0.15s ease;
}

.partner-card:hover .partner-card-bottom svg {
    transform: translateX(3px);
}

/* ===== FOOTER ===== */
.portal-footer {
    border-top: 1px solid var(--border);
    padding: 40px 0;
    font-size: 14px;
    color: var(--text-muted);
}

.portal-footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
}

.portal-footer a {
    text-decoration: none;
    font-weight: 600;
    color: var(--text);
}

/* ===== MODAL ===== */
.modal {
    width: min(520px, calc(100% - 32px));
    max-height: calc(100% - 32px);
    margin: auto;
    padding: 36px 32px 28px;
    border: 0;
    border-radius: 24px;
    background: #fff;
    color: var(--text);
    box-shadow: 0 24px 64px rgba(16, 24, 40, 0.24);
    overflow-y: auto;
}

.modal::backdrop {
    background: rgba(16, 24, 40, 0.55);
    backdrop-filter: blur(4px);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--bg-alt);
    color: var(--text-muted);
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--soft);
    color: var(--ink);
    display: grid;
    place-items: center;
    margin-bottom: 20px;
}

.modal-icon svg {
    width: 26px;
    height: 26px;
}

.modal h2 {
    font-size: 26px;
    line-height: 1.2;
    letter-spacing: -0.03em;
    font-weight: 800;
}

.modal > p {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 15.5px;
}

.modal-links {
    display: grid;
    gap: 10px;
    margin-top: 24px;
}

.modal-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.modal-link:hover {
    border-color: var(--accent);
    background: var(--soft);
}

.modal-link > span:nth-child(2) {
    flex: 1;
    min-width: 0;
}

.modal-link strong {
    display: block;
    font-size: 15.5px;
    font-weight: 700;
}

.modal-link small {
    display: block;
    font-size: 13.5px;
    color: var(--text-muted);
}

.modal-link-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-alt);
    color: var(--ink);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.modal-link-icon svg {
    width: 20px;
    height: 20px;
}

.modal-link .modal-link-ext {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.modal-cta {
    width: 100%;
    margin-top: 20px;
}

.modal .modal-note {
    text-align: center;
    font-size: 13px;
    margin-top: 10px;
}

/* ===== MODAL DE PLANOS ===== */
.modal.modal-wide {
    width: min(1040px, calc(100% - 32px));
}

/* Card de material que é botão (abre modal) em vez de link */
button.material {
    font: inherit;
    color: inherit;
    text-align: left;
    width: 100%;
    cursor: pointer;
}

.plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.plans-status {
    grid-column: 1 / -1;
    padding: 40px 16px;
    text-align: center;
    color: var(--text-muted);
    display: grid;
    justify-items: center;
    gap: 16px;
}

.plan {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}

.plan.is-partner {
    border: 2px solid var(--accent);
    background: var(--soft);
}

.plan-badge {
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.plan-name {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.plan-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px;
}

.plan-price strong {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ink);
    line-height: 1.1;
}

.plan-price span {
    color: var(--text-muted);
    font-weight: 600;
}

.plan-price small {
    flex-basis: 100%;
    color: var(--text-muted);
    font-size: 13px;
}

.plan-desc,
.plan-notes {
    font-size: 14px;
    color: var(--text-muted);
}

.plan-notes {
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
}

.plan-footer {
    margin-top: auto;
    display: grid;
    gap: 14px;
}

.plan-cta {
    width: 100%;
}

.plan-limits {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    background: var(--bg-alt);
    font-size: 13px;
    color: var(--text-muted);
}

.plan.is-partner .plan-limits {
    background: #fff;
}

.plan-limits strong {
    display: block;
    font-size: 15px;
    color: var(--text);
}

.plan-features {
    list-style: none;
    display: grid;
    gap: 8px;
    font-size: 14px;
}

.plan-features li {
    position: relative;
    padding-left: 24px;
}

.plan-features li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 5px;
    width: 12px;
    height: 7px;
    border-left: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
    transform: rotate(-45deg);
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 20px);
    background: #16181D;
    color: #fff;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 200;
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ===== RESPONSIVO ===== */
@media (max-width: 960px) {
    .partner-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .steps,
    .materials.materials-3 {
        grid-template-columns: 1fr;
    }

    .share-box,
    .cta-band {
        flex-direction: column;
        align-items: flex-start;
    }

    .cta-band {
        padding: 40px 28px;
    }
}

@media (max-width: 720px) {
    .container {
        padding: 0 16px;
    }

    .header-nav a:not(.btn) {
        display: none;
    }

    .brand-lockup .sp-name,
    .brand-lockup .partner-wordmark {
        font-size: 16px;
    }

    .brand-lockup img.sp-icon {
        height: 26px;
    }

    .portal-hero {
        padding: 56px 0 80px;
    }

    .materials,
    .partner-grid {
        grid-template-columns: 1fr;
    }

    .partner-card-cta {
        grid-column: auto;
    }

    .section {
        padding: 64px 0;
    }

    .share-box {
        padding: 24px;
    }

    .hero-actions .btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 420px) {
    .brand-lockup .sp-name {
        display: none;
    }
}
