/**
 * FlushStream — tema claro, firme, bordas retas
 */

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

:root {
    --primary: #1A3A6D;
    --primary-light: #234a8a;
    --primary-dark: #142d52;
    --accent: #9D174D;
    --accent-light: #be185d;

    --success: #0f766e;
    --warning: #b45309;
    --danger: #b91c1c;
    --info: #1d4ed8;

    --white: #FFFFFF;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #64748b;
    --gray-500: #475569;
    --gray-600: #334155;
    --gray-700: #1e293b;
    --gray-800: #0f172a;
    --gray-900: #020617;

    --bg-body: #FFFFFF;
    --bg-card: #f8fafc;
    --bg-card-border: rgba(26, 58, 109, 0.14);
    --bg-card-hover: #f1f5f9;
    --bg-input: #ffffff;
    --bg-dark: var(--primary-dark);

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.1);
    --shadow-xl: 0 16px 40px rgba(15, 23, 42, 0.12);
    --shadow-glow: none;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;

    --radius-sm: 0;
    --radius-md: 0;
    --radius-lg: 0;
    --radius-xl: 0;

    --font-body: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Roboto', var(--font-body);
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    color: var(--gray-800);
    background: var(--bg-body) !important;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ===== LAYOUT ===== */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    padding-bottom: 80px;
    z-index: 1;
}

/* ===== HEADER ===== */
.header {
    background: #ffffff;
    padding: var(--space-4) var(--space-5);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--bg-card-border);
    box-shadow: none;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.header-back {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-700);
    opacity: 0.9;
    transition: all 0.2s;
    font-size: 20px;
    border-radius: var(--radius-md);
}

.header-back:hover { opacity: 1; background: var(--bg-card); }

.header-title {
    flex: 1;
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    color: var(--white);
    text-align: center;
    letter-spacing: -0.01em;
}

.header-action {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-700);
    opacity: 0.9;
    transition: all 0.2s;
    font-size: 18px;
    border-radius: var(--radius-md);
}

.header-action:hover { opacity: 1; background: var(--bg-card); }
.header-spacer { width: 38px; }

/* ===== BALANCE CARD ===== */
.balance-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin: calc(-1 * var(--space-6)) var(--space-5) var(--space-5);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 10;
}

.balance-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
    margin-bottom: var(--space-1);
}

.balance-value {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-5);
}

.balance-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s;
    white-space: nowrap;
    position: relative;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 0 20px rgba(26,58,109,0.25);
}

.btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 0 30px rgba(26,58,109,0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--gray-700);
    border: 1px solid var(--bg-card-border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255,255,255,0.15);
}

.btn-accent {
    background: var(--accent);
    color: var(--white);
    box-shadow: 0 0 20px rgba(0,191,165,0.25);
}

.btn-accent:hover {
    background: var(--accent-light);
}

.btn-outline {
    background: transparent;
    color: var(--primary-light);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow-glow);
}

.btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: 15px;
}

.btn-block { width: 100%; }

.btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* ===== CONTENT ===== */
.content {
    padding: var(--space-5);
}

.content-flush {
    padding: 0 var(--space-5) var(--space-5);
}

/* ===== SECTION ===== */
.section {
    margin-bottom: var(--space-6);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.section-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.01em;
}

.section-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-light);
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--bg-card-border);
    overflow: hidden;
    transition: all 0.25s;
}

.card:hover {
    border-color: rgba(255,255,255,0.12);
}

.card-body {
    padding: var(--space-5);
}

.card-header {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--bg-card-border);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
    color: var(--white);
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.stats-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.stats-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.stat-item {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    text-align: center;
    border: 1px solid var(--bg-card-border);
    transition: all 0.25s;
}

.stat-item:hover {
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto var(--space-3);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.primary { background: rgba(26,58,109,0.2); color: var(--primary-light); }
.stat-icon.accent { background: rgba(0,191,165,0.2); color: var(--accent-light); }
.stat-icon.success { background: rgba(16,185,129,0.2); color: var(--success); }
.stat-icon.info { background: rgba(59,130,246,0.2); color: var(--info); }

.stat-value {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: var(--white);
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-500);
    margin-top: var(--space-1);
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-2);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    transition: all 0.25s;
}

.quick-action:hover {
    border-color: rgba(26,58,109,0.3);
    background: rgba(26,58,109,0.05);
    transform: translateY(-2px);
}

.quick-action-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 0 12px rgba(26,58,109,0.3);
}

.quick-action-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-align: center;
}

/* ===== MENU LIST ===== */
.menu-list {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bg-card-border);
    overflow: hidden;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--bg-card-border);
    transition: background 0.2s;
}

.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: var(--bg-card-hover); }

.menu-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--gray-600);
    flex-shrink: 0;
}

.menu-icon.primary { background: rgba(26,58,109,0.15); color: var(--primary-light); }
.menu-icon.accent { background: rgba(0,191,165,0.15); color: var(--accent-light); }
.menu-icon.success { background: rgba(16,185,129,0.15); color: var(--success); }

.menu-content { flex: 1; min-width: 0; }

.menu-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
}

.menu-desc {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 2px;
}

.menu-arrow {
    color: var(--gray-400);
    font-size: 16px;
}

.menu-badge {
    padding: 4px 10px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 700;
    background: var(--primary);
    color: var(--white);
}

/* ===== PRODUCT CARDS ===== */
.product-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.product-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bg-card-border);
    overflow: hidden;
    transition: all 0.25s;
}

.product-card:hover {
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: rgba(26,58,109,0.2);
    transform: translateY(-2px);
}

.product-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: var(--space-5);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-name {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--white);
}

.product-price {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    color: #FFD700;
}

.product-body { padding: var(--space-4); }

.product-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.product-stat {
    text-align: center;
    padding: var(--space-3);
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-card-border);
}

