/* ============================================================
   ROOT VARIABLES — тёмная финансовая тема
   ============================================================ */
   :root {
    --bg-primary: #0B0E14;
    --bg-secondary: #131A24;
    --bg-card: #1A2332;
    --bg-input: #0F1620;
    --accent-gold: #D4A853;
    --accent-cyan: #00D4FF;
    --accent-gold-dim: rgba(212, 168, 83, 0.15);
    --accent-cyan-dim: rgba(0, 212, 255, 0.10);
    --text-primary: #F0F4F8;
    --text-secondary: #8899AA;
    --text-muted: #5A6A7A;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(0, 212, 255, 0.15);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.6);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    overflow-x: hidden;
    position: relative;
}

/* ============================================================
   ФОНОВЫЕ СИМВОЛЫ — парящие экономические иконки
   ============================================================ */
.econ-bg-symbols {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    opacity: 0.07;
}

.econ-bg-symbols span {
    position: absolute;
    font-size: 4rem;
    animation: floatSymbol 25s infinite linear;
    color: var(--accent-cyan);
}

.econ-bg-symbols span:nth-child(1) { top: 8%; left: 5%; animation-delay: 0s; font-size: 5rem; }
.econ-bg-symbols span:nth-child(2) { top: 20%; right: 8%; animation-delay: -3s; font-size: 3.5rem; }
.econ-bg-symbols span:nth-child(3) { bottom: 25%; left: 3%; animation-delay: -7s; font-size: 4.5rem; }
.econ-bg-symbols span:nth-child(4) { top: 55%; right: 4%; animation-delay: -11s; font-size: 3rem; }
.econ-bg-symbols span:nth-child(5) { bottom: 10%; right: 20%; animation-delay: -5s; font-size: 4rem; }
.econ-bg-symbols span:nth-child(6) { top: 40%; left: 12%; animation-delay: -9s; font-size: 3.2rem; }
.econ-bg-symbols span:nth-child(7) { bottom: 40%; right: 15%; animation-delay: -2s; font-size: 3.8rem; }
.econ-bg-symbols span:nth-child(8) { top: 10%; left: 40%; animation-delay: -13s; font-size: 2.8rem; }
.econ-bg-symbols span:nth-child(9) { bottom: 5%; left: 50%; animation-delay: -6s; font-size: 5.5rem; }
.econ-bg-symbols span:nth-child(10) { top: 70%; left: 30%; animation-delay: -4s; font-size: 3rem; }

@keyframes floatSymbol {
    0%   { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 0.4; }
    25%  { transform: translate(30px, -40px) rotate(5deg) scale(1.1); opacity: 0.8; }
    50%  { transform: translate(-20px, 20px) rotate(-3deg) scale(0.9); opacity: 0.5; }
    75%  { transform: translate(40px, 30px) rotate(4deg) scale(1.05); opacity: 0.7; }
    100% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 0.4; }
}

/* ============================================================
   ОСНОВНОЙ КОНТЕЙНЕР — стеклянный эффект
   ============================================================ */
.page-container {
    position: relative;
    z-index: 1;
    max-width: 820px;
    width: 100%;
    background: rgba(19, 26, 36, 0.75);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    padding: 40px 44px 48px;
    box-shadow: var(--shadow-card), 0 0 60px rgba(0, 212, 255, 0.04);
    transition: box-shadow var(--transition);
}

.page-container:hover {
    box-shadow: var(--shadow-card), 0 0 80px rgba(0, 212, 255, 0.08);
}

/* ============================================================
   ШАПКА
   ============================================================ */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--accent-gold), #F5D98E);
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(212, 168, 83, 0.25);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.logo-text span {
    color: var(--accent-gold);
}

.version-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    background: var(--accent-cyan-dim);
    color: var(--accent-cyan);
    padding: 6px 16px;
    border-radius: 100px;
    border: 1px solid rgba(0, 212, 255, 0.15);
    backdrop-filter: blur(4px);
}

/* ============================================================
   ГЕРОЙ
   ============================================================ */
.hero {
    margin-bottom: 32px;
    text-align: center;
}

