/* Base */
:root {
  --bg-start: #fff7f8;
  --bg-end: #f3f8ff;
  --primary: #b37ba4;
  --primary-600: #a06792;
  --text: #2a2a2a;
  --muted: #666;
  --card-bg: #ffffffdd;
  --ring: rgba(179, 123, 164, 0.25);
  /* Loader accent palette */
  --accent-1: var(--primary);
  --accent-2: #86a8ff; /* soft blue to match background */
  --accent-3: #ffc7d6; /* light rose */
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  color: var(--text);
  text-align: center;
  scroll-behavior: smooth;
  background: radial-gradient(
      1200px 600px at 10% 10%,
      #ffe9ef 0%,
      transparent 60%
    ),
    radial-gradient(1000px 500px at 90% 20%, #eef4ff 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-start) 0%, var(--bg-end) 100%);
  min-height: 100vh;
}

section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem 1rem;
}

h1 {
  color: var(--primary);
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  margin-bottom: 0.5rem;
}
h2 {
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 2rem;
}

.muted {
  color: var(--muted);
  margin: 0 0 1rem 0;
}

/* Buttons */
button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.9rem 1.4rem;
  border-radius: 999px;
  margin: 0.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 10px 20px rgba(179, 123, 164, 0.25);
}
button:hover {
  background: var(--primary-600);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(179, 123, 164, 0.3);
}
button:active {
  transform: translateY(0);
}

button.secondary {
  background: #e6e0e9;
  color: #493547;
  box-shadow: 0 10px 20px rgba(73, 53, 71, 0.08);
}
button.secondary:hover {
  background: #d7cfda;
}

/* Inputs */
input {
  padding: 1rem 1.25rem;
  width: min(420px, 90vw);
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  margin-bottom: 1rem;
  text-align: center;
  font-size: 1rem;
  outline: none;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}
input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

/* Intro */
#intro h1 {
  letter-spacing: 1px;
}
#intro button {
  margin-top: 1rem;
}

/* Card */
.card {
  background: var(--card-bg);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  padding: 2rem 1.5rem;
  width: min(680px, 92vw);
  box-shadow: 0 20px 60px rgba(20, 10, 30, 0.12);
}
.form-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

/* Status text */
#status {
  min-height: 1.25rem;
  margin-top: 0.75rem;
}

/* Loader overlay */
#loader {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.75);
  display: none; /* toggled via JS */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  text-align: center;
}
#loader .loader-contents {
  position: relative;
  margin-bottom: 0.75rem;
}
/* Flipping loader themed to --primary */
#loader .loader {
  width: 72px;
  aspect-ratio: 1;
  display: grid;
  grid: 50%/50%;
  /* Three differently colored squares */
  --_g1: no-repeat linear-gradient(var(--accent-1) 0 0);
  --_g2: no-repeat linear-gradient(var(--accent-2) 0 0);
  --_g3: no-repeat linear-gradient(var(--accent-3) 0 0);
  background: var(--_g1), var(--_g2), var(--_g3);
  background-size: 50.1% 50.1%;
  animation: l6-0 1.5s infinite steps(1) alternate, l6-0-0 3s infinite steps(1);
}
#loader .loader::before {
  content: "";
  /* Flip tile cycles through the palette */
  background: var(--accent-1);
  transform: perspective(150px) rotateY(0deg) rotateX(0deg);
  transform-origin: bottom right;
  animation: l6-1 1.5s infinite linear alternate, l6-color 3s infinite steps(1);
}
@keyframes l6-0 {
  0% {
    background-position: 0 100%, 100% 100%, 100% 0;
  }
  33% {
    background-position: 100% 100%, 100% 100%, 100% 0;
  }
  66% {
    background-position: 100% 0, 100% 0, 100% 0;
  }
}
@keyframes l6-0-0 {
  0% {
    transform: scaleX(1) rotate(0deg);
  }
  50% {
    transform: scaleX(-1) rotate(-90deg);
  }
}
@keyframes l6-1 {
  16.5% {
    transform: perspective(150px) rotateX(-90deg) rotateY(0deg) rotateX(0deg);
    filter: grayscale(0.1);
  }
  33% {
    transform: perspective(150px) rotateX(-180deg) rotateY(0deg) rotateX(0deg);
  }
  66% {
    transform: perspective(150px) rotateX(-180deg) rotateY(-180deg)
      rotateX(0deg);
  }
  100% {
    transform: perspective(150px) rotateX(-180deg) rotateY(-180deg)
      rotateX(-180deg);
    filter: grayscale(0.1);
  }
}
@keyframes l6-color {
  0% {
    background: var(--accent-1);
  }
  50% {
    background: var(--accent-2);
  }
  100% {
    background: var(--accent-3);
  }
}
#loader p {
  color: var(--muted);
  margin: 0;
}

