:root {
    --primary: #00f2ff; --primary-hover: #33f5ff; --secondary: #7000ff;
    --accent: #ff007f; --bg: #0a0b0d; --surface: rgba(255, 255, 255, 0.04);
    --surface-hover: rgba(255, 255, 255, 0.07); --surface-border: rgba(255, 255, 255, 0.08);
    --text: #ffffff; --text-muted: #8e95a5; --danger: #ff3366;
}

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

body {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    padding: 24px 16px 48px;
}

.ambient-glow-1 {
    position: fixed; top: -150px; left: 20%; width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(112, 0, 255, 0.25), transparent 70%);
    filter: blur(100px); z-index: 0; pointer-events: none;
}
.ambient-glow-2 {
    position: fixed; bottom: -150px; right: 15%; width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(0, 242, 255, 0.18), transparent 70%);
    filter: blur(110px); z-index: 0; pointer-events: none;
}

.container {
    width: 100%; max-width: 640px; position: relative; z-index: 1;
    display: flex; flex-direction: column; gap: 24px;
}

.top-nav { display: flex; align-items: center; justify-content: space-between; }
.back-link {
    color: var(--primary); text-decoration: none; font-size: 0.95rem; font-weight: 600;
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px;
    border-radius: 8px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--surface-border);
    transition: all 0.2s;
}
.back-link:hover { background: rgba(0, 242, 255, 0.1); border-color: var(--primary); transform: translateX(-3px); }

.tag-badge {
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--accent); background: rgba(255, 0, 127, 0.12); border: 1px solid rgba(255, 0, 127, 0.3);
    padding: 4px 10px; border-radius: 20px;
}

.app-header { text-align: center; margin-bottom: 4px; }
.app-header h1 {
    font-size: clamp(2.4rem, 6vw, 3.2rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1;
    background: linear-gradient(135deg, #ffffff 40%, var(--primary) 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 25px rgba(0, 242, 255, 0.25));
}
.app-header p { color: var(--text-muted); font-size: 1.05rem; margin-top: 8px; }

.glass-card {
    background: var(--surface); border: 1px solid var(--surface-border); border-radius: 24px;
    padding: 28px 24px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4); display: flex; flex-direction: column; gap: 22px;
}
.glass-card:focus-within { border-color: rgba(0, 242, 255, 0.3); }

.form-row { display: flex; flex-direction: column; gap: 8px; }
.form-row label {
    font-size: 0.9rem; font-weight: 600; color: #e2e8f0;
    display: flex; align-items: center; justify-content: space-between;
}
.label-hint { font-size: 0.8rem; color: var(--text-muted); font-weight: 400; }

.input-stepper { display: grid; grid-template-columns: 52px 1fr 52px; gap: 8px; }
.step-btn {
    background: rgba(255, 255, 255, 0.06); border: 1px solid var(--surface-border);
    color: white; font-size: 1.4rem; font-weight: 600; border-radius: 14px;
    cursor: pointer; transition: all 0.15s ease; display: flex; align-items: center; justify-content: center;
}
.step-btn:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.25); }
.step-btn:active { transform: scale(0.95); }

.custom-input {
    background: rgba(0, 0, 0, 0.35); border: 1px solid var(--surface-border);
    padding: 14px 16px; border-radius: 14px; color: #ffffff; font-size: 1.15rem;
    font-weight: 600; font-family: inherit; text-align: center; outline: none; transition: all 0.2s; width: 100%;
}
.custom-input:focus { border-color: var(--primary); box-shadow: 0 0 16px rgba(0, 242, 255, 0.25); background: rgba(0, 0, 0, 0.5); }

