:root {
  --bg-1: #0b0f1a;
  --bg-2: #111a2a;
  --accent: #6df3ff;
  --accent-2: #a778ff;
  --text: #e9f1ff;
  --muted: #b8c3d8;
  --card: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.1);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  --blur: blur(22px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Trebuchet MS", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    linear-gradient(145deg, rgba(11, 15, 26, 0.9), rgba(17, 26, 42, 0.9)),
    url("../images/background.webp") center/cover no-repeat fixed;
  overflow-x: hidden;
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.glow {
  position: absolute;
  width: 40vmax;
  height: 40vmax;
  filter: var(--blur);
  opacity: 0.5;
}

.glow-1 {
  background: radial-gradient(circle, rgba(109, 243, 255, 0.2), transparent 60%);
  top: -10vmax;
  left: -5vmax;
}

.glow-2 {
  background: radial-gradient(circle, rgba(167, 120, 255, 0.2), transparent 60%);
  bottom: -12vmax;
  right: -6vmax;
}

.grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  opacity: 0.6;
}

.shell {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 28px 48px;
  z-index: 1;
}

header .eyebrow {
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 8px;
}

header h1 {
  margin: 0;
  font-size: clamp(36px, 4vw, 48px);
  letter-spacing: 0.02em;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 12px;
  flex-wrap: wrap;
}

.header-row h1 {
  flex: 1;
}

.sound-controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: fit-content;
}

.volume-control[type=range] {
  width: 100%;
  min-width: 0;
}

.lede {
  margin: 0 0 20px;
  max-width: 640px;
  color: var(--muted);
  line-height: 1.5;
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

button {
  background: linear-gradient(120deg, rgba(109, 243, 255, 0.16), rgba(167, 120, 255, 0.2));
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
  box-shadow: var(--shadow);
}

button:hover {
  transform: translateY(-2px);
  border-color: var(--accent-2);
  box-shadow: 0 15px 40px rgba(109, 243, 255, 0.25);
}

.hint {
  color: var(--muted);
  font-size: 14px;
}

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
  display: block;
  padding: 18px 18px 20px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  text-decoration: none;
  color: var(--text);
  backdrop-filter: blur(8px);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(109, 243, 255, 0.6);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.35);
}

.card .tag {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.status .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06);
}

.status.online .dot {
  background: #7dffba;
  box-shadow: 0 0 0 4px rgba(125, 255, 186, 0.18);
}

.status.offline .dot {
  background: #ff8a8a;
  box-shadow: 0 0 0 4px rgba(255, 138, 138, 0.18);
}

.status .text {
  white-space: nowrap;
}

.card h2 {
  margin: 12px 0 6px;
  font-size: 22px;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.footer-reveal {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  transform: translateY(calc(100% - 18px));
  transition: transform 180ms ease;
  z-index: 8;
}

.footer-reveal-inner {
  width: min(520px, 100%);
  background: rgba(11, 15, 26, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  padding: 12px 16px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
}

.footer-reveal:hover,
.footer-reveal:focus-within,
body.footer-reveal-active .footer-reveal {
  transform: translateY(0);
}

.footer-reveal a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.2s;
}

.footer-reveal a:hover {
  border-bottom-color: var(--accent);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 18, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 150ms ease, visibility 150ms ease;
  z-index: 20;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  width: min(520px, 100%);
  background: rgba(11, 15, 26, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  padding: 24px;
  color: var(--text);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h2 {
  margin: 0;
  font-size: 22px;
}

.modal-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-body p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.5;
}

.modal-body strong {
  color: var(--text);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.modal-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease;
}

.modal-action:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .shell {
    padding: 48px 18px 32px;
  }
  .controls {
    flex-direction: column;
    align-items: flex-start;
  }
  text-align: center;
  }
}

/* --- Wizard Styles --- */
.wizard-container {
  background: rgba(10, 10, 10, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 40px;
  max-width: 900px;
  margin: 32px auto 0;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  position: relative;
}

.wizard-step {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

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

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

.step-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
}

.step-title {
  font-size: 2.2rem;
  color: #fff;
  margin: 0;
  background: linear-gradient(90deg, #fff, #b8c3d8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.step-content {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #d1d5db;
  margin-bottom: 2.5rem;
}

.step-indicator {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.progress-section {
  margin-bottom: 3rem;
}

.progress-bar-bg {
  background: rgba(255, 255, 255, 0.1);
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  background: var(--accent);
  height: 100%;
  width: 0%;
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
}

.wizard-container .btn {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wizard-container .btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.wizard-container .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.wizard-container .btn-primary {
  background: linear-gradient(135deg, rgba(109, 243, 255, 0.15), rgba(167, 120, 255, 0.15));
  border-color: var(--accent);
  color: var(--accent);
}

.wizard-container .btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(109, 243, 255, 0.25), rgba(167, 120, 255, 0.25));
  box-shadow: 0 0 20px rgba(109, 243, 255, 0.15);
}

.wizard-status {
  margin-top: 16px;
  min-height: 1.2em;
  color: var(--accent);
}

.wizard-step .form-section {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.wizard-step .form-section h3 {
  display: none;
}

/* --- Form Styles --- */
.form-container {
  max-width: 900px;
  margin: 32px auto 0;
  background: rgba(10, 10, 10, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 40px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.form-section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.form-section:last-child {
  border-bottom: none;
}

.form-section h3 {
  color: #fff;
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #fff, #b8c3d8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 500;
}

.form-group .hint {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.input-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, background 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.4);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Custom Range Slider */
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  margin-top: -8px;
  box-shadow: 0 0 10px rgba(109, 243, 255, 0.5);
}

input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.slider-group {
  display: grid;
  grid-template-columns: 1fr 80px;
  gap: 16px;
  align-items: center;
}

/* Action Bar */
.action-bar {
  position: sticky;
  bottom: 20px;
  background: rgba(11, 15, 26, 0.95);
  border: 1px solid var(--accent);
  padding: 16px 24px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  z-index: 10;
  backdrop-filter: blur(10px);
  margin-top: 40px;
}

.btn-primary {
  background: var(--accent);
  color: #0b0f1a;
  border: none;
  padding: 12px 24px;
  font-size: 1.1rem;
}

.btn-primary:hover {
  background: #9effff;
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(109, 243, 255, 0.4);
}

.preview-area {
  margin-top: 40px;
  background: rgba(0, 0, 0, 0.3);
  padding: 20px;
  border-radius: 8px;
  font-family: monospace;
  white-space: pre-wrap;
  color: #ddd;
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

/* Success Button State */
.btn-success {
  background: #7dffba !important;
  color: #0b0f1a !important;
  border-color: #7dffba !important;
  box-shadow: 0 0 15px rgba(125, 255, 186, 0.4) !important;
}
