/* ===================================================
   Tabela de Preços Pública — BH Quadros / GolComércio
   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: #F5F6F8;
    --bg-card: #FFFFFF;
    --bg-card-hover: #FAFBFC;
    --bg-input: #F0F2F5;
    --border-light: #E2E5EA;
    --border-medium: #CDD1D7;
    --text-primary: #1A1A1C;
    --text-secondary: #5A5A5D;
    --text-muted: #8A8D93;
    --text-on-brand: #FFFFFF;

    /* Feedback */
    --color-success: #0E7C5F;
    --color-success-bg: #E8F5F0;
    --color-success-border: #B8DFD0;
    --color-error: #C03030;
    --color-error-bg: #FDF0F0;
    --color-error-border: #F0C4C4;

    /* 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 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
}

/* ─── 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;
}

/* ─── 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: 1000px;
    margin: 1.5rem auto;
    padding: 0 1.5rem 3rem;
}

/* ─── Welcome Banner ───────────────────────────── */
.tp-welcome {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--brand-primary);
    border-radius: 10px;
    padding: 1.25rem 1.75rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.tp-welcome__info h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--brand-primary);
    margin: 0 0 0.2rem;
    text-transform: uppercase;
    letter-spacing: -0.01em;
}

.tp-welcome__info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.tp-welcome__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    background: #E6F1F5;
    border: 1px solid #B3D4E0;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--brand-primary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

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

/* ─── Search / Filter ──────────────────────────── */
.tp-search {
    margin-bottom: 1rem;
}

.tp-search input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    font-size: 0.88rem;
    font-family: inherit;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 10px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-sizing: border-box;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238A8D93'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.75rem center;
    background-size: 1rem;
}

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

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

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

/* ─── Product Table ────────────────────────────── */
.tp-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

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

.tp-table thead {
    background: var(--brand-primary);
}

.tp-table th {
    padding: 0.8rem 1rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-on-brand);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

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

.tp-table td {
    padding: 0.7rem 1rem;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.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.88rem;
}

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

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

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

.tp-table .tp-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.tp-table .tp-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-weight: 600;
}

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

.tp-table .tp-price-discount {
    color: var(--color-success);
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
}

.tp-table .tp-price-savings {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-success);
    background: var(--color-success-bg);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    display: inline-block;
}

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

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

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

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

/* ─── 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: scale(0.97); }
    to   { opacity: 1; transform: scale(1); }
}

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

.tp-acesso-card {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease, margin 0.35s ease;
    opacity: 0;
    margin-bottom: 0;
}

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

.tp-acesso-card__inner {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--brand-primary);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
}

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

.tp-acesso-card__close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 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.82rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

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

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

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

    .tp-welcome {
        padding: 1rem 1.25rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .tp-table th,
    .tp-table td {
        padding: 0.55rem 0.65rem;
        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%;
    }
}
