/* =====================================================================
   Consulta AI - Design tokens e estilos gerais (area publica/cliente)
   Paleta: branco + verde claro, moderno e clean.
   ===================================================================== */

:root {
    --primary: #16a34a;
    --primary-dark: #15803d;
    --primary-light: #22c55e;
    --primary-50: #f0fdf4;
    --primary-100: #dcfce7;
    --primary-200: #bbf7d0;

    --bg: #ffffff;
    --bg-soft: #f6faf7;
    --surface: #ffffff;
    --border: #e5eae7;
    --border-strong: #d1dbd5;

    --text: #10241a;
    --text-muted: #5b6b62;
    --text-faint: #8a988f;

    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --info: #2563eb;
    --info-bg: #eff6ff;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(16, 36, 26, 0.06);
    --shadow: 0 4px 16px rgba(16, 36, 26, 0.08);
    --shadow-lg: 0 16px 40px rgba(16, 36, 26, 0.12);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
/* Tamanho padrao de qualquer icone SVG (icon_svg() em includes/functions.php)
   fora de um contexto com regra propria (.btn .icon, .alert .icon, etc, que
   continuam valendo por serem mais especificas). Sem isto, um <svg> sem
   width/height explicito renderiza no tamanho padrao do navegador (~300px). */
.icon { width: 20px; height: 20px; flex-shrink: 0; vertical-align: -4px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0 0 1em; color: var(--text-muted); }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

.container {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------------------------------------------------------------------
   Botoes
   --------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    border: 1px solid transparent;
    transition: all .15s ease;
    white-space: nowrap;
}
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(22,163,74,.25); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-outline { background: #fff; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none !important; }

/* ---------------------------------------------------------------------
   Navbar
   --------------------------------------------------------------------- */
.navbar {
    position: sticky; top: 0; z-index: 40;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.navbar-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--text); }
.brand-mark {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    display: flex; align-items: center; justify-content: center; color: #fff;
    flex-shrink: 0;
}
.brand-mark .icon { width: 20px; height: 20px; }
.brand span.accent { color: var(--primary); }
.brand-mark-logo { background: none; overflow: visible; }
.brand-mark-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.brand-name-reveal {
    font-variant: small-caps;
    letter-spacing: .05em;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width .35s ease, opacity .25s ease;
}
.brand-hover:hover .brand-name-reveal { max-width: 220px; opacity: 1; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-weight: 500; color: var(--text-muted); font-size: 14.5px; }
.nav-links a:hover { color: var(--primary-dark); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; }

@media (max-width: 860px) {
    .nav-links { display: none; }
    .nav-toggle { display: inline-flex; }
}

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */
.hero {
    padding: 76px 0 64px;
    background:
        radial-gradient(700px 300px at 15% -10%, var(--primary-100), transparent),
        radial-gradient(600px 280px at 100% 0%, var(--primary-50), transparent);
    text-align: center;
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--primary-50); border: 1px solid var(--primary-200);
    color: var(--primary-dark); padding: 6px 14px; border-radius: 999px;
    font-size: 13px; font-weight: 600; margin-bottom: 22px;
}
.hero h1 { font-size: 46px; max-width: 780px; margin: 0 auto 18px; }
.hero h1 .accent { color: var(--primary); }
.hero-sub { font-size: 18px; max-width: 620px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.hero-trust { display: flex; gap: 28px; justify-content: center; margin-top: 44px; flex-wrap: wrap; }
.hero-trust-item { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 14px; font-weight: 500; }
.hero-trust-item .icon { width: 18px; height: 18px; color: var(--primary); }

@media (max-width: 640px) {
    .hero h1 { font-size: 32px; }
    .hero-sub { font-size: 16px; }
}

/* ---------------------------------------------------------------------
   Secoes gerais
   --------------------------------------------------------------------- */
.section { padding: 64px 0; }
.section-soft { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.eyebrow { color: var(--primary-dark); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; display: block; }
.section-head h2 { font-size: 32px; }

/* ---------------------------------------------------------------------
   Grid de tipos de consulta
   --------------------------------------------------------------------- */
.types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}
.type-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    display: flex; flex-direction: column;
    transition: all .18s ease;
}
.type-card:hover { border-color: var(--primary-200); box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.type-icon {
    width: 52px; height: 52px; border-radius: 14px;
    background: var(--primary-50); color: var(--primary-dark);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 18px;
}
.type-icon .icon { width: 26px; height: 26px; }
.type-card h3 { font-size: 19px; margin-bottom: 8px; }
.type-card p { font-size: 14.5px; flex: 1; margin-bottom: 20px; }
.type-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.type-price { font-size: 22px; font-weight: 800; color: var(--text); }
.type-price small { font-size: 13px; font-weight: 500; color: var(--text-faint); }

/* ---------------------------------------------------------------------
   Como funciona
   --------------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; }
.step { text-align: center; padding: 0 12px; }
.step-num {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--primary); color: #fff; font-weight: 800; font-size: 17px;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.step h3 { font-size: 16.5px; margin-bottom: 6px; }
.step p { font-size: 14px; margin: 0; }

/* ---------------------------------------------------------------------
   Cards / paineis genericos
   --------------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
}
.card + .card { margin-top: 18px; }

/* ---------------------------------------------------------------------
   Formularios
   --------------------------------------------------------------------- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; color: var(--text); }
.form-control {
    width: 100%; padding: 12px 14px; border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); font-size: 15px; color: var(--text);
    background: #fff; transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.form-hint { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.auth-wrap {
    min-height: calc(100vh - 72px);
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-soft); padding: 40px 20px;
}
.auth-card {
    width: 100%; max-width: 420px; background: #fff;
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 40px 36px; box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 24px; text-align: center; }
.auth-card .sub { text-align: center; font-size: 14px; margin-bottom: 28px; }
.auth-foot { text-align: center; font-size: 14px; margin-top: 20px; color: var(--text-muted); }
.auth-foot a { color: var(--primary-dark); font-weight: 600; }

/* ---------------------------------------------------------------------
   Alertas / badges
   --------------------------------------------------------------------- */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 18px; border: 1px solid transparent; display: flex; gap: 10px; align-items: flex-start; }