.salary-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.pill-btn {
    background: rgba(255, 255, 255, 0.04); border: 1px solid var(--surface-border);
    color: var(--text-muted); font-size: 0.82rem; font-weight: 600; padding: 8px 4px;
    border-radius: 10px; cursor: pointer; transition: all 0.2s; text-align: center;
}
.pill-btn:hover, .pill-btn.active { background: rgba(0, 242, 255, 0.12); border-color: var(--primary); color: #ffffff; }

.toggle-row {
    display: flex; align-items: center; justify-content: space-between; padding: 12px 14px;
    background: rgba(255, 255, 255, 0.02); border: 1px solid var(--surface-border);
    border-radius: 14px; cursor: pointer;
}
.toggle-info { display: flex; flex-direction: column; gap: 2px; }
.toggle-info span { font-size: 0.9rem; font-weight: 600; }
.toggle-info small { font-size: 0.78rem; color: var(--text-muted); }

.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.15); transition: .3s; border-radius: 34px;
}
.slider:before {
    position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px;
    background-color: white; transition: .3s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--primary); box-shadow: 0 0 10px rgba(0, 242, 255, 0.5); }
input:checked + .slider:before { transform: translateX(20px); background-color: #0a0b0d; }

.burn-preview {
    display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
    border-radius: 12px; background: rgba(112, 0, 255, 0.08); border: 1px dashed rgba(112, 0, 255, 0.35);
    font-size: 0.88rem; color: #cbd5e1;
}
.burn-preview strong { color: var(--primary); font-size: 1.05rem; }

.btn-primary-action {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #ffffff; border: none; border-radius: 16px; padding: 18px 24px; font-size: 1.25rem;
    font-weight: 800; letter-spacing: 0.02em; cursor: pointer; display: flex; align-items: center;
    justify-content: center; gap: 10px; transition: all 0.25s ease; box-shadow: 0 8px 25px rgba(0, 242, 255, 0.25);
}
.btn-primary-action:hover { transform: translateY(-3px); box-shadow: 0 12px 35px rgba(0, 242, 255, 0.4); filter: brightness(1.1); }
.btn-primary-action:active { transform: translateY(0); }

/* LIVE DASHBOARD */
.live-dashboard { display: flex; flex-direction: column; gap: 20px; }
.taxameter-box {
    background: radial-gradient(ellipse at top, rgba(0, 242, 255, 0.08), rgba(0, 0, 0, 0.5));
    border: 1px solid rgba(0, 242, 255, 0.25); border-radius: 24px; padding: 36px 20px;
    text-align: center; position: relative; overflow: hidden; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.taxameter-label { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; color: var(--primary); margin-bottom: 8px; }
.cost-odometer {
    font-size: clamp(2.8rem, 9vw, 4.4rem); font-weight: 800; line-height: 1; letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums; color: #ffffff; text-shadow: 0 0 25px rgba(0, 242, 255, 0.4);
}
.cost-odometer .currency { font-size: 0.55em; font-weight: 600; color: var(--primary); margin-left: 6px; }

.time-ticker {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 6px 16px;
    border-radius: 20px; background: rgba(255, 255, 255, 0.05); font-size: 1.15rem; font-weight: 700;
    font-variant-numeric: tabular-nums; color: #f1f5f9;
}
.pulse-dot {
    width: 10px; height: 10px; border-radius: 50%; background: var(--danger);
    box-shadow: 0 0 8px var(--danger); animation: livePulse 1.4s ease-in-out infinite;
}
@keyframes livePulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.4); opacity: 0.5; } }

