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

:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --border: #1e1e2e;
  --border-focus: #5b4cf5;
  --accent: #5b4cf5;
  --accent-hover: #7066f7;
  --text: #e8e8f0;
  --muted: #55556a;
  --logo-from: #a78bfa;
  --logo-to: #60a5fa;
  --radius: 14px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Subtle radial glow behind the card */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 30%, rgba(91,76,245,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 70% 70%, rgba(96,165,250,0.07) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 680px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

/* ── Logo ── */
header {
  text-align: center;
}

.logo {
  font-size: clamp(2.4rem, 7vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--logo-from) 0%, var(--logo-to) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  user-select: none;
}

/* ── Main card ── */
main {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 20px 60px rgba(0,0,0,0.5),
    0 4px 16px rgba(0,0,0,0.3);
  transition: border-color 0.2s;
}

main:focus-within {
  border-color: rgba(91,76,245,0.4);
}

textarea {
  width: 100%;
  min-height: 120px;
  max-height: 60vh;
  resize: none;
  overflow-y: hidden;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  padding: 18px 20px;
  caret-color: var(--accent);
  border-radius: calc(var(--radius) - 4px);
  -webkit-text-size-adjust: 100%;
}

textarea::placeholder {
  color: var(--muted);
}

button#create-btn {
  align-self: center;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 10px 26px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 2px 12px rgba(91,76,245,0.35);
}

button#create-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 20px rgba(91,76,245,0.5);
}

button#create-btn:active {
  transform: scale(0.97);
}

button#create-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Progress view ── */
#progress-view {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.progress-label {
  font-size: 0.95rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

.progress-track {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--logo-to));
  box-shadow: 0 0 10px rgba(91,76,245,0.6);
  transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.progress-done {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 500;
  animation: fadein 0.4s ease;
}

.done-icon {
  color: var(--logo-from);
  font-size: 1.1rem;
}

.progress-done a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255,255,255,0.2);
  transition: text-decoration-color 0.2s;
}

.progress-done a:hover {
  text-decoration-color: var(--logo-from);
}

/* ── Footer ── */
.powered-by {
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.6;
}

.powered-by a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(255,255,255,0.15);
  transition: opacity 0.15s;
}

.powered-by a:hover {
  opacity: 1;
}

/* ── Utilities ── */
.hidden {
  display: none !important;
}

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

@media (max-width: 480px) {
  .container {
    gap: 24px;
    padding: 0 16px;
  }
  textarea {
    min-height: 100px;
    font-size: 1rem; /* prevent iOS zoom on focus */
  }
  button#create-btn {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
  }
}