.alert .icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-bg); color: #14532d; border-color: var(--primary-200); }
.alert-error { background: var(--danger-bg); color: #7f1d1d; border-color: #fecaca; }
.alert-warning { background: var(--warning-bg); color: #78350f; border-color: #fde68a; }
.alert-info { background: var(--info-bg); color: #1e3a8a; border-color: #bfdbfe; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-success { background: var(--success-bg); color: var(--primary-dark); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: #f1f5f2; color: var(--text-muted); }

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); padding: 48px 0 28px; background: var(--bg-soft); }
.footer-grid { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; margin-bottom: 32px; }
.footer-brand p { max-width: 280px; font-size: 14px; }
.footer-cols { display: flex; gap: 60px; flex-wrap: wrap; }
.footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin-bottom: 14px; }
.footer-col a { display: block; font-size: 14px; color: var(--text-muted); margin-bottom: 10px; }
.footer-col a:hover { color: var(--primary-dark); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--text-faint); }
.footer-dev { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--text-faint); }
.footer-dev a { color: var(--text-muted); font-weight: 600; }
.footer-dev a:hover { color: var(--primary-dark); }
.footer-social { display: flex; gap: 8px; }
.footer-social-link { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-muted); transition: .15s; }
.footer-social-link svg { width: 16px; height: 16px; }
.footer-social-link.instagram:hover { color: #fff; border-color: transparent; background: linear-gradient(45deg,#f58529,#dd2a7b,#8134af,#515bd4); }
.footer-social-link.whatsapp:hover { color: #fff; border-color: transparent; background: #25D366; }

/* ---------------------------------------------------------------------
   Modal (selecao de consulta + checkout)
   --------------------------------------------------------------------- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(16,36,26,.55);
    display: none; align-items: center; justify-content: center;
    padding: 20px; z-index: 100; backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal {
    width: 100%; max-width: 480px; background: #fff; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); max-height: 92vh; overflow-y: auto;
    animation: modal-in .18s ease;
}
.modal.modal-wide { max-width: 560px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 18px; margin: 0; }
.modal-close { width: 32px; height: 32px; border-radius: 8px; border: none; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.modal-close:hover { background: var(--primary-100); color: var(--primary-dark); }
.modal-body { padding: 24px; }
.modal-summary { background: var(--primary-50); border: 1px solid var(--primary-200); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal-summary .name { font-weight: 700; font-size: 14.5px; }
.modal-summary .price { font-weight: 800; color: var(--primary-dark); font-size: 17px; }
.modal-steps { display: flex; align-items: center; gap: 6px; padding: 16px 24px 0; }
.modal-step-dot { flex: 1; height: 4px; border-radius: 4px; background: var(--border); }
.modal-step-dot.active { background: var(--primary); }

#checkout-brick-container { min-height: 260px; }
.checkout-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 50px 0; color: var(--text-muted); font-size: 14px; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--primary-100); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.pix-box { text-align: center; padding: 10px 0; }
.pix-box img { width: 200px; height: 200px; margin: 0 auto 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.pix-copy { display: flex; gap: 8px; }
.pix-copy input { flex: 1; }

.result-success { text-align: center; padding: 20px 0; }
.result-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--success-bg); color: var(--primary); display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.result-icon .icon { width: 32px; height: 32px; }

/* ---------------------------------------------------------------------
   Area do cliente
   --------------------------------------------------------------------- */
.page-shell { background: var(--bg-soft); min-height: calc(100vh - 72px); padding: 40px 0 64px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 12px; }
.page-head h1 { font-size: 26px; margin: 0; }

.filters-bar { display: flex; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.filters-bar select, .filters-bar input { padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 14px; background: #fff; }

.consult-list { display: grid; gap: 14px; }
.consult-row {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px 22px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.consult-row .type-icon { width: 44px; height: 44px; margin: 0; flex-shrink: 0; }
.consult-row .type-icon .icon { width: 22px; height: 22px; }
.consult-info { flex: 1; min-width: 180px; }
.consult-info h4 { margin: 0 0 4px; font-size: 15.5px; }
.consult-info .meta { font-size: 13px; color: var(--text-faint); }
.consult-plate { font-family: 'JetBrains Mono', monospace; font-weight: 700; background: var(--bg-soft); padding: 3px 9px; border-radius: 6px; letter-spacing: .04em; }
.consult-actions { display: flex; gap: 8px; }

.empty-state { text-align: center; padding: 70px 20px; color: var(--text-muted); }
.empty-state .icon { width: 46px; height: 46px; color: var(--text-faint); margin: 0 auto 16px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab-link { padding: 12px 18px; font-size: 14.5px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; }
.tab-link.active { color: var(--primary-dark); border-color: var(--primary); }

/* ---------------------------------------------------------------------
   Detalhe da consulta (impressao / PDF)
   --------------------------------------------------------------------- */
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.info-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; background: #fff; }
.info-item .label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); font-weight: 700; margin-bottom: 6px; }
.info-item .value { font-size: 15px; font-weight: 600; word-break: break-word; }
.section-title { font-size: 16px; margin: 28px 0 14px; padding-top: 20px; border-top: 1px solid var(--border); }
.section-title:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table th, table.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
table.data-table th { background: var(--bg-soft); font-weight: 700; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }

@media print {
    .no-print { display: none !important; }
    body { background: #fff; }
    .page-shell { padding: 0; background: #fff; }
    .card { border: none; box-shadow: none; padding: 0; }
}

/* Utilitarios */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.items-center { align-items: center; }