/*
 * Elite B2B — Base CSS
 * Design tokens, reset e tipografia.
 */

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

/* ── Design Tokens ───────────────────────────────────────────────────────── */
:root {
    /* Cores */
    --b2b-primary:        #1a56db;
    --b2b-primary-dark:   #1342b0;
    --b2b-primary-light:  #e8f0fe;
    --b2b-secondary:      #0d9488;
    --b2b-secondary-dark: #0a7a71;
    --b2b-accent:         #f59e0b;
    --b2b-accent-dark:    #d97706;
    --b2b-danger:         #ef4444;
    --b2b-danger-dark:    #dc2626;
    --b2b-success:        #10b981;
    --b2b-success-dark:   #059669;
    --b2b-whatsapp:       #25d366;
    --b2b-purple:         #8b5cf6;
    --b2b-orange:         #f97316;

    /* Neutros */
    --b2b-bg:             #f1f5f9;
    --b2b-surface:        #ffffff;
    --b2b-surface-alt:    #f8fafc;
    --b2b-border:         #e2e8f0;
    --b2b-border-focus:   #1a56db;
    --b2b-text:           #1e293b;
    --b2b-text-muted:     #64748b;
    --b2b-text-light:     #94a3b8;

    /* Tipografia */
    --font-base:          'Inter', system-ui, -apple-system, sans-serif;
    --text-xs:            0.75rem;
    --text-sm:            0.875rem;
    --text-base:          1rem;
    --text-lg:            1.125rem;
    --text-xl:            1.25rem;
    --text-2xl:           1.5rem;
    --text-3xl:           1.875rem;

    /* Espaçamento */
    --space-1:  0.25rem;
    --space-2:  0.5rem;
    --space-3:  0.75rem;
    --space-4:  1rem;
    --space-5:  1.25rem;
    --space-6:  1.5rem;
    --space-8:  2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Bordas */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Sombras */
    --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md:  0 4px 12px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
    --shadow-lg:  0 10px 30px rgba(0,0,0,.1),  0 4px 12px rgba(0,0,0,.06);
    --shadow-xl:  0 20px 60px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.08);

    /* Transições */
    --transition-fast:   150ms ease;
    --transition-normal: 250ms ease;
}

/* ── Reset Escoped ────────────────────────────────────────────────────────── */
.b2b-app *,
.b2b-app *::before,
.b2b-app *::after,
.b2b-auth-wrap *,
.b2b-auth-wrap *::before,
.b2b-auth-wrap *::after {
    box-sizing: border-box;
}

.b2b-app,
.b2b-auth-wrap {
    font-family: var(--font-base);
    font-size: var(--text-base);
    color: var(--b2b-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Layout Principal ────────────────────────────────────────────────────── */
.b2b-app {
    max-width: 1280px;
    margin: 20px auto;
    background: var(--b2b-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.b2b-header {
    background: linear-gradient(135deg, var(--b2b-primary) 0%, var(--b2b-primary-dark) 100%);
    color: #fff;
    padding: var(--space-4) var(--space-8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
}

.b2b-header__brand {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.b2b-header__logo {
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.b2b-header__company {
    font-size: var(--text-sm);
    opacity: 0.85;
}

.b2b-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* ── Stats Bar ───────────────────────────────────────────────────────────── */
.b2b-statsbar {
    background: linear-gradient(90deg, #fef3c7, #fde68a);
    color: var(--b2b-text);
    padding: var(--space-3) var(--space-8);
    font-size: var(--text-sm);
    font-weight: 500;
    border-bottom: 2px solid var(--b2b-accent);
}

/* ── Navegação ───────────────────────────────────────────────────────────── */
.b2b-nav {
    background: var(--b2b-surface);
    padding: var(--space-2) var(--space-4);
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    border-bottom: 2px solid var(--b2b-border);
    scrollbar-width: none;
}

.b2b-nav::-webkit-scrollbar { display: none; }

.b2b-nav__tab {
    padding: var(--space-3) var(--space-5);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--b2b-text-muted);
    font-size: var(--text-sm);
    font-weight: 600;
    font-family: var(--font-base);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.b2b-nav__tab:hover {
    background: var(--b2b-primary-light);
    color: var(--b2b-primary);
}

.b2b-nav__tab--active {
    background: var(--b2b-primary) !important;
    color: #fff !important;
    border-color: var(--b2b-primary) !important;
}

/* ── Main Content ────────────────────────────────────────────────────────── */
.b2b-main {
    padding: var(--space-6) var(--space-8);
    min-height: 500px;
    background: var(--b2b-bg);
}

/* ── Tab Panes ───────────────────────────────────────────────────────────── */
.b2b-tab-pane {
    display: none;
    animation: b2b-fade-in var(--transition-normal);
}

.b2b-tab-pane--active {
    display: block;
}

@keyframes b2b-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Auth ────────────────────────────────────────────────────────────────── */
.b2b-auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--b2b-primary) 0%, var(--b2b-secondary) 100%);
    padding: var(--space-6);
}

.b2b-auth-card {
    background: var(--b2b-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-10);
    width: 100%;
    max-width: 480px;
}

.b2b-auth-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.b2b-auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
}

.b2b-auth-logo .b2b-logo-icon {
    font-size: 2rem;
}

.b2b-auth-logo .b2b-logo-text {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--b2b-primary);
    letter-spacing: -0.025em;
}

.b2b-auth-subtitle {
    color: var(--b2b-text-muted);
    font-size: var(--text-sm);
    margin: 0;
}

.b2b-auth-panel {
    display: none;
}

.b2b-auth-panel--active {
    display: block;
}

.b2b-auth-title {
    font-size: var(--text-xl);
    font-weight: 700;
    margin: 0 0 var(--space-6) 0;
    color: var(--b2b-text);
}

.b2b-auth-switch {
    text-align: center;
    margin-top: var(--space-5);
    font-size: var(--text-sm);
    color: var(--b2b-text-muted);
}

.b2b-auth-switch a {
    color: var(--b2b-primary);
    font-weight: 600;
    text-decoration: none;
}

.b2b-auth-switch a:hover {
    text-decoration: underline;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
.b2b-toast {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    pointer-events: none;
}

.b2b-toast__item {
    background: var(--b2b-text);
    color: #fff;
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: var(--text-sm);
    font-weight: 500;
    pointer-events: auto;
    animation: b2b-toast-in 300ms ease;
    max-width: 320px;
}

.b2b-toast__item--success { background: var(--b2b-success); }
.b2b-toast__item--error   { background: var(--b2b-danger);  }

@keyframes b2b-toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Loading ─────────────────────────────────────────────────────────────── */
.b2b-loading {
    text-align: center;
    padding: var(--space-10);
    color: var(--b2b-text-muted);
    font-size: var(--text-sm);
}

.b2b-empty {
    text-align: center;
    padding: var(--space-10);
    color: var(--b2b-text-muted);
    font-size: var(--text-sm);
    background: var(--b2b-surface-alt);
    border-radius: var(--radius-md);
    border: 2px dashed var(--b2b-border);
}

/* ── Seção title ─────────────────────────────────────────────────────────── */
.b2b-section-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--b2b-text);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--b2b-border);
}
