/* =============================================
   AJUDA PEDREIRO - Design System
   Tema escuro premium com acentos de construção
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ---------- CSS Variables ---------- */
:root {
    /* Cores principais */
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-card: #22263280;
    --bg-card-solid: #222632;
    --bg-input: #2a2e3a;
    --bg-nav: #161922ee;

    /* Acentos - tons de construção */
    --accent-primary: #f59e0b;     /* Amarelo dourado */
    --accent-secondary: #f97316;   /* Laranja */
    --accent-green: #10b981;       /* Verde sucesso */
    --accent-red: #ef4444;         /* Vermelho erro */
    --accent-blue: #3b82f6;        /* Azul info */
    --accent-whatsapp: #25d366;    /* Verde WhatsApp */
    --accent-pdf: #ef4444;         /* Vermelho PDF */

    /* Gradientes */
    --gradient-accent: linear-gradient(135deg, #f59e0b, #f97316);
    --gradient-card: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(249,115,22,0.04));
    --gradient-success: linear-gradient(135deg, #10b981, #059669);
    --gradient-whatsapp: linear-gradient(135deg, #25d366, #128c7e);
    --gradient-pdf: linear-gradient(135deg, #ef4444, #dc2626);

    /* Texto */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #f59e0b;

    /* Bordas e efeitos */
    --border-color: rgba(245,158,11,0.15);
    --border-subtle: rgba(255,255,255,0.06);
    --shadow-card: 0 4px 24px rgba(0,0,0,0.3);
    --shadow-btn: 0 4px 16px rgba(245,158,11,0.25);
    --shadow-glow: 0 0 30px rgba(245,158,11,0.1);

    /* Dimensões */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --nav-height: 72px;
    --header-height: 64px;
    --btn-min-height: 56px;
}

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

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    padding-bottom: calc(var(--nav-height) + 20px);
    -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--header-height);
}

.app-header .logo-icon {
    font-size: 28px;
    line-height: 1;
}

.app-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

/* ---------- Navegação Inferior ---------- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: var(--nav-height);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.nav-btn .nav-icon {
    font-size: 24px;
    line-height: 1;
    transition: transform 0.3s ease;
}

.nav-btn.active {
    color: var(--accent-primary);
}

.nav-btn.active .nav-icon {
    transform: scale(1.15);
}

.nav-btn.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--gradient-accent);
    border-radius: 0 0 4px 4px;
}

.nav-btn:active {
    transform: scale(0.92);
}

/* ---------- Conteúdo das Abas ---------- */
.tab-content {
    display: none;
    padding: 20px 16px;
    animation: fadeInUp 0.35s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Títulos de Seção ---------- */
.section-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.03em;
}

.section-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 14px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-glow);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.card-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

/* ---------- Inputs ---------- */
.input-group {
    margin-bottom: 12px;
}

.input-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    outline: none;
    transition: all 0.25s ease;
    -webkit-appearance: none;
    appearance: none;
}

.input-field::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.input-field:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(245,158,11,0.12);
    background: var(--bg-secondary);
}

.input-prefix {
    position: relative;
}

.input-prefix .input-field {
    padding-left: 42px;
}

.input-prefix::before {
    content: 'R$';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 0.9rem;
    z-index: 1;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.input-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* ---------- Dimensões Helper ---------- */
.dim-hint {
    font-size: 0.78rem;
    color: var(--accent-primary);
    margin-bottom: 12px;
    opacity: 0.8;
    font-weight: 500;
}

.dim-computed {
    text-align: center;
    padding: 8px 12px;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
    margin: 8px 0;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.dim-computed.active {
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.2);
    color: var(--accent-green);
    font-size: 0.88rem;
    font-weight: 700;
}

/* ---------- Resultado parcial (na calculadora) ---------- */
.calc-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(245,158,11,0.06);
    border: 1px solid rgba(245,158,11,0.12);
    border-radius: var(--radius-sm);
    margin-top: 12px;
}

.calc-result-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.calc-result-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--accent-primary);
}

