/* ===================================================
   Tabela de Preços Pública — BH Quadros
   Paleta oficial: azul-petróleo #095D77, cinza #3F3F42
   Tipografia: Panton (fallback Inter/system)
   =================================================== */

/* ─── Design Tokens (do manual da marca) ──────── */
:root {
    --brand-primary: #095D77;       /* RGB(9, 93, 119) — Pantone 308C */
    --brand-primary-light: #0B7A9E;
    --brand-primary-dark: #064A5F;
    --brand-secondary: #3F3F42;     /* RGB(63, 63, 66) — Pantone 446C */
    --brand-secondary-light: #5A5A5D;
    --brand-accent: #0A8FB4;        /* destaque hover */

    /* Neutros */
    --bg-page: #ffffff;
    --bg-card: #FFFFFF;
    --bg-card-hover: #FAFBFC;
    --bg-input: #f8fafc;
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-on-brand: #FFFFFF;

    /* Feedback */
    --color-success: #057a55;
    --color-success-bg: #ecfdf5;
    --color-success-border: #a7f3d0;
    --color-error: #b91c1c;
    --color-error-bg: #fef2f2;
    --color-error-border: #fecaca;

    /* Sombras */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.06);
}

/* ─── Reset & Base ─────────────────────────────── */
.tp-page {
    min-height: 100vh;
    margin: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

body.tp-page::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 600px;
    background: linear-gradient(180deg, #e4f3fa 0%, rgba(228, 243, 250, 0.4) 50%, #ffffff 100%);
    z-index: -1;
    pointer-events: none;
}

/* ─── Header ───────────────────────────────────── */
.tp-header {
    width: 100%;
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    border-bottom: 2px solid var(--brand-primary);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.tp-header__logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--brand-primary);
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.tp-header__subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ─── Card Container (OTP page) ────────────────── */
.tp-card {
    width: 100%;
    max-width: 480px;
    margin: 3rem auto;
    padding: 2.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.tp-card__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #E6F1F5, #D0E8F0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.tp-card__title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
    color: var(--brand-primary);
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.tp-card__desc {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 2rem;
    line-height: 1.6;
}

/* ─── Form Inputs ──────────────────────────────── */
.tp-input-group {
    margin-bottom: 1.5rem;
}

.tp-input-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--brand-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.tp-input {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: 10px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.tp-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(9, 93, 119, 0.12);
    background: #fff;
}

.tp-input::placeholder {
    color: var(--text-muted);
}

/* ─── OTP Inputs ───────────────────────────────── */
.tp-otp-group {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.tp-otp-input {
    width: 52px;
    height: 60px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: var(--bg-input);
    border: 2px solid var(--border-medium);
    border-radius: 10px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.tp-otp-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(9, 93, 119, 0.12);
    background: #fff;
}

/* ─── Buttons ──────────────────────────────────── */
.tp-btn {
    width: 100%;
    padding: 0.85rem 1.5rem;
    font-size: 0.92rem;
    font-weight: 700;
    font-family: inherit;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tp-btn--primary {
    background: var(--brand-primary);
    color: var(--text-on-brand);
    box-shadow: 0 2px 8px rgba(9, 93, 119, 0.25);
}

.tp-btn--primary:hover {
    background: var(--brand-primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(9, 93, 119, 0.3);
}

.tp-btn--primary:active {
    transform: translateY(0);
}

.tp-btn--ghost {
    background: transparent;
    color: var(--brand-primary);
    border: 1px solid var(--border-medium);
}

.tp-btn--ghost:hover {
    background: rgba(9, 93, 119, 0.04);
    border-color: var(--brand-primary);
}

.tp-btn--sm {
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.78rem;
}

/* ─── Personalizada Button ─────────────────────── */
.tp-btn--personalizada {
    background: var(--brand-primary);
    border: 1px solid var(--brand-primary);
    color: var(--text-on-brand);
}

.tp-btn--personalizada:hover {
    background: var(--brand-primary-light);
    border-color: var(--brand-primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(9, 93, 119, 0.25);
}

/* ─── Error / Alert Messages ──────────────────── */
.tp-alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tp-alert--error {
    background: var(--color-error-bg);
    border: 1px solid var(--color-error-border);
    color: var(--color-error);
}

.tp-alert--info {
    background: #E6F1F5;
    border: 1px solid #B3D4E0;
    color: var(--brand-primary);
}

.tp-alert--success {
    background: var(--color-success-bg);
    border: 1px solid var(--color-success-border);
    color: var(--color-success);
}

/* ─── Timer / Link ─────────────────────────────── */
.tp-link {
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.tp-link:hover {
    color: var(--brand-accent);
    text-decoration: underline;
}

.tp-resend {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ─── Dev Code Display ─────────────────────────── */
.tp-dev-code {
    text-align: center;
    margin: 1rem 0;
    padding: 0.6rem 1rem;
    background: #E6F1F5;
    border: 1px dashed var(--brand-primary);
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--brand-primary);
    letter-spacing: 0.3em;
}

/* ═══════════════════════════════════════════════
   TABELA DE PREÇOS (view principal)
   ═══════════════════════════════════════════════ */

.tp-table-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
    animation: tp-fade-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Premium Marketing Header ─────────────────── */
.tp-mkt-header {
    text-align: center;
    padding: 3.5rem 1.5rem 2.5rem;
}

.tp-mkt-badge {
    background: rgba(9, 93, 119, 0.08);
    border: 1px solid rgba(9, 93, 119, 0.15);
    color: var(--brand-primary);
    font-size: 0.72rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.tp-mkt-header h1 {
    font-size: clamp(1.8rem, 4.5vw, 2.75rem);
    font-weight: 850;
    color: #0f172a;
    letter-spacing: -0.03em;
    margin: 0 0 1rem;
    line-height: 1.15;
}

.tp-mkt-header h1 span {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tp-mkt-desc {
    font-size: 0.95rem;
    color: #475569;
    max-width: 600px;
    margin: 0 auto 1.75rem;
    line-height: 1.6;
    font-weight: 450;
}

.tp-mkt-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.tp-welcome__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #047857;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ─── Search / Filter ──────────────────────────── */
.tp-search-container {
    margin: 0 auto 2.5rem;
    max-width: 720px;
}

.tp-search {
    position: relative;
    display: flex;
    align-items: center;
}

.tp-search input {
    width: 100%;
    height: 54px;
    padding: 0 3.25rem 0 3.25rem;
    font-size: 0.95rem;
    font-family: inherit;
    background: #ffffff;
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    color: var(--text-primary);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.tp-search input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(9, 93, 119, 0.08), 0 4px 20px rgba(9, 93, 119, 0.05);
}

.tp-search input::placeholder {
    color: #94a3b8;
}

.tp-search .search-icon {
    position: absolute;
    left: 1.25rem;
    font-size: 1.25rem;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.25s;
    display: flex;
    align-items: center;
}

.tp-search input:focus ~ .search-icon {
    color: var(--brand-primary);
}

.tp-search-kbd {
    position: absolute;
    right: 1.25rem;
    display: flex;
    align-items: center;
    gap: 2px;
    color: #94a3b8;
    pointer-events: none;
    font-size: 0.75rem;
}

.tp-search-kbd kbd {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 1px 0 rgba(0,0,0,0.05);
}

.tp-search-helper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.6rem;
    padding: 0 0.5rem;
    font-size: 0.76rem;
    color: #64748b;
    font-weight: 500;
}

.tp-search-helper i {
    color: #f59e0b;
    margin-right: 0.2rem;
}

.tp-search-kbd-hint {
    opacity: 0.85;
}

.tp-search-kbd-hint kbd {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 1px 4px;
    font-size: 0.65rem;
    font-family: inherit;
}

/* ─── Stats Bar ────────────────────────────────── */
.tp-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ─── Product Table ────────────────────────────── */
.tp-table-wrap {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.tp-table {
    width: 100%;
    border-collapse: collapse;
}

.tp-table thead {
    background: #f8fafc;
}

.tp-table th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 0.74rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1.5px solid var(--border-light);
}

.tp-table th:last-child {
    text-align: right;
}

.tp-table td {
    padding: 0.95rem 1.25rem;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    line-height: 1.5;
}

.tp-table td:last-child {
    text-align: right;
    font-weight: 700;
    color: var(--brand-primary);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.95rem;
}

.tp-table tbody tr {
    transition: background-color 0.2s ease;
}

.tp-table tbody tr:hover {
    background-color: rgba(9, 93, 119, 0.02);
}

.tp-table tbody tr:last-child td {
    border-bottom: none;
}

.tp-table .tp-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
}

.tp-table .tp-unit {
    font-size: 0.72rem;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

/* ─── Price Columns (Personalizada) ───────────── */
.tp-table .tp-price-original {
    color: #94a3b8;
    font-size: 0.8rem;
    text-decoration: line-through;
    font-family: 'JetBrains Mono', monospace;
}

.tp-table .tp-price-discount {
    color: #0f766e;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
}

.tp-table .tp-price-savings {
    font-size: 0.72rem;
    font-weight: 700;
    color: #0f766e;
    background: #ccfbf1;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    border: 1px solid #99f6e4;
    display: inline-block;
}

/* ─── Stock Badge ─────────────────────────────── */
.tp-stock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    border-radius: 9999px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.tp-stock-badge--low {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
}

.tp-stock-badge--zero {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

/* ─── No Results ───────────────────────────────── */
.tp-no-results {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    display: none;
}

/* ─── Load More Button ─────────────────────────── */
.tp-load-more {
    text-align: center;
    padding: 2rem 0;
}

.tp-load-more .tp-btn {
    min-width: 240px;
    border-radius: 12px;
}

/* ─── Footer ───────────────────────────────────── */
.tp-footer {
    text-align: center;
    padding: 2.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-light);
    width: 100%;
    margin-top: auto;
}

/* ─── Loading Spinner ──────────────────────────── */
.tp-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tp-spin 0.6s linear infinite;
}

@keyframes tp-spin {
    to { transform: rotate(360deg); }
}

/* ─── Animations ──────────────────────────────── */
@keyframes tp-fade-in {
    from { opacity: 0; transform: translateY(15px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════
   CARD DE ACESSO (Tabela Personalizada)
   ═══════════════════════════════════════════════ */

.tp-acesso-card {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, margin 0.4s ease;
    opacity: 0;
    margin-bottom: 0;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}

.tp-acesso-card.active {
    max-height: 240px;
    opacity: 1;
    margin-bottom: 1.5rem;
}

.tp-acesso-card__inner {
    background: #ffffff;
    border: 1px solid rgba(9, 93, 119, 0.15);
    border-left: 4px solid var(--brand-primary);
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.tp-acesso-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin-bottom: 0.5rem;
}

.tp-acesso-card__close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.15s;
    line-height: 1;
}

.tp-acesso-card__close:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.tp-acesso-card__desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
    line-height: 1.5;
}

.tp-acesso-card__row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

/* ─── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
    .tp-card {
        margin: 2rem 1rem;
        padding: 2rem 1.5rem;
        border-radius: 14px;
    }

    .tp-table-container {
        padding: 0 1rem 3rem;
        max-width: 100%;
    }

    .tp-mkt-header {
        padding: 2.5rem 1rem 1.75rem;
    }

    .tp-table th,
    .tp-table td {
        padding: 0.75rem 0.85rem;
        font-size: 0.82rem;
    }

    .tp-table .tp-code {
        display: none;
    }

    .tp-otp-input {
        width: 44px;
        height: 52px;
        font-size: 1.2rem;
    }

    .tp-header {
        flex-direction: column;
        gap: 0.25rem;
        padding: 1rem;
    }

    .tp-acesso-card__row {
        flex-direction: column;
    }

    .tp-acesso-card__row .tp-btn {
        width: 100%;
    }

    .tp-search-kbd {
        display: none;
    }

    .tp-search-kbd-hint {
        display: none;
    }
}

/* ── Page transition exit animations for standalone pages ── */
.tp-table-container, .tp-card {
  will-change: opacity, transform;
}
body.page-transitioning .tp-table-container,
body.page-transitioning .tp-card {
  opacity: 0 !important;
  transform: translateY(-15px) !important;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
