/**
 * McKinsey-Grade Platform Design System
 * WhenBRRR Enterprise - Global Styles
 * 
 * This extends mckinsey-dashboard.css with platform-wide components:
 * - Forms & Inputs
 * - Cards & Containers
 * - Tables
 * - Buttons & CTAs
 * - Pricing Components
 * - Auth Pages
 * - Settings Panels
 */

/* ============================================================================
   DESIGN TOKENS - Platform Extension
   ============================================================================ */

:root {
    /* Brand Gradient */
    --gradient-brand: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --gradient-brand-hover: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    --gradient-dark: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    
    /* Shadows - Elevation System */
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.1), 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-elevated: 0 10px 40px rgba(0, 0, 0, 0.12);
    --shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Timing */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ============================================================================
   PAGE LAYOUT - Consistent Structure
   ============================================================================ */

.mckinsey-page {
    min-height: 100vh;
    background: var(--bg-secondary, #f8fafc);
}

.mckinsey-page__hero {
    background: var(--gradient-dark);
    color: white;
    padding: 80px 24px 60px;
    text-align: center;
}

.mckinsey-page__hero h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.mckinsey-page__hero p {
    font-size: 20px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.mckinsey-page__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px;
}

/* ============================================================================
   FORM SYSTEM - Enterprise-Grade Inputs
   ============================================================================ */

.mckinsey-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mckinsey-form__group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mckinsey-form__label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    letter-spacing: 0.01em;
}

.mckinsey-form__input,
.mckinsey-form__select,
.mckinsey-form__textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-primary, #1e293b);
    background: white;
    border: 2px solid var(--border-light, #e2e8f0);
    border-radius: 10px;
    transition: all var(--transition-base);
    outline: none;
}

