/* ==========================================================================
   PARAMETRIK - SISTEMA VISUAL
   Base: preto e branco de alto contraste, tipografia técnica (IBM Plex),
   cantos retos e um único destaque em âmbar (cor de sinalização de obra).
   Grafismo próprio: curvas de nível e seções transversais.
   ========================================================================== */

:root {
    --ink: #0E0E0E;
    --ink-2: #1F1F1F;
    --text: #141414;
    --text-2: #4A4A48;
    --text-3: #75756F;
    --paper: #FFFFFF;
    --muted: #F4F4F2;
    --muted-2: #EBEBE7;
    --line: #E3E3DF;
    --line-strong: #C9C9C3;

    --accent: #F2A900;
    --accent-soft: #FFF3D1;

    --ok: #1E7A3A;
    --ok-soft: #E5F3E9;
    --warn: #9A5B00;
    --warn-soft: #FFF1D6;
    --danger: #B42318;
    --danger-soft: #FDECEA;

    --r-sm: 2px;
    --r: 4px;
    --r-lg: 6px;

    --font: 'IBM Plex Sans', 'Segoe UI', Roboto, Arial, sans-serif;
    --mono: 'IBM Plex Mono', Consolas, 'Courier New', monospace;

    --container: 1280px;
    --gutter: 32px;
    --header-h: 68px;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; color: inherit; }
h2 { font-size: clamp(28px, 3.2vw, 40px); }
h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.005em; }

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

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.hidden { display: none !important; }
.w-full { width: 100%; }
.center { text-align: center; }
.font-mono { font-family: var(--mono); }
.text-success { color: var(--ok); }
.text-warning { color: var(--warn); }
.text-danger { color: var(--danger); }
.text-tertiary { color: var(--text-3); }

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    background: var(--ink);
    color: var(--paper);
    padding: 10px 16px;
    z-index: 3000;
    border-radius: var(--r);
}
.skip-link:focus { top: 12px; }

/* Rótulo técnico acima dos títulos */
.eyebrow {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.eyebrow::before {
    content: "";
    width: 10px;
    height: 10px;
    background: var(--accent);
}
.eyebrow-light { color: rgba(255, 255, 255, 0.72); }

/* --------------------------------------------------------------------------
   Botões
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: var(--r);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s;
}
.btn:disabled { opacity: .6; cursor: wait; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }

.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: #2B2B2B; }

.btn-light { background: var(--paper); color: var(--ink); }
.btn-light:hover { background: var(--muted-2); }

.btn-outline-light { background: transparent; color: var(--paper); border-color: rgba(255, 255, 255, .55); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .08); border-color: var(--paper); }

.btn-ghost { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); }

.btn-light-gray { background: var(--muted); color: var(--ink); border-color: var(--line); }
.btn-light-gray:hover { background: var(--muted-2); }

.icon-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r);
    color: var(--text-2);
    cursor: pointer;
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }

.link-arrow {
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.link-arrow::after { content: "→"; transition: transform .15s; }
.link-arrow:hover { text-decoration: underline; text-underline-offset: 4px; }
.link-arrow:hover::after { transform: translateX(3px); }
.link-arrow-light { color: var(--paper); }

/* --------------------------------------------------------------------------
   Cabeçalho
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--paper);
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }

.header-inner {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 40px;
}

.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand-logo { height: 22px; width: auto; }

.nav-links { display: flex; align-items: center; gap: 28px; flex: 1; }

.nav-link {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-2);
    text-decoration: none;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
}
.nav-link:hover { color: var(--ink); border-bottom-color: var(--ink); }
.nav-admin { color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.nav-admin::before { content: ""; width: 8px; height: 8px; background: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.guest-group, .user-group { display: flex; align-items: center; gap: 16px; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.user-avatar {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--mono);
    font-size: 12px;
    border-radius: var(--r);
}

.mobile-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--r);
    cursor: pointer;
    position: relative;
}
.mobile-toggle span {
    position: absolute;
    left: 10px;
    right: 10px;
    height: 2px;
    background: var(--ink);
    transition: transform .2s, top .2s;
}
.mobile-toggle span:first-child { top: 14px; }
.mobile-toggle span:last-child { top: 22px; }
.mobile-toggle.open span:first-child { top: 18px; transform: rotate(45deg); }
.mobile-toggle.open span:last-child { top: 18px; transform: rotate(-45deg); }

/* --------------------------------------------------------------------------
   Visões da SPA
   -------------------------------------------------------------------------- */
.page-view { display: block; }
.page-view.hidden { display: none !important; }
.page-view.active-view { animation: viewIn .25s ease-out; }
@keyframes viewIn { from { opacity: 0; } to { opacity: 1; } }

section[id] { scroll-margin-top: var(--header-h); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    background: var(--ink);
    color: var(--paper);
    overflow: hidden;
    isolation: isolate;
}
.hero-contours {
    position: absolute;
    top: 0;
    right: 0;
    width: 62%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 40%);
    mask-image: linear-gradient(to right, transparent 0%, #000 40%);
}
.hero-inner { padding-top: 112px; padding-bottom: 96px; }
.hero-title {
    font-size: clamp(40px, 5.6vw, 76px);
    line-height: 1.03;
    letter-spacing: -0.025em;
    max-width: 19ch;
    margin-bottom: 24px;
}
.hero-lead {
    font-size: 19px;
    line-height: 1.55;
    color: rgba(255, 255, 255, .78);
    max-width: 560px;
    margin-bottom: 36px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 40px;
    padding-top: 20px;
    padding-bottom: 24px;
    border-top: 1px solid rgba(255, 255, 255, .14);
    font-family: var(--mono);
    font-size: 13px;
    color: rgba(255, 255, 255, .62);
}

/* --------------------------------------------------------------------------
   Seções
   -------------------------------------------------------------------------- */
.section { padding: 96px 0; }
.section-muted { background: var(--muted); }

.section-head { margin-bottom: 40px; max-width: 720px; }
.section-head h2 { margin-bottom: 12px; }
.section-head p { color: var(--text-2); font-size: 18px; }

/* Produtos */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.product-card {
    background: var(--muted);
    border-radius: var(--r);
    padding: 28px;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.product-card p { color: var(--text-2); }
.product-card .link-arrow { margin-top: auto; }

.product-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}
.chip-mark {
    min-width: 30px;
    height: 24px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--mono);
    font-size: 11px;
    border-radius: var(--r-sm);
}
.chip-mark-accent { background: var(--accent); color: var(--ink); font-size: 15px; }