/* Footer */
footer {
  padding: 1.25rem 1rem;
  color: var(--muted);
}

/* Floating language selector */
.lang-switcher {
  position: fixed;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--card-bg);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(20, 10, 30, 0.12);
  z-index: 1200;
}
.lang-switcher a {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  text-decoration: none;
  font-size: 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  color: inherit;
}
.lang-switcher a:hover,
.lang-switcher a:focus-visible {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 6px 18px rgba(20, 10, 30, 0.12);
}
.lang-switcher a.active {
  box-shadow: 0 0 0 2px var(--primary);
  background: rgba(179, 123, 164, 0.08);
}
.lang-switcher .sep {
  color: #b8b8b8;
  padding: 0 2px;
  user-select: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 1px, 1px);
  white-space: nowrap;
  border: 0;
}

/* Simple modal for confirmation */
#confirm-modal[hidden] {
  display: none;
}
#confirm-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  z-index: 1100;
  padding: 1rem;
}
#confirm-modal .confirm-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.25rem;
  width: min(520px, 92vw);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
}

/* Roadmap */
.roadmap-list {
  list-style: none;
  padding: 0;
  margin: 1rem auto 0;
  max-width: 720px;
  display: grid;
  gap: 1rem;
}
.roadmap-list .step {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: start;
  gap: 0.75rem;
  padding: 0.75rem 0.5rem;
  border-radius: 12px;
}
.roadmap-list .indicator {
  --size: 28px;
  width: var(--size);
  height: var(--size);
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #98a2b3;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}
.roadmap-list .indicator::before,
.roadmap-list .indicator::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
}
/* Dotted ring */
.roadmap-list .indicator::before {
  inset: 0;
  border: 2px dotted #cfd4dc;
}
/* Fill area for states */
.roadmap-list .indicator::after {
  background: transparent;
}
.roadmap-list .content .title {
  text-align: left;
}
.roadmap-list .badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.5rem;
  vertical-align: middle;
}
/* State: completed */
.roadmap-list .step.completed .indicator {
  color: #2f9e44;
}
.roadmap-list .step.completed .indicator::after {
  background: #2f9e4415;
}
.roadmap-list .step.completed .indicator::before {
  border-color: #2f9e44;
}
.roadmap-list .step.completed .indicator::after {
  content: "✓";
  display: grid;
  place-items: center;
  color: #2f9e44;
  font-weight: 700;
}

/* State: pending (working) */
.roadmap-list .step.pending .indicator {
  color: #b08900;
}
.roadmap-list .step.pending .indicator::before {
  border-color: #ffd666;
  animation: spin 2.5s linear infinite;
}
.roadmap-list .step.pending .indicator::after {
  background: #ffec9915;
}

/* State: todo */
.roadmap-list .step.todo .indicator {
  color: #98a2b3;
}
.roadmap-list .step.todo .indicator::before {
  border-color: #cfd4dc;
}
.roadmap-list .step.todo .indicator::after {
  background: transparent;
}

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

.roadmap-list .content {
  text-align: left;
}
.roadmap-list .hint {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.roadmap-list .step:hover .hint,
.roadmap-list .step:focus-within .hint,
.roadmap-list .step:focus .hint,
.roadmap-list .step:focus-visible .hint {
  opacity: 1;
  transform: translateY(0);
}
.roadmap-list .step:hover .indicator,
.roadmap-list .step:focus-within .indicator,
.roadmap-list .step:focus .indicator,
.roadmap-list .step:focus-visible .indicator {
  transform: scale(1.03);
}

/* Bring list item into focus on hover/tap */
.roadmap-list .step {
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.roadmap-list .step:is(:hover, :focus, :focus-visible, :focus-within) {
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 6px 18px rgba(20, 10, 30, 0.08),
    0 0 0 2px rgba(179, 123, 164, 0.15);
  transform: translateY(-1px);
}

/* Highlight the current (pending) item with a yellow dotted border and soft tint */
.roadmap-list .step.pending {
  border: 2px dotted #ffd666;
  background: rgba(255, 236, 153, 0.12);
}
/* Keep the pending highlight on hover/focus, subtly enhanced */
.roadmap-list .step.pending:is(:hover, :focus, :focus-visible, :focus-within) {
  background: rgba(255, 236, 153, 0.18);
  box-shadow: 0 6px 18px rgba(20, 10, 30, 0.08),
    0 0 0 2px rgba(255, 214, 102, 0.25);
}