/* ---------- Botões ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: var(--btn-min-height);
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: none;
    letter-spacing: -0.01em;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.96);
}

.btn-icon {
    font-size: 20px;
    line-height: 1;
}

/* Botão Principal (Salvar, Adicionar) */
.btn-primary {
    background: var(--gradient-accent);
    color: #1a1d27;
    box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
    box-shadow: 0 6px 24px rgba(245,158,11,0.35);
}

/* Botão Secundário */
.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-solid);
    border-color: var(--accent-primary);
}

/* Botão WhatsApp */
.btn-whatsapp {
    background: var(--gradient-whatsapp);
    color: #fff;
    box-shadow: 0 4px 16px rgba(37,211,102,0.3);
}

.btn-whatsapp:hover {
    box-shadow: 0 6px 24px rgba(37,211,102,0.4);
}

/* Botão Imprimir */
.btn-print {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}

.btn-print:hover {
    box-shadow: 0 6px 24px rgba(99,102,241,0.4);
}

/* Botão Adicionar (na calculadora) */
.btn-add {
    background: var(--gradient-success);
    color: #fff;
    margin-top: 12px;
    box-shadow: 0 4px 16px rgba(16,185,129,0.25);
}

/* Botão Remover */
.btn-remove {
    background: transparent;
    border: 1px solid rgba(239,68,68,0.3);
    color: var(--accent-red);
    min-height: 40px;
    padding: 8px 16px;
    font-size: 0.82rem;
}

/* Botão Limpar */
.btn-clear {
    background: transparent;
    border: 1.5px solid rgba(239,68,68,0.3);
    color: var(--accent-red);
}

/* Grid de botões de ação */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

/* ---------- Orçamento / Lista ---------- */
.budget-list {
    list-style: none;
}

.budget-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    animation: fadeInUp 0.3s ease;
}

.budget-item-info {
    flex: 1;
    min-width: 0;
}

.budget-item-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.budget-item-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.budget-item-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent-primary);
    white-space: nowrap;
}

.budget-item-remove {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    color: var(--accent-red);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.budget-item-remove:active {
    transform: scale(0.9);
    background: rgba(239,68,68,0.2);
}

/* ---------- Total ---------- */
.total-card {
    background: var(--gradient-card);
    border: 2px solid var(--accent-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    margin: 20px 0;
    box-shadow: var(--shadow-glow);
}

.total-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.total-value {
    font-size: 2.2rem;
    font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
}

/* ---------- Cliente Input ---------- */
.client-section {
    margin-bottom: 20px;
}

.client-input {
    width: 100%;
    padding: 16px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    transition: all 0.25s ease;
}

.client-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(245,158,11,0.12);
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ---------- Toast Notification ---------- */
.toast {
    position: fixed;
    bottom: calc(var(--nav-height) + 20px);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card-solid);
    border: 1px solid var(--accent-green);
    color: var(--text-primary);
    padding: 14px 28px;
    border-radius: var(--radius-xl);
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 500;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------- Badge (contador no nav) ---------- */
.nav-badge {
    position: absolute;
    top: 2px;
    right: 4px;
    background: var(--accent-red);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    display: none;
}

.nav-badge.show {
    display: flex;
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* ---------- Contract Fields ---------- */
.contract-fields {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}

.contract-fields-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.contract-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle);
}

/* ---------- Utilitários ---------- */
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.82rem; }

/* Scroll suave nas seções */
.scroll-area {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Esconde scrollbar mantendo funcionalidade */
.scroll-area::-webkit-scrollbar {
    width: 0;
}

/* ---------- Service Selector (Icon Grid) ---------- */
.service-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.service-selector-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 8px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.service-selector-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-accent);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.service-selector-btn:hover {
    border-color: rgba(245,158,11,0.35);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245,158,11,0.12);
}

.service-selector-btn:active {
    transform: scale(0.93);
}

.service-selector-btn.active {
    border-color: var(--accent-primary);
    background: rgba(245,158,11,0.08);
    box-shadow: 0 0 24px rgba(245,158,11,0.15), inset 0 0 20px rgba(245,158,11,0.05);
}

.service-selector-btn.active::before {
    opacity: 0.06;
}

.service-selector-btn.active .service-selector-icon {
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px rgba(245,158,11,0.4));
}

