/* ========================= THEME & VARIABLES ========================= */
:root {
    --color-bg: #0a0d12;
    --color-surface: #0f1319;
    --color-surface-raised: #151a23;
    --color-surface-overlay: #1a2030;
    --color-border-subtle: #1e2433;
    --color-border-medium: #2a3040;
    --color-text-primary: #e8ecf4;
    --color-text-secondary: #8892a6;
    --color-text-muted: #5a6478;
    --color-accent: #6c8aff;
    --color-accent-dim: #4a6ae0;
    --color-accent-glow: rgba(108, 138, 255, 0.25);
    --color-gain: #34d399;
    --color-loss: #f87171;
    --color-warning: #fbbf24;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========================= TYPOGRAPHY ========================= */
h1, h2, h3 { font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.1rem; }

.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent); }
.text-gain { color: var(--color-gain); }
.text-loss { color: var(--color-loss); }
.text-mono { font-family: var(--font-mono); }
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }

/* ========================= LAYOUT ========================= */
.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 20px;
}

.screen {
    display: none;
    min-height: 100vh;
    padding: 40px 0;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.screen-scroll.active {
    display: block;
    justify-content: flex-start;
    align-items: stretch;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mt-xl { margin-top: 40px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }

/* ========================= LANG TOGGLE ========================= */
.lang-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100;
    display: flex;
    gap: 2px;
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.lang-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.lang-btn.active {
    background: var(--color-accent);
    color: #fff;
}

/* ========================= BUTTONS ========================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-xl);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dim) 100%);
    color: #fff;
    box-shadow: 0 8px 32px var(--color-accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 40px var(--color-accent-glow);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--color-surface-raised);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-medium);
}

.btn-secondary:hover {
    border-color: var(--color-accent);
    background: var(--color-surface-overlay);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
}

.btn-icon {
    padding: 10px;
    border-radius: var(--radius-md);
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border-subtle);
    color: var(--color-text-secondary);
    cursor: pointer;
}

/* ========================= HERO SCREEN ========================= */
.hero-animals {
    font-size: 2rem;
    margin-bottom: 32px;
    user-select: none;
    letter-spacing: 0.3em;
}

.hero-title {
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--color-text-primary) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    max-width: 480px;
    margin-bottom: 40px;
}

/* ========================= UPLOAD SCREEN ========================= */
.upload-card {
    width: 100%;
    max-width: 560px;
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border-subtle);
}

.tab {
    flex: 1;
    padding: 14px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans);
}

.tab.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    background: rgba(108, 138, 255, 0.05);
}

.tab-content {
    display: none;
    padding: 24px;
}

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

/* Drop zone */
.drop-zone {
    border: 2px dashed var(--color-border-medium);
    border-radius: var(--radius-md);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.drop-zone:hover {
    border-color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.02);
}

.drop-zone-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.drop-zone-formats {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 8px;
}

/* Textarea */
.textarea {
    width: 100%;
    min-height: 160px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s;
}

.textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

.textarea::placeholder {
    color: var(--color-text-muted);
}

/* ========================= CONFIRM TABLE ========================= */
.confirm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.confirm-table th {
    text-align: left;
    padding: 8px 12px;
    color: var(--color-text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--color-border-subtle);
}

.confirm-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border-subtle);
}

.confirm-table .ticker {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--color-accent);
}

.confirm-table .number {
    font-family: var(--font-mono);
    text-align: right;
}

/* ========================= COMPUTING SCREEN ========================= */
.computing-wrapper {
    text-align: center;
}

.loader-text {
    margin-top: 24px;
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    min-height: 2em;
}

/* ========================= RESULT CARD ========================= */
.result-wrapper {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

.archetype-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border-subtle);
}

.card-header {
    position: relative;
    padding: 24px;
    text-align: center;
    overflow: hidden;
}

.card-header-bg {
    position: absolute;
    inset: 0;
    opacity: 0.15;
    background: radial-gradient(circle at 50% 0%, var(--archetype-color, var(--color-accent)) 0%, transparent 70%);
}

.card-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    position: relative;
}

.card-group {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    position: relative;
}

.card-name {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 8px;
    position: relative;
}

.card-description {
    color: var(--color-text-secondary);
    font-size: 1rem;
    position: relative;
}

.card-confidence {
    position: absolute;
    top: 16px;
    right: 16px;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    opacity: 0.8;
}

.card-strengths-preview {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
    position: relative;
}

.strength-pill {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid;
    opacity: 0.8;
}

/* Gated content */
.card-body {
    position: relative;
}

.gated-content {
    padding: 24px;
}