.live-metrics-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.metric-card {
    background: var(--surface); border: 1px solid var(--surface-border); border-radius: 16px;
    padding: 16px; display: flex; flex-direction: column; gap: 4px;
}
.metric-card .title { font-size: 0.8rem; color: var(--text-muted); }
.metric-card .val { font-size: 1.25rem; font-weight: 700; color: #ffffff; }

.live-teaser {
    background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(0, 242, 255, 0.2);
    border-radius: 16px; padding: 14px 18px; display: flex; align-items: center; gap: 12px;
    font-size: 0.95rem; color: #e2e8f0; min-height: 58px; transition: all 0.3s ease;
}
.live-teaser .teaser-icon { font-size: 1.6rem; flex-shrink: 0; }
.live-teaser strong { color: var(--primary); font-weight: 700; }

.controls-row { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; margin-top: 6px; }
.btn-secondary-action {
    background: rgba(255, 255, 255, 0.06); border: 1px solid var(--surface-border);
    color: #ffffff; border-radius: 16px; padding: 16px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.btn-secondary-action:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.25); }

.btn-stop-action {
    background: linear-gradient(135deg, var(--danger) 0%, #b3003b 100%); border: none; color: white;
    border-radius: 16px; padding: 16px; font-size: 1.15rem; font-weight: 800; cursor: pointer;
    transition: all 0.2s; box-shadow: 0 6px 20px rgba(255, 51, 102, 0.3);
}
.btn-stop-action:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(255, 51, 102, 0.45); filter: brightness(1.1); }

/* MODAL */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); display: flex;
    align-items: center; justify-content: center; z-index: 1000; padding: 20px;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.summary-modal {
    background: #111319; border: 1px solid rgba(0, 242, 255, 0.35); border-radius: 28px;
    width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto; padding: 32px 28px;
    display: flex; flex-direction: column; gap: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    transform: scale(0.92); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.active .summary-modal { transform: scale(1); }

.modal-header { text-align: center; }
.modal-header .emoji-banner { font-size: 3rem; margin-bottom: 6px; display: block; }
.modal-header h2 { font-size: 1.8rem; font-weight: 800; color: #ffffff; }

.modal-final-cost {
    text-align: center; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--surface-border);
    border-radius: 20px; padding: 18px;
}
.modal-final-cost .cost-num { font-size: 2.8rem; font-weight: 800; color: var(--primary); text-shadow: 0 0 20px rgba(0, 242, 255, 0.3); }
.modal-final-cost .cost-sub { font-size: 0.9rem; color: var(--text-muted); margin-top: 4px; }

.equivalents-list { display: flex; flex-direction: column; gap: 10px; }
.equivalents-title { font-size: 0.95rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #cbd5e1; }
.equivalent-card {
    background: rgba(255, 255, 255, 0.03); border: 1px solid var(--surface-border);
    border-radius: 14px; padding: 12px 16px; display: flex; align-items: center; gap: 14px;
    font-size: 0.95rem; color: #f1f5f9; line-height: 1.35;
}
.equivalent-card .eq-icon { font-size: 1.5rem; flex-shrink: 0; }

.modal-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.btn-copy {
    background: rgba(255, 255, 255, 0.08); border: 1px solid var(--surface-border);
    color: #ffffff; padding: 14px; border-radius: 14px; font-weight: 700; cursor: pointer;
    font-size: 0.95rem; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-copy:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.3); }

.btn-restart {
    background: var(--primary); color: #0a0b0d; border: none; padding: 14px;
    border-radius: 14px; font-weight: 800; cursor: pointer; font-size: 1rem; transition: all 0.2s;
}
.btn-restart:hover { background: var(--primary-hover); transform: translateY(-2px); }

.manual-section {
    margin-top: 10px; padding-top: 20px; border-top: 1px dashed var(--surface-border);
    display: flex; flex-direction: column; gap: 16px;
}
.manual-divider {
    text-align: center; position: relative; font-size: 0.72rem; font-weight: 700;
    letter-spacing: 0.1em; color: var(--text-muted);
}
.manual-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.btn-manual-action {
    background: linear-gradient(135deg, rgba(112, 0, 255, 0.25) 0%, rgba(0, 242, 255, 0.15) 100%);
    border: 1px solid rgba(0, 242, 255, 0.35);
    color: #ffffff;
    border-radius: 16px;
    padding: 16px 20px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(112, 0, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.btn-manual-action svg {
    color: var(--primary);
    transition: transform 0.25s ease;
}
.btn-manual-action:hover {
    background: linear-gradient(135deg, rgba(112, 0, 255, 0.45) 0%, rgba(0, 242, 255, 0.28) 100%);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 242, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-manual-action:hover svg {
    transform: scale(1.15) rotate(-5deg);
}
.btn-manual-action:active {
    transform: translateY(0);
}

.hidden { display: none !important; }

@media (max-width: 500px) {
    .controls-row, .salary-pills, .manual-grid { grid-template-columns: 1fr; }
}
