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

:root {
    --bg-primary: #0b0f17;
    --bg-secondary: #121824;
    --glass-bg: rgba(18, 24, 36, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f0f6fc;
    --text-muted: #8b949e;
    --primary-gradient: linear-gradient(135deg, #a371f7 0%, #ff7e5f 100%);
    --accent-glow: rgba(163, 113, 247, 0.3);
    --success-color: #2ea043;
    --btn-hover: linear-gradient(135deg, #b589f8 0%, #ff957a 100%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(163, 113, 247, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(255, 126, 95, 0.15) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

header {
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    z-index: 10;
}

.logo-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #ff7e5f;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.admin-link:hover {
    color: var(--text-main);
}

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.funnel-container {
    width: 100%;
    max-width: 780px;
}

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 50px;
    backdrop-filter: blur(20px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.step-wrapper {
    display: none;
    animation: fadeIn 0.5s ease forwards;
}

.step-wrapper.active {
    display: block;
}

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

.title-main {
    font-family: 'Outfit', sans-serif;
    font-size: 42px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.title-accent {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 18px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 40px;
}

.input-group {
    margin-bottom: 24px;
    text-align: left;
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #cbd5e1;
}

.form-input {
    width: 100%;
    padding: 18px 24px;
    background: rgba(9, 13, 20, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    color: var(--text-main);
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: #a371f7;
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.form-input::placeholder {
    color: #475569;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 20px 32px;
    background: var(--primary-gradient);
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 10px 25px var(--accent-glow);
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary:hover {
    background: var(--btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(255, 126, 95, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Стили загрузки / калькуляции */
.loading-box {
    text-align: center;
    padding: 40px 0;
}

.spinner {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(255,255,255,0.1);
    border-left-color: #ff7e5f;
    border-top-color: #a371f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.loading-sub {
    color: var(--text-muted);
    font-size: 16px;
}

/* Стили дашборда прогноза */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.metric-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 28px;
    text-align: left;
    transition: transform 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(163, 113, 247, 0.4);
}

.metric-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-family: 'Outfit', sans-serif;
    font-size: 36px;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-card.highlight .metric-value {
    background: linear-gradient(135deg, #38ef7d 0%, #11998e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.table-keywords {
    width: 100%;
    border-collapse: collapse;
    margin-top: 30px;
    margin-bottom: 40px;
    text-align: left;
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    overflow: hidden;
}

.table-keywords th, .table-keywords td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.table-keywords th {
    font-family: 'Outfit', sans-serif;
    color: #a371f7;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

.table-keywords tr:last-child td {
    border-bottom: none;
}

.cta-box {
    background: linear-gradient(135deg, rgba(163, 113, 247, 0.15) 0%, rgba(255, 126, 95, 0.15) 100%);
    border: 1px solid rgba(255, 126, 95, 0.3);
    border-radius: 20px;
    padding: 36px;
    text-align: center;
}

.cta-box h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    margin-bottom: 12px;
}

.cta-box p {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 15px;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .glass-card {
        padding: 30px 20px;
    }
    .title-main {
        font-size: 32px;
    }
}
