:root {
    --bg-dark: #0a0a0a;
    --bg-panel: #141414;
    --border-color: #2a2a2a;
    
    --text-main: #e0e0e0;
    --text-muted: #888888;
    
    --accent: #d4ff00; /* Toxic/Industrial Yellow-Green */
    --accent-hover: #b3d900;
    --error: #ff4444;
    --warning: #ffaa00;
    
    --font-ui: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    font-family: var(--font-ui);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scanline effect */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0),
        rgba(255,255,255,0) 50%,
        rgba(0,0,0,0.1) 50%,
        rgba(0,0,0,0.1)
    );
    background-size: 100% 4px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.3;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-dark);
    font-family: var(--font-mono);
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blink {
    animation: blinker 1s linear infinite;
}
@keyframes blinker { 50% { opacity: 0; } }

.nav-status {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
}

/* Hero */
.hero {
    display: flex;
    padding: 6rem 5% 4rem;
    max-width: 1400px;
    margin: 0 auto;
    gap: 4rem;
    align-items: center;
    min-height: 75vh;
}

.hero-content { flex: 1; }

.tech-badge {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    display: inline-block;
    margin-bottom: 1.5rem;
    background: var(--bg-panel);
}

.hero h1 {
    font-size: clamp(2.5rem, 4vw, 4rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 600px;
}

.hero-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.stat-box {
    border: 1px solid var(--border-color);
    background: var(--bg-panel);
    padding: 1.5rem;
    min-width: 180px;
    flex: 1;
}

.stat-box.accent {
    border-color: var(--accent);
    background: rgba(212, 255, 0, 0.05);
}

.stat-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.stat-box.accent .stat-value { color: var(--accent); }
.stat-label { font-size: 0.85rem; color: var(--text-muted); }

.btn-terminal {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--text-main);
    color: var(--bg-dark);
    padding: 1rem 2rem;
    font-family: var(--font-mono);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-terminal:hover { background: var(--accent); }

/* Dashboard Graphic */
.hero-graphic {
    flex: 1;
    display: flex;
    justify-content: center;
    width: 100%;
}

.factory-dashboard {
    width: 100%;
    max-width: 500px;
    background: #000;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.dash-header {
    background: var(--bg-panel);
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.dash-controls { display: flex; gap: 6px; }
.dash-controls i { width: 10px; height: 10px; border-radius: 50%; background: #333; }

.dash-body {
    padding: 1.5rem;
    line-height: 1.5;
    overflow-x: auto;
}

.code-line.indent { padding-left: 1.5rem; }
.c-blue { color: #569cd6; }
.c-green { color: #ce9178; }
.c-yellow { color: var(--accent); }

.highlight-line {
    background: rgba(212, 255, 0, 0.1);
    border-left: 3px solid var(--accent);
    padding-left: 10px;
    margin-top: 10px;
    display: inline-block;
    color: var(--accent);
}

/* LIVE METRICS DASHBOARD */
.live-metrics {
    padding: 0 0 6rem 0;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.metric-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 2px;
    background: var(--border-color);
}
.active-nodes-card::after { background: var(--accent); }

.metric-header {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Gauge (Tachometer) */
.gauge-container {
    position: relative;
    width: 100%;
    max-width: 180px;
    margin: 0 auto;
    text-align: center;
}

.gauge {
    width: 100%;
    overflow: visible;
}

.gauge-bg { stroke: #222; }
.gauge-value {
    stroke: var(--accent);
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-text {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.metric-footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

/* Active Nodes Display */
.nodes-display {
    text-align: center;
    margin-bottom: 1.5rem;
}

.nodes-count {
    font-family: var(--font-mono);
    font-size: 4rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 20px rgba(212, 255, 0, 0.3);
    line-height: 1;
    display: block;
    transition: all 0.3s;
}

.nodes-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

/* Mini Bar Chart */
.mini-chart {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    height: 40px;
}

.chart-bar {
    width: 12px;
    background: var(--border-color);
    border-radius: 2px 2px 0 0;
    transition: height 0.2s ease, background 0.2s;
}
.chart-bar.active { background: var(--accent); }

/* Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
}

.led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.led-green { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.led-yellow { background: var(--warning); box-shadow: 0 0 8px var(--warning); }
.led-red { background: var(--error); box-shadow: 0 0 8px var(--error); }


/* Sections Common */
section {
    padding: 6rem 0;
    border-top: 1px solid var(--border-color);
}

.section-title { margin-bottom: 4rem; }
.section-title h2 { font-size: 2.5rem; margin-bottom: 1rem; }
.section-title p { color: var(--text-muted); font-family: var(--font-mono); }

/* Process */
.process-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.step {
    border-left: 2px solid var(--border-color);
    padding-left: 1.5rem;
    position: relative;
}

.step::before {
    content: '';
    position: absolute;
    left: -6px; top: 0; width: 10px; height: 10px;
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
}

.step:hover { border-color: var(--accent); }
.step:hover::before { border-color: var(--accent); background: var(--accent); }

.step-num {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.step h3 { font-size: 1.2rem; margin-bottom: 1rem; }
.step p { color: var(--text-muted); font-size: 0.95rem; }

/* Specs */
.specs {
    background: var(--bg-panel);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}

.spec-item h4 {
    font-family: var(--font-mono);
    color: var(--text-main);
    margin-bottom: 1rem;
}
.spec-item p { color: var(--text-muted); font-size: 0.9rem; }

/* Terminal Order Form */
.terminal-wrapper {
    background: #000;
    border: 1px solid var(--accent);
    max-width: 800px;
    margin: 0 auto;
    font-family: var(--font-mono);
}

.terminal-header {
    background: var(--accent);
    color: #000;
    padding: 0.5rem 1rem;
    font-weight: 700;
}

.terminal-body { padding: 2rem; }
.system-msg { color: var(--text-muted); margin-bottom: 2rem; }

.form-row {
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.form-row label { color: var(--accent); min-width: 150px; }

.form-row input, .form-row select {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 1rem;
    padding: 0.5rem 0;
}

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

.btn-execute {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 1rem 2rem;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    margin-top: 2rem;
    transition: all 0.2s;
}

.btn-execute:hover {
    background: var(--accent);
    color: #000;
}

/* Footer */
footer { padding: 2rem 0; background: var(--bg-panel); border-top: 1px solid var(--border-color); }
.footer-flex {
    display: flex; justify-content: space-between; align-items: center;
    font-family: var(--font-mono); font-size: 0.85rem;
}
.footer-links { display: flex; gap: 2rem; color: var(--text-muted); }

/* Mobile Responsiveness */
@media (max-width: 992px) {
    .hero { flex-direction: column; padding-top: 4rem; }
    .hero-graphic { margin-top: 2rem; }
    .hero h1 { font-size: 2.2rem; }
}

@media (max-width: 768px) {
    .metrics-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
    .metric-card { padding: 1rem; }
    .metric-header { font-size: 0.75rem; margin-bottom: 1rem; }
    .nodes-count { font-size: 2rem; }
    .nodes-label { font-size: 0.65rem; }
    .gauge-text { font-size: 1rem; }
    .metric-footer { font-size: 0.65rem; }
    .server-status-list li { font-size: 0.75rem; }
    
    .form-row { flex-direction: column; align-items: flex-start; }
    .form-row input, .form-row select { width: 100%; font-size: 0.9rem; padding: 0.8rem; }
    
    .hero h1 { font-size: 1.8rem; }
    .subtitle { font-size: 0.95rem; margin-bottom: 2rem; }
    .btn-terminal { padding: 0.8rem 1.5rem; font-size: 0.9rem; }
    
    /* Fix giant stats fonts since they are side by side */
    .hero-stats { gap: 0.3rem; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.5rem; }
    .stat-box { flex: 1 1 0; min-width: 0; padding: 0.5rem; text-align: center; }
    .stat-value { font-size: 0.9rem; margin-bottom: 0.2rem; }
    .stat-label { font-size: 0.55rem; line-height: 1.1; display: block; word-break: break-word; }
    
    /* Footer */
    .footer-flex { flex-direction: column; gap: 1rem; text-align: center; align-items: center !important; }
    .footer-links { flex-direction: column; align-items: center !important; gap: 0.5rem !important; }
}

/* WIZARD SECTION */
.wizard-section {
    padding: 4rem 0 8rem 0;
    background: radial-gradient(circle at top, rgba(212, 255, 0, 0.03) 0%, var(--bg-dark) 70%);
}

.wizard-container {
    max-width: 700px;
    margin: 0 auto;
}

/* Progress Bar */
.wizard-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    position: relative;
}

.progress-line {
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--border-color);
    z-index: 1;
}

.progress-line-fill {
    height: 100%;
    width: 0%; /* 0, 50, 100 */
    background: var(--accent);
    transition: width 0.4s ease;
}

.progress-step {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--text-muted);
    transition: color 0.3s;
    width: 33%;
}

.progress-step span {
    display: block;
    margin-top: 0.8rem;
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

.step-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.progress-step.active { color: var(--accent); }
.progress-step.active .step-icon {
    background: rgba(212, 255, 0, 0.1);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(212, 255, 0, 0.2);
}
.progress-step.completed { color: var(--text-main); }
.progress-step.completed .step-icon {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
}

/* Wizard Cards */
.wizard-cards-wrapper {
    position: relative;
    min-height: 450px; /* Запас по высоте, чтобы не прыгало */
}

.wizard-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    
    /* Скрыто по умолчанию */
    position: absolute;
    top: 0; left: 0; width: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateX(50px);
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.wizard-card.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    position: relative;
}

.wizard-card.exit-left {
    transform: translateX(-50px);
    opacity: 0;
}

.wizard-card h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}
.card-desc {
    color: var(--text-muted);
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* Modern Form Elements */
.modern-form .input-group {
    margin-bottom: 1.5rem;
}

.modern-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
}

.modern-form input[type="text"],
.modern-form input[type="email"],
.modern-form input[type="tel"] {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    padding: 1rem 1.2rem;
    border-radius: 8px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
}

.modern-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 255, 0, 0.1);
}

/* Radio Cards (Step 1) */
.radio-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.radio-card { cursor: pointer; }
.radio-card input { display: none; }
.rc-content {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    background: rgba(0,0,0,0.2);
    transition: all 0.2s;
}
.rc-content i { font-size: 2rem; color: var(--text-muted); margin-bottom: 1rem; display: block; }
.rc-title { font-weight: 600; margin-bottom: 0.3rem; }
.rc-desc { font-size: 0.8rem; color: var(--text-muted); }

.radio-card input:checked + .rc-content {
    border-color: var(--accent);
    background: rgba(212, 255, 0, 0.05);
}
.radio-card input:checked + .rc-content i { color: var(--accent); }

/* Domain Selector (Step 2) */
.domain-selector {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.domain-option { cursor: pointer; }
.domain-option input { display: none; }
.do-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(0,0,0,0.2);
    transition: all 0.2s;
}
.do-header { font-weight: 600; }
.do-price { font-family: var(--font-mono); color: var(--text-muted); }

.domain-option input:checked + .do-box {
    border-color: var(--accent);
    background: rgba(212, 255, 0, 0.05);
}
.domain-option input:checked + .do-box .do-price { color: var(--accent); }

/* Domain Search Bar */
.search-bar { display: flex; gap: 0.5rem; }
.btn-check {
    background: var(--border-color);
    color: var(--text-main);
    border: none;
    padding: 0 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-check:hover { background: #333; }
.btn-check.loading { background: var(--accent); color: #000; }

.domain-status-box {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    display: none; /* JS управляет */
}
.domain-status-box.success {
    display: block;
    background: rgba(212, 255, 0, 0.1);
    border: 1px solid var(--accent);
}
.domain-status-box.error {
    display: block;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid var(--error);
}

/* Receipt (Step 3) */
.receipt-box {
    background: #000;
    border: 1px dashed #444;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.receipt-header {
    font-family: var(--font-mono);
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    text-align: center;
    letter-spacing: 2px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid #222;
}
.rr-title { font-weight: 500; }
.rr-sub { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.3rem; }
.rr-right { font-family: var(--font-mono); font-weight: 600; }

.receipt-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    padding-top: 0.5rem;
}
.receipt-total div:last-child { font-family: var(--font-mono); }


/* Buttons */
.card-actions {
    margin-top: 3rem;
    display: flex;
}
.card-actions.right { justify-content: flex-end; }
.card-actions.split { justify-content: space-between; }

.btn-primary {
    background: var(--text-main);
    color: var(--bg-dark);
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}
.btn-primary:hover { background: var(--accent); transform: translateY(-2px); }

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-ghost:hover { color: var(--text-main); }

.btn-success {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 5px 20px rgba(212, 255, 0, 0.2);
}
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(212, 255, 0, 0.4); }

@media (max-width: 768px) {
    .wizard-card { padding: 1.2rem 0.8rem; }
    .wizard-card h2 { font-size: 1.3rem; }
    .card-desc { font-size: 0.85rem; margin-bottom: 1.5rem; padding-bottom: 1rem; }
    
    .modern-form label { font-size: 0.8rem; }
    .modern-form input[type="text"],
    .modern-form input[type="email"],
    .modern-form input[type="tel"],
    .modern-form textarea { padding: 0.7rem 0.8rem; font-size: 0.85rem; }
    
    /* Keep radio cards side by side with small text */
    .radio-cards { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
    .rc-content { padding: 0.8rem 0.4rem; }
    .rc-content i { font-size: 1.2rem; margin-bottom: 0.3rem; }
    .rc-title { font-size: 0.75rem; font-weight: 700; line-height: 1.2; }
    .rc-desc { font-size: 0.65rem; line-height: 1.2; }
    
    /* Progress steps */
    .progress-step span { font-size: 0.6rem; margin-top: 0.4rem; white-space: nowrap; }
    .step-icon { width: 26px; height: 26px; font-size: 0.85rem; }
    .progress-line { top: 13px; left: 5%; right: 5%; }
    
    /* Receipts */
    .receipt-box { padding: 1rem; }
    .receipt-header { font-size: 0.8rem; margin-bottom: 1rem; }
    .receipt-row { display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.8rem; padding-bottom: 0.8rem; }
    .rr-title { font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .rr-right { font-size: 0.8rem; white-space: nowrap; }
    .receipt-total { font-size: 1rem; flex-direction: row; flex-wrap: nowrap; }
    
    /* Buttons */
    .card-actions { margin-top: 1.5rem; flex-direction: column; gap: 0.8rem; }
    .card-actions.split { flex-direction: column-reverse; }
    .btn-primary, .btn-ghost, .btn-success { width: 100%; justify-content: center; padding: 0.8rem; font-size: 0.9rem; }
}

/* RTL Support */
[dir="rtl"] i.ri-arrow-right-line,
[dir="rtl"] i.ri-arrow-left-line {
    display: inline-block;
    transform: scaleX(-1);
}

