/* ══════════════════════════════════════════
   NOVINECT — Main Stylesheet
   Colors: #1FB0C8 (primary) · #131922 (dark) · #3F4D5A (gray) · #D9D9D9 (light)
   ══════════════════════════════════════════ */

:root {
    --primary: #1FB0C8;
    --primary-hover: #1a9ab0;
    --primary-light: rgba(31, 176, 200, 0.1);
    --primary-rgb: 31, 176, 200;
    --dark: #131922;
    --gray: #3F4D5A;
    --light-gray: #D9D9D9;
    --lighter-gray: #e8ecf0;
    --bg: #f0f4f8;
    --white: #ffffff;
    --success: #22c55e;
    --success-light: rgba(34, 197, 94, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.1);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
    --transition: 0.2s ease;
}

/* ═══ RESET & BASE ═══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); color: var(--dark); background: var(--bg); line-height: 1.5; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ═══ TYPOGRAPHY ═══ */
h1, h2, h3 { color: var(--dark); font-weight: 600; line-height: 1.3; }
.required { color: var(--danger); }

/* ═══ UTILITY ═══ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ ALERTS ═══ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-error { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.alert-success { background: var(--success-light); color: #16a34a; border: 1px solid rgba(34,197,94,0.2); }
.alert-warning { background: var(--warning-light); color: #d97706; border: 1px solid rgba(245,158,11,0.2); }
.alert-info { background: var(--info-light); color: var(--info); border: 1px solid rgba(59,130,246,0.2); }

/* ═══ BUTTONS ═══ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover:not(:disabled) { background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--gray); }
.btn-ghost:hover { color: var(--dark); background: var(--lighter-gray); }
.btn-warning { background: var(--warning); color: var(--white); }
.btn-warning:hover { background: #d97706; }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-icon { background: none; border: none; cursor: pointer; padding: 6px; border-radius: var(--radius-sm); color: var(--gray); display: flex; align-items: center; transition: all var(--transition); }
.btn-icon:hover { background: var(--lighter-gray); color: var(--danger); }
.btn-icon svg { width: 18px; height: 18px; }
.btn-loading { display: inline-flex; align-items: center; gap: 6px; }
.btn-loading svg { animation: spin 1s linear infinite; }

/* ═══ FORMS ═══ */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--gray); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--light-gray);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--dark);
    font-size: 14px;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--light-gray); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-hint { display: block; font-size: 12px; color: var(--gray); margin-top: 4px; opacity: 0.8; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--light-gray); pointer-events: none; }
.input-icon input { padding-left: 40px; }

/* Password toggle */
.btn-pw-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--gray); padding: 4px; pointer-events: auto; }
.btn-pw-toggle svg { width: 18px; height: 18px; pointer-events: none; }
.btn-pw-toggle:hover { color: var(--primary); }

/* Blocked numbers */
.blocked-add-row { display: flex; gap: 8px; align-items: flex-end; }
.blocked-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--bg); border-radius: var(--radius-sm); margin-bottom: 6px; }
.blocked-number { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--dark); }
.blocked-number svg { width: 16px; height: 16px; color: var(--danger); }
.btn-remove-blocked svg { width: 16px; height: 16px; }

/* Checkboxes */
.checkbox-group { display: flex; gap: 16px; flex-wrap: wrap; }
.checkbox-label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; color: var(--dark); }
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

/* Toggle switch */
.toggle-section { margin-bottom: 20px; }
.toggle-label { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; color: var(--dark); }
.toggle-label input { display: none; }
.toggle-switch {
    width: 44px; height: 24px; background: var(--light-gray); border-radius: 12px;
    position: relative; transition: background var(--transition); flex-shrink: 0;
}
.toggle-switch::after {
    content: ''; width: 18px; height: 18px; background: var(--white); border-radius: 50%;
    position: absolute; top: 3px; left: 3px; transition: transform var(--transition); box-shadow: var(--shadow);
}
.toggle-label input:checked + .toggle-switch { background: var(--primary); }
.toggle-label input:checked + .toggle-switch::after { transform: translateX(20px); }