.product-cmd {
    align-self: flex-start;
    font-family: var(--mono);
    font-size: 12.5px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 5px 10px;
}

.product-card-dark { background: var(--ink); color: var(--paper); }
.product-card-dark p { color: rgba(255, 255, 255, .72); }

/* Blocos texto + figura */
.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 72px;
    align-items: center;
}
.split-top { align-items: start; }
.split-reverse .split-figure { order: -1; }
.split-text h2 { margin-bottom: 20px; }
.split-text > p { color: var(--text-2); font-size: 17px; margin-bottom: 24px; max-width: 560px; }

.check-list { list-style: none; margin-bottom: 32px; }
.check-list li {
    position: relative;
    padding: 12px 0 12px 28px;
    border-top: 1px solid var(--line);
    font-size: 15px;
}
.check-list li:last-child { border-bottom: 1px solid var(--line); }
.check-list li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 19px;
    width: 12px;
    height: 7px;
    border-left: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
    transform: rotate(-45deg);
}

.split-figure img {
    width: 100%;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 20px;
}
.split-figure figcaption {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-3);
    margin-top: 12px;
}

/* Janela simulada do plugin */
.mock-window {
    max-width: 460px;
    margin: 0 auto;
    background: var(--paper);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.mock-titlebar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--muted);
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    color: var(--text-3);
}
.mock-titlebar span { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.mock-titlebar span:last-of-type { margin-right: 8px; }
.mock-body { padding: 28px; }
.mock-label { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--text-3); }
.mock-title { font-size: 20px; font-weight: 600; margin: 4px 0 12px; }
.mock-text { font-size: 14px; color: var(--text-2); }
.mock-code {
    margin: 18px 0 12px;
    padding: 16px;
    background: var(--muted);
    border-left: 4px solid var(--accent);
    font-family: var(--mono);
    font-size: 32px;
    font-weight: 500;
    letter-spacing: .14em;
    text-align: center;
}
.mock-hint { font-size: 13px; color: var(--text-3); }

/* Etapas */
.steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}
.step { border-top: 2px solid var(--ink); padding-top: 20px; }
.step-num { font-family: var(--mono); font-size: 13px; color: var(--text-3); display: block; margin-bottom: 14px; }
.step h3 { font-size: 19px; margin-bottom: 8px; }
.step p { color: var(--text-2); font-size: 15px; }

/* Faixa escura */
.band {
    position: relative;
    background: var(--ink);
    color: var(--paper);
    overflow: hidden;
    isolation: isolate;
}
.band-contours {
    position: absolute;
    right: -10%;
    top: -40%;
    width: 70%;
    opacity: .7;
    z-index: -1;
}
.band-inner {
    padding-top: 80px;
    padding-bottom: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}