.service-selector-btn.active .service-selector-label {
    color: var(--accent-primary);
}

.service-selector-icon {
    font-size: 30px;
    line-height: 1;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.service-selector-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: color 0.3s ease;
    position: relative;
    z-index: 1;
    text-align: center;
    line-height: 1.2;
}

/* Animação de entrada do card selecionado */
.calc-service-card {
    animation: serviceCardReveal 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes serviceCardReveal {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---------- Multi-Wall (Paredes) ---------- */
.walls-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.wall-row {
    background: rgba(245,158,11,0.04);
    border: 1px solid rgba(245,158,11,0.12);
    border-radius: var(--radius-sm);
    padding: 12px;
    transition: all 0.25s ease;
    overflow: hidden;
}

.wall-row:hover {
    border-color: rgba(245,158,11,0.25);
}

.wall-row-enter {
    animation: wallSlideIn 0.3s ease forwards;
}

@keyframes wallSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 200px;
    }
}

.wall-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.wall-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: -0.01em;
}

.btn-remove-wall {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    color: var(--accent-red);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-remove-wall:active {
    transform: scale(0.9);
    background: rgba(239,68,68,0.25);
}

.btn-add-wall {
    background: rgba(245,158,11,0.08);
    border: 1.5px dashed rgba(245,158,11,0.3);
    color: var(--accent-primary);
    min-height: 44px;
    padding: 10px 16px;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.btn-add-wall:hover {
    background: rgba(245,158,11,0.12);
    border-color: rgba(245,158,11,0.5);
}

.wall-row .input-row {
    margin-bottom: 0;
}

.wall-row .input-group {
    margin-bottom: 0;
}

/* ---------- Responsivo ---------- */
@media (min-width: 480px) {
    .tab-content {
        max-width: 480px;
        margin: 0 auto;
    }
}

@media (min-width: 768px) {
    .tab-content {
        max-width: 560px;
        padding: 28px 20px;
    }

    .card {
        padding: 24px;
    }
}

/* ---------- Área de Impressão (invisível na tela) ---------- */
.print-area {
    display: none;
}

/* ---------- Calculadora Auxiliar (Numpad Modal) ---------- */
.numpad-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.numpad-overlay.show {
    opacity: 1;
    visibility: visible;
}

.numpad-modal {
    width: 100%;
    max-width: 420px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 16px 12px 12px;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-top: 2px solid var(--accent-primary);
}

.numpad-overlay.show .numpad-modal {
    transform: translateY(0);
}

/* Cabeçalho */
.numpad-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 6px 12px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 12px;
}

.numpad-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.numpad-field-name {
    flex: 1;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    text-align: right;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.numpad-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(239,68,68,0.12);
    color: var(--accent-red);
    border-radius: 50%;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.numpad-close:active {
    transform: scale(0.9);
    background: rgba(239,68,68,0.25);
}

/* Visor */
.numpad-display {
    background: var(--bg-primary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 14px;
    text-align: right;
    min-height: 72px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.numpad-expression {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    min-height: 18px;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.numpad-result {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Teclado numérico */
.numpad-keys {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.numpad-key {
    min-height: 58px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
}

.numpad-key:active {
    transform: scale(0.93);
    background: var(--bg-card-solid);
}

/* Teclas de operação (C, ⌫, ÷, ×, -, +) */
.numpad-op {
    background: rgba(245,158,11,0.12);
    color: var(--accent-primary);
}

.numpad-op:active {
    background: rgba(245,158,11,0.25);
}

/* Tecla igual (=) */
.numpad-equals {
    background: var(--gradient-accent);
    color: #1a1d27;
}

.numpad-equals:active {
    opacity: 0.85;
}

/* Tecla zero (0) - mais larga */
.numpad-zero {
    grid-column: span 2;
}

/* Botão OK - confirma valor */
.numpad-ok {
    background: var(--gradient-success);
    color: #fff;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.numpad-ok:active {
    opacity: 0.85;
}

/* Input com indicador de calculadora */
.input-field[readonly] {
    cursor: pointer;
}

.input-field[readonly]:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(245,158,11,0.12);
}

/* ---------- Install Banner ---------- */
.install-banner {
    background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(249,115,22,0.08));
    border: 1px solid rgba(245,158,11,0.25);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    animation: installBannerSlide 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    position: relative;
    overflow: hidden;
}

.install-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(245,158,11,0.06), transparent);
    animation: installShimmer 3s ease-in-out infinite;
}

@keyframes installShimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

@keyframes installBannerSlide {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.install-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.install-banner-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    animation: installPulse 2s ease-in-out infinite;
}

@keyframes installPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.install-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.install-banner-text strong {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.install-banner-text span {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.install-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.btn-install {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--gradient-accent);
    color: #1a1d27;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(245,158,11,0.3);
    white-space: nowrap;
}

.btn-install:active {
    transform: scale(0.95);
}

.btn-install:hover {
    box-shadow: 0 6px 20px rgba(245,158,11,0.4);
}

.btn-install svg {
    flex-shrink: 0;
}

.btn-dismiss-install {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-dismiss-install:active {
    transform: scale(0.9);
    background: rgba(255,255,255,0.15);
}

/* ---------- Install Modal ---------- */
.install-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.install-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.install-modal {
    width: 100%;
    max-width: 440px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px 20px 32px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-top: 2px solid var(--accent-primary);
    position: relative;
    overflow: hidden;
}

.install-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(180deg, rgba(245,158,11,0.08), transparent);
    pointer-events: none;
}

.install-modal-overlay.show .install-modal {
    transform: translateY(0);
}

.install-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.install-modal-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--gradient-card);
    border: 1.5px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.install-modal-title {
    flex: 1;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.install-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(239,68,68,0.12);
    color: var(--accent-red);
    border-radius: 50%;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.install-modal-close:active {
    transform: scale(0.9);
    background: rgba(239,68,68,0.25);
}

.install-modal-body {
    position: relative;
    z-index: 1;
}

.install-instructions-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 18px;
    font-weight: 500;
}

.install-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-subtle);
    animation: fadeInUp 0.4s ease both;
}

.install-step:last-of-type {
    border-bottom: none;
}

.install-step:nth-child(2) { animation-delay: 0.05s; }
.install-step:nth-child(3) { animation-delay: 0.1s; }
.install-step:nth-child(4) { animation-delay: 0.15s; }
.install-step:nth-child(5) { animation-delay: 0.2s; }

.install-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-accent);
    color: #1a1d27;
    font-size: 0.85rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.install-step-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
    font-weight: 500;
    padding-top: 4px;
}