/* ═══ AUTH PAGES ═══ */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.auth-container { width: 100%; max-width: 420px; }
.auth-card { background: var(--white); border-radius: var(--radius-lg); padding: 36px 32px; box-shadow: var(--shadow-lg); }
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo img { height: 36px; }
.auth-title { font-size: 22px; text-align: center; margin-bottom: 6px; }
.auth-subtitle { text-align: center; color: var(--gray); font-size: 14px; margin-bottom: 24px; }
.auth-form { margin-bottom: 16px; }
.auth-footer { text-align: center; font-size: 13px; color: var(--gray); }

/* Confirm page states */
.confirm-state { text-align: center; }
.confirm-icon { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.confirm-icon svg { width: 32px; height: 32px; }
.confirm-icon-success { background: var(--success-light); color: var(--success); }
.confirm-icon-warning { background: var(--warning-light); color: var(--warning); }
.confirm-icon-error { background: var(--danger-light); color: var(--danger); }
.confirm-icon-info { background: var(--primary-light); color: var(--primary); }
.confirm-tips { text-align: left; background: var(--bg); padding: 16px; border-radius: var(--radius); margin: 20px 0; font-size: 13px; color: var(--gray); }
.confirm-tips ul { margin: 8px 0 0 20px; }
.confirm-tips li { margin-bottom: 4px; }
.loading-bar {
    height: 4px; background: var(--lighter-gray); border-radius: 2px; overflow: hidden; margin-top: 20px;
}
.loading-bar::after {
    content: ''; display: block; height: 100%; width: 30%; background: var(--primary);
    border-radius: 2px; animation: loadbar 1.5s ease-in-out infinite;
}
@keyframes loadbar { 0% { transform: translateX(-100%); } 100% { transform: translateX(400%); } }

/* ═══ SETUP WIZARD ═══ */
.setup-page { background: var(--bg); }
.setup-header { background: var(--white); border-bottom: 1px solid var(--lighter-gray); position: sticky; top: 0; z-index: 100; }
.setup-header-inner { max-width: 800px; margin: 0 auto; padding: 16px 20px; display: flex; align-items: center; gap: 32px; }
.setup-logo { height: 28px; }

/* Wizard steps */
.wizard-steps { display: flex; align-items: center; gap: 0; flex: 1; }
.wizard-step { display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; }
.wizard-step-circle {
    width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600; border: 2px solid var(--light-gray); color: var(--gray); background: var(--white);
    transition: all var(--transition);
}
.wizard-step.active .wizard-step-circle { border-color: var(--primary); background: var(--primary); color: var(--white); }
.wizard-step.done .wizard-step-circle { border-color: var(--success); background: var(--success); color: var(--white); }
.wizard-step-label { font-size: 11px; color: var(--gray); white-space: nowrap; }
.wizard-step.active .wizard-step-label { color: var(--primary); font-weight: 600; }
.wizard-step.done .wizard-step-label { color: var(--success); }
.wizard-step-line { flex: 1; height: 2px; background: var(--light-gray); margin: 0 8px; margin-bottom: 18px; transition: background var(--transition); }
.wizard-step-line.done { background: var(--success); }

/* Panels */
.setup-content { max-width: 680px; margin: 0 auto; padding: 24px 20px 60px; }
.wizard-panel { display: none; }
.wizard-panel.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.panel-card { background: var(--white); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); }
.panel-title { font-size: 20px; margin-bottom: 6px; }
.panel-subtitle { color: var(--gray); font-size: 14px; margin-bottom: 24px; }
.panel-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--lighter-gray); }
.panel-actions-right { display: flex; gap: 10px; }

/* Offers rows */
.offer-row { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 10px; }
.offer-name { flex: 2; }
.offer-price { flex: 1; }
.btn-remove-offer { margin-bottom: 16px; }