.product-stat-value {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-light);
}

.product-stat-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-top: 2px;
}

/* ===== FORMS ===== */
.form-group { margin-bottom: var(--space-5); }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: var(--space-2);
}

.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-input);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    font-size: 15px;
    color: var(--white);
    transition: all 0.25s;
}

.form-input::placeholder { color: var(--gray-400); }

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,58,109,0.15), var(--shadow-glow);
    background: rgba(255,255,255,0.1);
}

.form-input-lg {
    padding: var(--space-4) var(--space-5);
    font-size: 16px;
}

.form-hint {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: var(--space-2);
}

/* ===== VALUE GRID ===== */
.value-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.value-option {
    padding: var(--space-3) var(--space-2);
    text-align: center;
    background: var(--bg-card);
    border: 2px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.25s;
}

.value-option:hover {
    border-color: rgba(26,58,109,0.4);
    background: rgba(26,58,109,0.05);
}

.value-option.active,
.value-option.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow-glow);
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 700;
}

.badge-success { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-info { background: rgba(59,130,246,0.15); color: var(--info); }
.badge-primary { background: rgba(26,58,109,0.15); color: var(--primary-light); }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: var(--space-10) var(--space-5);
}

.empty-icon {
    font-size: 48px;
    color: var(--gray-400);
    margin-bottom: var(--space-4);
}

.empty-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: var(--space-2);
}

.empty-text {
    font-size: 14px;
    color: var(--gray-500);
}

/* ===== TABBAR ===== */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    z-index: 1000;
    background: rgba(13,13,13,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--bg-card-border);
    padding: var(--space-2) 0 calc(var(--space-2) + env(safe-area-inset-bottom));
}

.tabbar-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--space-2) var(--space-4);
    color: var(--gray-400);
    transition: color 0.2s;
}

.tab-item i { font-size: 22px; }

.tab-item span {
    font-size: 10px;
    font-weight: 600;
}

.tab-item:hover,
.tab-item.active {
    color: var(--primary-light);
}

.tab-main { margin-top: -20px; }

.tab-main-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 24px;
    box-shadow: 0 4px 20px rgba(26,58,109,0.4);
    transition: all 0.25s;
}

.tab-main-btn:hover {
    background: var(--primary-light);
    transform: scale(1.08);
    box-shadow: 0 6px 30px rgba(26,58,109,0.5);
}

/* ===== PROFILE ===== */
.profile-header {
    background: linear-gradient(135deg, rgba(26,58,109,0.15) 0%, rgba(0,191,165,0.08) 100%);
    border-bottom: 1px solid var(--bg-card-border);
    padding: var(--space-6) var(--space-5);
    text-align: center;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto var(--space-4);
    border-radius: 50%;
    background: rgba(26,58,109,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-light);
    border: 2px solid rgba(26,58,109,0.3);
}

.profile-name {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: var(--space-1);
}

.profile-info {
    font-size: 13px;
    color: var(--gray-500);
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    background: rgba(26,58,109,0.2);
    border: 1px solid rgba(26,58,109,0.3);
    border-radius: 2px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-light);
    margin-top: var(--space-3);
}

/* ===== PLAN DISABLED ===== */
.plan-disabled { opacity: 0.5; }

.plan-btn-disabled {
    background: rgba(255,255,255,0.1) !important;
    cursor: not-allowed;
    opacity: 0.6;
    color: var(--gray-500) !important;
}

.plan-btn-disabled:hover {
    background: rgba(255,255,255,0.1) !important;
    transform: none;
}

/* ===== UTILITIES ===== */
.text-primary { color: var(--primary-light) !important; }
.text-accent { color: var(--accent-light) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--gray-500) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(26,58,109,0.2); }
    50% { box-shadow: 0 0 30px rgba(26,58,109,0.4); }
}

.animate-in { animation: fadeIn 0.3s ease forwards; }
.animate-up { animation: fadeInUp 0.4s ease forwards; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-glow { animation: glowPulse 2s ease-in-out infinite; }

/* ===== RESPONSIVE ===== */
@media (max-width: 360px) {
    .balance-value { font-size: 28px; }
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

/* ===== FLUSHSTREAM — overrides finais (cantos retos + legibilidade) ===== */
.app-container .card,
.product-card,
.stat-card,
.quick-action,
.balance-card,
.member-list,
.empty-state,
.copy-card,
.commission-card,
input, select, textarea, button, .btn {
    border-radius: 0 !important;
}

.page-header {
    background: linear-gradient(90deg, #1A3A6D 0%, #142d52 100%) !important;
    color: #fff !important;
    border-bottom: none !important;
}
.page-header a,
.page-header-title {
    color: #fff !important;
}

/* Tabbar incluída via tabbar.php usa classes próprias — tema claro */
.tabbar {
    background: #ffffff !important;
    border-top: 2px solid var(--bg-card-border) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
.tab-item {
    color: var(--gray-500) !important;
}
.tab-item.active {
    color: var(--primary) !important;
    border-top-color: var(--primary) !important;
    background: var(--gray-50) !important;
}
.tab-deposit {
    background: var(--primary) !important;
    color: #fff !important;
    border-radius: 0 !important;
}
.tab-deposit:hover {
    background: var(--primary-dark) !important;
}

/* Dashboard legacy classes (index.php) — tema claro */
.cvs-header {
    background: #ffffff !important;
    border-bottom: 1px solid rgba(26, 58, 109, 0.14) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
.cvs-brand-text,
.cvs-header .cvs-user-name {
    color: #0f172a !important;
}
.cvs-balance-card,
.cvs-wallet-card {
    background: #f8fafc !important;
    border: 1px solid rgba(26, 58, 109, 0.12) !important;
    color: #0f172a !important;
}
