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

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-input: rgba(30, 41, 59, 0.6);
  --border: rgba(99, 102, 241, 0.15);
  --border-hover: rgba(99, 102, 241, 0.35);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --teal: #12b1a1;
  --teal-glow: rgba(18, 177, 161, 0.2);
  --orange: #f59e0b;
  --pink: #ec4899;
  --green: #10b981;
  --red: #ef4444;
  --blue: #3b82f6;
  --purple: #a855f7;
  --cyan: #06b6d4;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,0.3);
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Background Effects ── */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 20%, rgba(18,177,161,0.04) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 80%, rgba(168,85,247,0.03) 0%, transparent 50%);
  z-index: -1;
  animation: bgShift 20s ease-in-out infinite alternate;
}
@keyframes bgShift {
  0% { transform: translate(0,0) scale(1); }
  100% { transform: translate(-2%,1%) scale(1.02); }
}

/* ── Header ── */
.header {
  text-align: center;
  padding: 48px 24px 32px;
  position: relative;
}
.header h1 {
  font-size: 2.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-light), var(--teal), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.header p {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
}
.header .badge {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 14px;
  background: var(--accent-glow);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--accent-light);
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* ── Layout ── */
.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px 64px;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; }
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}
.card-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* ── Input Groups ── */
.input-group {
  margin-bottom: 18px;
}
.input-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.input-group label .value-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-light);
  background: var(--accent-glow);
  padding: 2px 10px;
  border-radius: 12px;
  min-width: 60px;
  text-align: center;
}
.input-group input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-input);
  outline: none;
  cursor: pointer;
}
.input-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  box-shadow: 0 0 10px var(--accent-glow);
  cursor: pointer;
  transition: transform 0.15s;
}
.input-group input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.input-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}
.input-group select:focus {
  border-color: var(--accent);
}

/* ── Total Cost Display ── */
.total-cost {
  text-align: center;
  padding: 32px 24px;
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(18,177,161,0.08));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 28px;
}
.total-cost .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.total-cost .amount {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--teal), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}
.total-cost .per-user {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Cost Breakdown ── */
.breakdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.breakdown-item:last-child { border-bottom: none; }
.breakdown-item .left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.breakdown-item .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.breakdown-item .svc-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}
.breakdown-item .svc-detail {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.breakdown-item .cost {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
}
.breakdown-item .pct {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ── Cost Bar (mini chart) ── */
.cost-bar-container {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin: 20px 0 24px;
  background: var(--bg-input);
}
.cost-bar-segment {
  height: 100%;
  transition: width 0.5s ease;
  min-width: 2px;
}

/* ── Preset buttons ── */
.presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.preset-btn {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.preset-btn:hover, .preset-btn.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent-light);
}

/* ── Section Divider ── */
.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin: 20px 0 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* ── Footer Note ── */
.footer-note {
  text-align: center;
  padding: 24px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.card { animation: fadeIn 0.4s ease forwards; }
.grid > :nth-child(2) { animation-delay: 0.1s; }

/* ── Toggle Switch ── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 22px;
  transition: all 0.3s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
  background: rgba(244, 63, 94, 0.2);
  border-color: #f43f5e;
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: #f43f5e;
}