/* AI Preview */
.ai-loading { text-align: center; padding: 40px 0; }
.spinner {
    width: 40px; height: 40px; border: 3px solid var(--lighter-gray); border-top-color: var(--primary);
    border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 12px;
}
.preview-section { margin-bottom: 20px; }
.preview-section h3 { font-size: 14px; color: var(--gray); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.preview-section h3 svg { width: 16px; height: 16px; }
.preview-section textarea {
    font-size: 13px;
    line-height: 1.6;
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--light-gray);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--dark);
    resize: vertical;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.preview-section textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
    background: var(--white);
}
.faq-item { background: var(--bg); padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 8px; }
.faq-item strong { font-size: 13px; color: var(--dark); display: block; margin-bottom: 4px; }
.faq-item p { font-size: 13px; color: var(--gray); margin: 0; }

/* Collapsible */
.collapsible-header { cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none; }
.collapse-icon { transition: transform var(--transition); }
.collapsible-header.open .collapse-icon { transform: rotate(180deg); }

/* WhatsApp Connect */
.connect-steps { background: var(--bg); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 24px; }
.connect-step { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 14px; }
.connect-step-num {
    width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: var(--white);
    display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.qr-placeholder, .qr-display, .qr-connected { text-align: center; padding: 32px 0; }
.qr-display img { width: 260px; height: 260px; border-radius: var(--radius); border: 2px solid var(--lighter-gray); }
.qr-hint { font-size: 13px; color: var(--gray); margin-top: 8px; }
.btn-done-scanning { margin: 18px auto 0; display: flex; }
.qr-connected h3 { color: var(--success); margin-top: 12px; }

/* Mobile warning */
.mobile-warning-card { text-align: center; padding: 20px 0; }
.mobile-steps { text-align: left; background: var(--bg); padding: 16px; border-radius: var(--radius); margin-top: 20px; font-size: 14px; }
.mobile-steps ol { margin: 8px 0 0 20px; }
.mobile-steps li { margin-bottom: 6px; }

/* ═══ DASHBOARD ═══ */
.dashboard-page { background: var(--bg); }
.dash-header { background: var(--dark); }
.dash-header-inner { max-width: 900px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; }
.dash-logo { height: 26px; }
.dash-nav { display: flex; align-items: center; gap: 16px; }
.dash-user { color: rgba(255,255,255,0.7); font-size: 13px; }
.dash-phone { color: var(--primary); font-size: 12px; font-weight: 500; background: rgba(31,176,200,0.12); padding: 3px 10px; border-radius: 20px; }
.dash-logout { color: rgba(255,255,255,0.6) !important; }
.dash-logout:hover { color: var(--white) !important; background: rgba(255,255,255,0.1) !important; }
.dash-menu-toggle { display: none; background: none; border: none; color: rgba(255,255,255,0.8); cursor: pointer; padding: 6px; }
.dash-menu-toggle svg { width: 22px; height: 22px; }
.dash-content { max-width: 900px; margin: 0 auto; padding: 24px 20px; }

/* Sales banner */
.sales-banner { background: linear-gradient(135deg, #f59e0b, #d97706); border-radius: var(--radius); margin-bottom: 20px; color: var(--white); overflow: hidden; }
.sales-banner.expired { background: linear-gradient(135deg, var(--danger), #b91c1c); }
.sales-banner-inner { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sales-banner-text { display: flex; align-items: center; gap: 12px; }
.sales-banner-text svg { width: 24px; height: 24px; flex-shrink: 0; }
.sales-banner-text strong { font-size: 15px; display: block; }
.sales-banner-text p { font-size: 13px; margin: 2px 0 0; opacity: 0.9; }
.sales-banner .btn-warning { background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.3); flex-shrink: 0; }
.sales-banner .btn-warning:hover { background: rgba(255,255,255,0.3); }

/* Stat cards */
.dash-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.dash-card {
    background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
    display: flex; align-items: center; gap: 14px;
}
.dash-card-icon {
    width: 44px; height: 44px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
    background: var(--success-light); color: var(--success);
}
.dash-card-icon svg { width: 22px; height: 22px; }
.dash-card-icon-info { background: var(--info-light); color: var(--info); }
.dash-card-icon-trial { background: var(--primary-light); color: var(--primary); }
.dash-card-icon-warning { background: var(--warning-light); color: var(--warning); }
.dash-card-icon-danger { background: var(--danger-light); color: var(--danger); }
.dash-card-icon-disconnected { background: var(--danger-light); color: var(--danger); }
.dash-card-label { font-size: 12px; color: var(--gray); display: block; }
.dash-card-value { font-size: 18px; display: block; margin-top: 2px; }
.dash-card-sub { font-size: 13px; color: var(--gray); font-weight: 400; }

/* Dashboard sections */
.dash-section { margin-bottom: 24px; }
.dash-section-title { font-size: 16px; margin-bottom: 12px; }
.dash-section-card { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.dash-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.dash-section-header .dash-section-title { margin-bottom: 0; }
.dash-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.form-actions { display: flex; gap: 10px; margin-top: 16px; }

/* Test card */
.test-card { display: flex; align-items: center; gap: 16px; background: var(--primary-light); border: 1px solid rgba(var(--primary-rgb), 0.15); }
.test-card-icon { width: 44px; height: 44px; background: var(--primary); color: var(--white); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.test-card-icon svg { width: 22px; height: 22px; }
.test-card h3 { font-size: 15px; margin-bottom: 4px; }
.test-card p { font-size: 13px; color: var(--gray); margin: 0; }

/* Offer rows — dashboard version */
.offer-row { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 10px; }

/* ═══ MODAL ═══ */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.modal-content { background: var(--white); border-radius: var(--radius-lg); width: 90%; max-width: 420px; position: relative; z-index: 1; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--lighter-gray); }
.modal-header h3 { font-size: 16px; }
.modal-body { padding: 24px 20px; text-align: center; }
.modal-body img { width: 220px; height: 220px; border-radius: var(--radius); }

/* Upgrade Modal */
.modal-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 440px;
    padding: 36px 28px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}
@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-icon { margin-bottom: 16px; }
.modal-title { font-size: 20px; font-weight: 700; color: var(--dark); margin: 0 0 12px; }
.modal-desc { font-size: 14px; color: var(--gray); line-height: 1.5; margin: 0 0 8px; }
.modal-cta { margin-top: 20px; width: 100%; justify-content: center; font-size: 15px; padding: 14px 20px; }
.modal-phone { margin-top: 12px; font-size: 13px; color: var(--gray); }
.modal-phone strong { color: var(--dark); }
.modal-dismiss { margin-top: 8px; color: var(--gray); font-size: 13px; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; }
    .dash-cards { grid-template-columns: 1fr; }
    .setup-header-inner { flex-direction: column; gap: 12px; }
    .wizard-step-label { display: none; }
    .panel-card { padding: 24px 20px; }
    .sales-banner-inner { flex-direction: column; text-align: center; }
    .panel-actions { flex-direction: column; gap: 10px; }
    .panel-actions > * { width: 100%; }
    .panel-actions-right { width: 100%; flex-direction: column; }
    .offer-row { flex-wrap: wrap; }
    .offer-name, .offer-price { flex: 1 1 100%; }

    /* Mobile hamburger nav */
    .dash-menu-toggle { display: block; }
    .dash-nav {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: var(--dark);
        padding: 12px 20px 16px;
        flex-direction: column;
        gap: 10px;
        border-top: 1px solid rgba(255,255,255,0.1);
        box-shadow: var(--shadow-md);
        z-index: 200;
    }
    .dash-nav.open { display: flex; }
    .dash-header-inner { position: relative; }
    .dash-phone { align-self: flex-start; }
}

@media (max-width: 480px) {
    .auth-card { padding: 28px 20px; }
    .wizard-steps { gap: 0; }
    .wizard-step-circle { width: 28px; height: 28px; font-size: 12px; }
}