.mckinsey-form__input:hover,
.mckinsey-form__select:hover,
.mckinsey-form__textarea:hover {
    border-color: var(--border-medium, #cbd5e1);
}

.mckinsey-form__input:focus,
.mckinsey-form__select:focus,
.mckinsey-form__textarea:focus {
    border-color: var(--blue-500, #3b82f6);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.mckinsey-form__input::placeholder {
    color: var(--text-muted, #94a3b8);
}

.mckinsey-form__hint {
    font-size: 13px;
    color: var(--text-muted, #94a3b8);
    margin-top: 4px;
}

.mckinsey-form__input--error {
    border-color: var(--red-500, #ef4444);
}

.mckinsey-form__error {
    font-size: 13px;
    color: var(--red-500, #ef4444);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================================================================
   BUTTON SYSTEM - Hierarchy & Variants
   ============================================================================ */

.mckinsey-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
}

.mckinsey-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Primary - Main CTA */
.mckinsey-btn--primary {
    background: var(--gradient-brand);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.mckinsey-btn--primary:hover:not(:disabled) {
    background: var(--gradient-brand-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Secondary - Supporting actions */
.mckinsey-btn--secondary {
    background: white;
    color: var(--text-primary, #1e293b);
    border: 2px solid var(--border-light, #e2e8f0);
}

.mckinsey-btn--secondary:hover:not(:disabled) {
    border-color: var(--border-medium, #cbd5e1);
    background: var(--bg-secondary, #f8fafc);
}

/* Ghost - Minimal emphasis */
.mckinsey-btn--ghost {
    background: transparent;
    color: var(--text-secondary, #64748b);
}

.mckinsey-btn--ghost:hover:not(:disabled) {
    background: var(--bg-secondary, #f8fafc);
    color: var(--text-primary, #1e293b);
}

/* Success - Positive actions */
.mckinsey-btn--success {
    background: var(--gradient-success);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.mckinsey-btn--success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Sizes */
.mckinsey-btn--sm {
    padding: 10px 16px;
    font-size: 13px;
}

.mckinsey-btn--lg {
    padding: 18px 32px;
    font-size: 17px;
}

.mckinsey-btn--full {
    width: 100%;
}

/* ============================================================================
   CARD SYSTEM - Universal Cards
   ============================================================================ */

.mckinsey-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-base);
}

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

.mckinsey-card--elevated {
    box-shadow: var(--shadow-elevated);
}

.mckinsey-card--interactive:hover {
    transform: translateY(-4px);
}

.mckinsey-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.mckinsey-card__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    display: flex;
    align-items: center;
    gap: 12px;
}

.mckinsey-card__icon {
    font-size: 24px;
}

.mckinsey-card__badge {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 100px;
    background: var(--bg-secondary, #f1f5f9);
    color: var(--text-secondary, #64748b);
}

.mckinsey-card__badge--success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--green-600, #059669);
}

.mckinsey-card__badge--warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--amber-600, #d97706);
}

.mckinsey-card__content {
    color: var(--text-secondary, #64748b);
    line-height: 1.6;
}

.mckinsey-card__footer {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* ============================================================================
   PRICING CARDS - Tier Display
   ============================================================================ */

.mckinsey-pricing {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    padding: 48px 0;
}

.mckinsey-pricing-card {
    background: white;
    border-radius: 20px;
    padding: 40px 32px;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-slow);
    position: relative;
    display: flex;
    flex-direction: column;
}

.mckinsey-pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-elevated);
}

.mckinsey-pricing-card--featured {
    border: 3px solid var(--blue-500, #3b82f6);
    transform: scale(1.02);
}

.mckinsey-pricing-card--featured:hover {
    transform: scale(1.02) translateY(-8px);
}

.mckinsey-pricing-card__badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-brand);
    color: white;
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mckinsey-pricing-card__tier {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin-bottom: 8px;
}

.mckinsey-pricing-card__description {
    font-size: 14px;
    color: var(--text-secondary, #64748b);
    margin-bottom: 24px;
    min-height: 40px;
}

.mckinsey-pricing-card__price {
    margin-bottom: 8px;
}

.mckinsey-pricing-card__amount {
    font-size: 56px;
    font-weight: 800;
    color: var(--blue-600, #2563eb);
    line-height: 1;
}

.mckinsey-pricing-card__period {
    font-size: 16px;
    color: var(--text-muted, #94a3b8);
    font-weight: 400;
}

.mckinsey-pricing-card__billing {
    font-size: 14px;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 32px;
}

.mckinsey-pricing-card__features {
    list-style: none;
    padding: 0;
    margin: 0 0 32px 0;
    flex: 1;
}

.mckinsey-pricing-card__feature {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light, #f1f5f9);
    font-size: 14px;
    color: var(--text-primary, #1e293b);
}

.mckinsey-pricing-card__feature:last-child {
    border-bottom: none;
}

.mckinsey-pricing-card__check {
    width: 20px;
    height: 20px;
    background: var(--green-500, #10b981);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.mckinsey-pricing-card__cta {
    margin-top: auto;
}

/* ============================================================================
   AUTH PAGES - Login/Signup
   ============================================================================ */

.mckinsey-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-dark);
    padding: 24px;
}

.mckinsey-auth__card {
    background: white;
    border-radius: 24px;
    padding: 48px;
    box-shadow: var(--shadow-modal);
    max-width: 480px;
    width: 100%;
}

.mckinsey-auth__header {
    text-align: center;
    margin-bottom: 32px;
}

.mckinsey-auth__logo {
    font-size: 56px;
    margin-bottom: 16px;
}

.mckinsey-auth__title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary, #1e293b);
    margin-bottom: 8px;
}

.mckinsey-auth__subtitle {
    font-size: 15px;
    color: var(--text-secondary, #64748b);
}

.mckinsey-auth__divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-muted, #94a3b8);
    font-size: 13px;
}

.mckinsey-auth__divider::before,
.mckinsey-auth__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light, #e2e8f0);
}

.mckinsey-auth__oauth {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.mckinsey-auth__oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    border: 2px solid var(--border-light, #e2e8f0);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    background: white;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.mckinsey-auth__oauth-btn:hover {
    border-color: var(--border-medium, #cbd5e1);
    box-shadow: var(--shadow-card);
    transform: translateY(-2px);
}

.mckinsey-auth__oauth-btn img,
.mckinsey-auth__oauth-btn svg {
    width: 24px;
    height: 24px;
}

.mckinsey-auth__oauth-btn--github {
    background: #24292e;
    border-color: #24292e;
    color: white;
}

.mckinsey-auth__oauth-btn--github:hover {
    background: #1b1f23;
    border-color: #1b1f23;
}

.mckinsey-auth__footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary, #64748b);
}

.mckinsey-auth__footer a {
    color: var(--blue-600, #2563eb);
    font-weight: 600;
    text-decoration: none;
}

.mckinsey-auth__footer a:hover {
    text-decoration: underline;
}

/* ============================================================================
   SETTINGS PANELS
   ============================================================================ */

.mckinsey-settings {
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: 800px;
}

.mckinsey-settings__section {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow-card);
}

.mckinsey-settings__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.mckinsey-settings__icon {
    font-size: 24px;
}

.mckinsey-settings__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
}

.mckinsey-settings__fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Toggle Switch */
.mckinsey-toggle {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    padding: 16px;
    border-radius: 12px;
    transition: background var(--transition-base);
}

.mckinsey-toggle:hover {
    background: var(--bg-secondary, #f8fafc);
}

.mckinsey-toggle__switch {
    position: relative;
    width: 48px;
    height: 28px;
    background: var(--border-medium, #cbd5e1);
    border-radius: 14px;
    transition: background var(--transition-base);
    flex-shrink: 0;
}

.mckinsey-toggle__switch::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition-base);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mckinsey-toggle input {
    display: none;
}

.mckinsey-toggle input:checked + .mckinsey-toggle__switch {
    background: var(--blue-500, #3b82f6);
}

.mckinsey-toggle input:checked + .mckinsey-toggle__switch::after {
    transform: translateX(20px);
}

.mckinsey-toggle__content {
    flex: 1;
}

.mckinsey-toggle__label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    margin-bottom: 4px;
}

.mckinsey-toggle__description {
    font-size: 13px;
    color: var(--text-secondary, #64748b);
}

/* ============================================================================
   INTEGRATION CARDS
   ============================================================================ */

.mckinsey-integrations {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.mckinsey-integration {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all var(--transition-base);
}

.mckinsey-integration:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.mckinsey-integration__header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mckinsey-integration__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--bg-secondary, #f1f5f9);
}

.mckinsey-integration__name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
}

.mckinsey-integration__status {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mckinsey-integration__status--connected {
    color: var(--green-600, #059669);
}

.mckinsey-integration__status--disconnected {
    color: var(--text-muted, #94a3b8);
}

.mckinsey-integration__description {
    font-size: 14px;
    color: var(--text-secondary, #64748b);
    line-height: 1.5;
}

.mckinsey-integration__actions {
    margin-top: auto;
    display: flex;
    gap: 12px;
}

/* ============================================================================
   DATA TABLES
   ============================================================================ */

.mckinsey-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.mckinsey-table th {
    text-align: left;
    padding: 16px;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    border-bottom: 2px solid var(--border-light, #e2e8f0);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mckinsey-table td {
    padding: 16px;
    color: var(--text-primary, #1e293b);
    border-bottom: 1px solid var(--border-light, #f1f5f9);
}

.mckinsey-table tbody tr {
    transition: background var(--transition-fast);
}

.mckinsey-table tbody tr:hover {
    background: var(--bg-secondary, #f8fafc);
}

/* ============================================================================
   STATUS INDICATORS
   ============================================================================ */

.mckinsey-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

.mckinsey-status__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mckinsey-status--success .mckinsey-status__dot { background: var(--green-500, #10b981); }
.mckinsey-status--warning .mckinsey-status__dot { background: var(--amber-500, #f59e0b); }
.mckinsey-status--error .mckinsey-status__dot { background: var(--red-500, #ef4444); }
.mckinsey-status--info .mckinsey-status__dot { background: var(--blue-500, #3b82f6); }

.mckinsey-status--success { color: var(--green-600, #059669); }
.mckinsey-status--warning { color: var(--amber-600, #d97706); }
.mckinsey-status--error { color: var(--red-600, #dc2626); }
.mckinsey-status--info { color: var(--blue-600, #2563eb); }

/* ============================================================================
   ALERTS & BANNERS
   ============================================================================ */

.mckinsey-alert {
    padding: 16px 20px;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.mckinsey-alert__icon {
    font-size: 20px;
    flex-shrink: 0;
}

.mckinsey-alert__content {
    flex: 1;
}

.mckinsey-alert__title {
    font-weight: 600;
    margin-bottom: 4px;
}

.mckinsey-alert--info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--blue-700, #1d4ed8);
}

.mckinsey-alert--success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--green-700, #047857);
}

.mckinsey-alert--warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--amber-700, #b45309);
}

.mckinsey-alert--error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--red-700, #b91c1c);
}

/* ============================================================================
   EMPTY STATES
   ============================================================================ */

.mckinsey-empty {
    text-align: center;
    padding: 64px 24px;
}

.mckinsey-empty__icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.5;
}

.mckinsey-empty__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin-bottom: 8px;
}

.mckinsey-empty__description {
    font-size: 15px;
    color: var(--text-secondary, #64748b);
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 768px) {
    .mckinsey-page__hero {
        padding: 60px 20px 40px;
    }
    
    .mckinsey-page__hero h1 {
        font-size: 32px;
    }
    
    .mckinsey-page__hero p {
        font-size: 16px;
    }
    
    .mckinsey-page__container {
        padding: 24px 16px;
    }
    
    .mckinsey-card {
        padding: 24px;
        border-radius: 12px;
    }
    
    .mckinsey-pricing-card {
        padding: 32px 24px;
    }
    
    .mckinsey-pricing-card__amount {
        font-size: 40px;
    }
    
    .mckinsey-auth__card {
        padding: 32px 24px;
        border-radius: 16px;
    }
    
    .mckinsey-settings__section {
        padding: 24px;
    }
    
    .mckinsey-btn--lg {
        padding: 14px 24px;
        font-size: 15px;
    }
}

/* ============================================================================
   DARK MODE SUPPORT
   ============================================================================ */

[data-theme="dark"] .mckinsey-card,
[data-theme="dark"] .mckinsey-pricing-card,
[data-theme="dark"] .mckinsey-auth__card,
[data-theme="dark"] .mckinsey-settings__section,
[data-theme="dark"] .mckinsey-integration {
    background: var(--bg-primary-dark, #1e293b);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .mckinsey-form__input,
[data-theme="dark"] .mckinsey-form__select,
[data-theme="dark"] .mckinsey-form__textarea {
    background: var(--bg-secondary-dark, #0f172a);
    border-color: var(--border-dark, #334155);
    color: var(--text-primary-dark, #f1f5f9);
}

[data-theme="dark"] .mckinsey-btn--secondary {
    background: var(--bg-secondary-dark, #0f172a);
    border-color: var(--border-dark, #334155);
    color: var(--text-primary-dark, #f1f5f9);
}

[data-theme="dark"] .mckinsey-table th,
[data-theme="dark"] .mckinsey-table td {
    border-color: var(--border-dark, #334155);
}

[data-theme="dark"] .mckinsey-table tbody tr:hover {
    background: var(--bg-secondary-dark, #0f172a);
}

[data-theme="dark"] .mckinsey-toggle:hover {
    background: var(--bg-secondary-dark, #0f172a);
}

[data-theme="dark"] .mckinsey-auth__oauth-btn {
    background: var(--bg-secondary-dark, #0f172a);
    border-color: var(--border-dark, #334155);
    color: var(--text-primary-dark, #f1f5f9);
}