.gate-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--color-surface-raised) 30%
    );
}

.gate-overlay.hidden {
    display: none;
}

/* ========================= LEAD FORM ========================= */
.lead-form-card {
    background: var(--color-surface-overlay);
    border: 1px solid var(--color-border-medium);
    border-radius: var(--radius-lg);
    padding: 28px;
    text-align: center;
    max-width: 360px;
    width: 100%;
}

.lead-form-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.lead-form-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.lead-form-subtitle {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 16px;
}

.input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.input::placeholder {
    color: var(--color-text-muted);
}

.input-error {
    border-color: var(--color-loss) !important;
}

.error-text {
    color: var(--color-loss);
    font-size: 0.75rem;
    margin-top: 4px;
    text-align: left;
}

.lead-disclaimer {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-top: 12px;
}

/* ========================= ANALYTICS SECTIONS ========================= */
.section {
    margin-top: 24px;
    padding: 20px;
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

/* Funny profile */
.funny-profile {
    font-size: 1.05rem;
    line-height: 1.7;
    font-style: italic;
    color: var(--color-text-secondary);
    padding: 16px;
    border-left: 3px solid var(--color-accent);
    background: rgba(108, 138, 255, 0.05);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Strengths & Weaknesses */
.sw-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.sw-list {
    list-style: none;
}

.sw-list li {
    padding: 6px 0;
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.sw-list li::before {
    flex-shrink: 0;
    margin-top: 2px;
}

.sw-list.strengths li::before {
    content: '+';
    color: var(--color-gain);
    font-weight: 700;
}

.sw-list.weaknesses li::before {
    content: '-';
    color: var(--color-loss);
    font-weight: 700;
}

/* Health score */
.health-grade {
    font-size: 3rem;
    font-weight: 800;
    font-family: var(--font-mono);
    text-align: center;
    margin-bottom: 16px;
}

.health-bar-wrapper {
    margin-bottom: 10px;
}

.health-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.health-bar {
    height: 6px;
    background: var(--color-border-subtle);
    border-radius: 3px;
    overflow: hidden;
}

.health-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease-out;
}

/* Comparison bars */
.comparison-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.comparison-label {
    width: 120px;
    flex-shrink: 0;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.comparison-bar-track {
    flex: 1;
    height: 24px;
    background: var(--color-border-subtle);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.comparison-bar-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: #fff;
    min-width: 40px;
    transition: width 0.8s ease-out;
}

.comparison-verdict {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-top: 8px;
    line-height: 1.5;
}

/* Analytics card items */
.analytics-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border-subtle);
}

.analytics-item:last-child {
    border-bottom: none;
}

.analytics-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.tag-danger { background: rgba(248, 113, 113, 0.15); color: var(--color-loss); }
.tag-warning { background: rgba(251, 191, 36, 0.15); color: var(--color-warning); }
.tag-success { background: rgba(52, 211, 153, 0.15); color: var(--color-gain); }

/* Famous person */
.famous-person {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.famous-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-surface-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.famous-name {
    font-weight: 700;
    margin-bottom: 4px;
}

.famous-note {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

/* ========================= SHARE & WAITLIST ========================= */
.share-banner {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, var(--color-surface-overlay) 0%, var(--color-surface-raised) 100%);
    border: 1px solid var(--color-border-medium);
    border-radius: var(--radius-lg);
    text-align: center;
}

.share-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.share-subtitle {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 16px;
}

.btn-telegram {
    background: #2AABEE;
    color: #fff;
}

.btn-telegram:hover {
    background: #229ED9;
}

/* ========================= BACK BUTTON ========================= */
.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

.back-btn:hover {
    color: var(--color-text-primary);
}

/* ========================= WARNINGS ========================= */
.warning-box {
    padding: 12px 16px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--color-warning);
    margin-top: 12px;
}

/* ========================= SECTOR PIE PLACEHOLDER ========================= */
.sector-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sector-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.sector-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sector-name {
    flex: 1;
}

.sector-weight {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--color-text-secondary);
}

/* ========================= MISSING ASSETS LIST ========================= */
.missing-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.missing-list li {
    padding: 10px 14px;
    background: rgba(108, 138, 255, 0.06);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.missing-list li::before {
    content: '+';
    color: var(--color-accent);
    font-weight: 700;
    flex-shrink: 0;
}

/* ========================= RESPONSIVE ========================= */
@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .sw-grid { grid-template-columns: 1fr; }
    .comparison-label { width: 80px; font-size: 0.7rem; }
    .card-confidence { font-size: 1.2rem; }
    .hero-animals { font-size: 1.5rem; }
    .section { padding: 16px; }
}