.install-step-text strong {
    color: var(--accent-primary);
    font-weight: 700;
}

.install-share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--accent-blue);
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
    vertical-align: middle;
    margin: 0 2px;
}

.install-modal-btn {
    margin-top: 20px;
}

.install-modal-btn svg {
    flex-shrink: 0;
}

/* ---------- Print styles ---------- */
@media print {
    /* Esconde TUDO do app */
    body > *:not(.print-area) {
        display: none !important;
    }

    /* Mostra apenas a área de impressão */
    .print-area {
        display: block !important;
    }

    body {
        background: #fff;
        color: #000;
        padding: 0;
        margin: 0;
    }
}

/* =============================================
   MODAL DE VERIFICAÇÃO DE PLANO (CPF)
   ============================================= */

.plano-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.plano-overlay.show {
    display: flex;
}

.plano-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.3s ease;
}

.plano-modal-header {
    text-align: center;
    margin-bottom: 28px;
}

.plano-modal-logo {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.plano-modal-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.plano-modal-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.plano-cpf-field {
    font-size: 28px !important;
    font-weight: 700 !important;
    text-align: center;
    letter-spacing: 12px;
}

.plano-erro {
    color: var(--accent-red);
    font-size: 13px;
    text-align: center;
    min-height: 18px;
    margin: 8px 0 0;
}

.plano-btn {
    width: 100%;
    margin-top: 20px;
    padding: 16px;
    font-size: 16px;
}

.plano-comprar-texto {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 20px;
}

.plano-comprar-link {
    color: var(--accent-primary);
    font-weight: 600;
    text-decoration: none;
}

.plano-comprar-link:hover {
    text-decoration: underline;
}