.hero h1 {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #FFFFFF 40%, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero h1 em {
    font-style: normal;
    background: linear-gradient(135deg, var(--accent-gold), #F5D98E);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    margin-top: 10px;
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ============================================================
   ПРИВЕТСТВИЕ БОТА
   ============================================================ */
.bot-greeting {
    display: flex;
    gap: 18px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 32px;
    border: 1px solid var(--border-subtle);
    transition: border-color var(--transition), box-shadow var(--transition);
    align-items: flex-start;
}

.bot-greeting:hover {
    border-color: rgba(0, 212, 255, 0.12);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.04);
}

.bot-avatar {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--accent-gold);
    box-shadow: 0 0 20px rgba(212, 168, 83, 0.15);
}

.bot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bot-message {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    padding-top: 2px;
}

.bot-message strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================================
   ФОРМА ВВОДА
   ============================================================ */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.3px;
}

.label-icon {
    font-size: 1.1rem;
}

.input-group textarea {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    padding: 14px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    resize: vertical;
    transition: border-color var(--transition), box-shadow var(--transition);
    line-height: 1.6;
    min-height: 56px;
}

.input-group textarea:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.08), 0 0 30px rgba(0, 212, 255, 0.03);
}

.input-group textarea::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.input-group textarea#text-input {
    min-height: 100px;
}

/* ============================================================
   КНОПКА ОТПРАВКИ
   ============================================================ */
.submit-wrap {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

.btn-submit {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 16px 44px;
    background: linear-gradient(135deg, var(--accent-gold), #C99A4A);
    color: #0B0E14;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition);
    box-shadow: 0 4px 24px rgba(212, 168, 83, 0.25);
    letter-spacing: 0.3px;
}

.btn-submit:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 40px rgba(212, 168, 83, 0.35);
}

.btn-submit:active {
    transform: scale(0.97);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-submit .arrow {
    display: inline-block;
    transition: transform var(--transition);
}

.btn-submit:hover .arrow {
    transform: translateX(6px);
}

/* ============================================================
   ЭКРАН ЗАГРУЗКИ
   ============================================================ */
#loadingScreen {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(11, 14, 20, 0.88);
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    justify-content: center;
    align-items: center;
    animation: fadeInLoading 0.5s ease;
}

@keyframes fadeInLoading {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.loading-box {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 48px 56px 52px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-card), 0 0 60px rgba(0, 212, 255, 0.04);
    animation: pulseBox 2.5s infinite ease-in-out;
}

@keyframes pulseBox {
    0%, 100% { box-shadow: var(--shadow-card), 0 0 40px rgba(0, 212, 255, 0.03); }
    50%      { box-shadow: var(--shadow-card), 0 0 70px rgba(0, 212, 255, 0.08); }
}

.loading-avatar {
    font-size: 4.5rem;
    margin-bottom: 16px;
    display: block;
    animation: floatBot 2.5s infinite ease-in-out;
}

@keyframes floatBot {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}

.loading-box h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.loading-box h2 #dots {
    display: inline-block;
    min-width: 28px;
    text-align: left;
}

.loading-box #loadingText {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
    min-height: 28px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   АДАПТИВНОСТЬ
   ============================================================ */
@media (max-width: 640px) {
    body { padding: 16px; }

    .page-container {
        padding: 24px 18px 32px;
        border-radius: var(--radius-md);
    }

    .logo-text { font-size: 1.2rem; }
    .logo-icon { width: 40px; height: 40px; font-size: 1.5rem; }

    .hero h1 {
        font-size: 1.6rem;
    }
    .hero p {
        font-size: 0.9rem;
    }

    .bot-greeting {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 18px 16px;
    }
    .bot-avatar {
        width: 48px;
        height: 48px;
    }
    .bot-message {
        font-size: 0.9rem;
    }

    .btn-submit {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
        font-size: 0.95rem;
    }
    .submit-wrap {
        justify-content: stretch;
    }

    .loading-box {
        padding: 32px 24px 36px;
        margin: 0 16px;
    }
    .loading-box h2 { font-size: 1.2rem; }

    .econ-bg-symbols span { font-size: 2.5rem !important; }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .page-container { padding: 32px 32px 40px; }
    .hero h1 { font-size: 2rem; }
}