.band h2 { max-width: 760px; }

/* Contato */
.contact-list { margin-top: 32px; max-width: 480px; }
.contact-list div {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}
.contact-list div:last-child { border-bottom: 1px solid var(--line); }
.contact-list dt { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding-top: 2px; }
.contact-list dd a { text-decoration: none; font-weight: 600; }
.contact-list dd a:hover { text-decoration: underline; }

.contact-form {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 32px;
}

/* --------------------------------------------------------------------------
   Formulários
   -------------------------------------------------------------------------- */
.input-group { display: flex; flex-direction: column; margin-bottom: 16px; }
.input-group label { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }

.field-input, .field-select, .field-textarea {
    width: 100%;
    font: inherit;
    font-size: 15px;
    color: var(--text);
    background: var(--paper);
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    padding: 0 12px;
    height: 44px;
    transition: border-color .15s, box-shadow .15s;
}
.field-textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 120px; }
.field-input:hover, .field-select:hover, .field-textarea:hover { border-color: var(--text-3); }
.field-input:focus, .field-select:focus, .field-textarea:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(242, 169, 0, .35);
}

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.auth-alert {
    padding: 12px 14px;
    border-radius: var(--r);
    font-size: 14px;
    margin-bottom: 18px;
    border-left: 4px solid var(--ink);
    background: var(--muted);
}
.alert-info { border-left-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.alert-danger { border-left-color: var(--danger); background: var(--danger-soft); color: var(--danger); }

/* --------------------------------------------------------------------------
   Rodapé
   -------------------------------------------------------------------------- */
.site-footer { background: var(--ink); color: rgba(255, 255, 255, .72); font-size: 14px; }
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-top: 64px;
    padding-bottom: 48px;
}
.footer-logo { height: 18px; filter: brightness(0) invert(1); margin-bottom: 16px; }
.footer-brand p { max-width: 320px; }
.site-footer h4 {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .45);
    margin-bottom: 14px;
}
.site-footer a { display: block; text-decoration: none; padding: 4px 0; color: rgba(255, 255, 255, .82); }
.site-footer a:hover { color: var(--paper); text-decoration: underline; }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 24px;
    padding-top: 20px;
    padding-bottom: 28px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    font-size: 12px;
    color: rgba(255, 255, 255, .5);
}

/* --------------------------------------------------------------------------
   Modais
   -------------------------------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(14, 14, 14, .55);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-box {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: 92vh;
    overflow-y: auto;
    background: var(--paper);
    border-radius: var(--r-lg);
    padding: 32px;
    animation: modalIn .2s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: var(--text-3);
    cursor: pointer;
    border-radius: var(--r);
}
.modal-close-btn:hover { background: var(--muted); color: var(--ink); }
.modal-header { margin-bottom: 20px; padding-right: 32px; }
.modal-logo { height: 16px; margin-bottom: 22px; }
.modal-header h2 { font-size: 24px; margin-bottom: 6px; }
.modal-header p { color: var(--text-2); font-size: 14px; }
.modal-form .btn { margin-top: 4px; }

/* --------------------------------------------------------------------------
   Responsivo
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .split { gap: 48px; }
    .steps { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
    :root { --gutter: 20px; --header-h: 60px; }

    .mobile-toggle { display: inline-block; }
    .nav-links {
        display: none;
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--paper);
        border-bottom: 1px solid var(--line);
        padding: 8px var(--gutter) 16px;
    }
    .nav-links.active { display: flex; }
    .nav-links .nav-link { padding: 14px 0; border-bottom: 1px solid var(--line); }
    .nav-portal, .user-name { display: none; }

    .hero-inner { padding-top: 72px; padding-bottom: 64px; }
    .hero-contours { width: 100%; opacity: .55; -webkit-mask-image: none; mask-image: none; }
    .hero-lead { font-size: 17px; }

    .section { padding: 64px 0; }
    .split { grid-template-columns: 1fr; }
    .split-reverse .split-figure { order: 0; }
    .band-inner { flex-direction: column; align-items: flex-start; padding-top: 56px; padding-bottom: 56px; }
    .band-contours { width: 140%; }
    .contact-form { padding: 20px; }
}

@media (max-width: 560px) {
    .steps { grid-template-columns: 1fr; }
    .form-row-2 { grid-template-columns: 1fr; gap: 0; }
    .footer-grid { grid-template-columns: 1fr; }
    .hero-actions .btn { width: 100%; }
    .product-card { min-height: 0; }
    .contact-list div { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
