/* ==========================================================================
   CREATOR RPM EVALUATION FORM — FIGMA MATCH (desktop 1726×929 / mobile 360×788)
   Pure vanilla CSS, zero dependencies.
   ========================================================================== */

@font-face {
  font-family: 'PP Pangram Sans';
  src: url('assets/fonts/PPPangramSans-CompressedExtrabold.woff') format('woff'),
       url('assets/fonts/PPPangramSans-CompressedExtrabold.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Stack Sans Text';
  src: url('assets/fonts/StackSansText-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Stack Sans Text';
  src: url('assets/fonts/StackSansText-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Figma tokens */
  --color-heading: #1e262a;
  --color-subtitle: #607986;
  --color-placeholder: #7f97a4;
  --color-border: #dee5e8;
  --color-divider: #c1ccd2;
  --color-page: #ffffff;
  --color-surface: #ffffff;

  --color-pink: #dd88cf;
  --color-pink-hover: #db80cc;
  --color-pink-active: #c56fb6;
  --color-pink-ink: #4b174c;

  --color-grey: #dee5e8;
  --color-grey-hover: #d8e0e3;
  --color-grey-ink: #485c65;

  --color-focus: #c2d6ea;
  --color-focus-ring: #e1ebf4;

  --color-selected: #183441;

  --font-heading: 'PP Pangram Sans', 'Barlow Condensed', 'Anton', Impact, -apple-system, sans-serif;
  --font-body: 'Stack Sans Text', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html {
  height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  padding: 64px 20px;
  font-family: var(--font-body);
  background-color: var(--color-page);
  color: var(--color-heading);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background polygon */
.bg-wrapper {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.bg-wrapper picture {
  display: block;
  width: 100%;
  height: 100%;
}

.bg-graphic {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Progress bar */
.progress-bar {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 588px;
  max-width: calc(100% - 32px);
  height: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  z-index: 2;
}

.progress-step {
  height: 100%;
  border-radius: 12px;
  background-color: var(--color-border);
  transition: background-color 0.25s ease;
}

.progress-step.active {
  background-color: var(--color-pink);
}

/* Container */
.form-container {
  width: 100%;
  max-width: 600px;
  margin: auto;
  position: relative;
  z-index: 1;
}

#rpmForm {
  width: 100%;
}

.step {
  display: none;
  width: 100%;
}

.step.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#step1.active {
  animation: none;
}

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

@media (prefers-reduced-motion: reduce) {
  .step.active {
    animation: none;
  }
}

/* Step header */
.step-header {
  width: 100%;
  text-align: center;
  margin-bottom: 32px;
}

.step-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 104px;
  line-height: 90px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--color-heading);
  margin-bottom: 0;
  white-space: nowrap;
  user-select: none;
}

.step-subtitle {
  font-size: 18px;
  line-height: 1.5;
  color: var(--color-subtitle);
  max-width: 600px;
  margin: 0 auto;
}

/* RPM cards */
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 200px);
  gap: 16px;
}

.rpm-card {
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 400;
  color: var(--color-subtitle);
  cursor: pointer;
  user-select: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.rpm-card .divider {
  display: inline-block;
  width: 16px;
  height: 2px;
  border-radius: 3px;
  background-color: var(--color-divider);
  transition: background-color 0.15s ease;
}

.rpm-card:not(.selected):hover {
  background-image: linear-gradient(180deg, #fcfcfd 0%, #f9fafb 100%);
  color: var(--color-grey-ink);
}

.rpm-card:not(.selected):hover .divider {
  background-color: var(--color-placeholder);
}

.rpm-card:focus-visible {
  border-color: var(--color-pink);
  box-shadow: 0 0 0 3px rgba(221, 136, 207, 0.18);
}

.rpm-card:active {
  transform: scale(0.99);
}

.rpm-card.selected {
  background-color: var(--color-selected);
  border-color: var(--color-selected);
  color: #ffffff;
}

.rpm-card.selected .divider {
  background-color: var(--color-divider);
}

/* Step 3: channel inputs */
.channel-inputs-wrapper {
  width: 100%;
}

.inputs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.input-row {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.form-input {
  width: 100%;
  height: 60px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 0 16px;
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--color-heading);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-row .form-input {
  padding-right: 52px;
}

.form-input::placeholder {
  color: var(--color-placeholder);
}

.form-input:focus {
  border-color: var(--color-focus);
  box-shadow: 0 0 0 1px var(--color-focus), 0 0 0 3px var(--color-focus-ring);
}

.remove-channel-btn {
  position: absolute;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  background: none;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  color: var(--color-subtitle);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.remove-channel-btn:hover {
  color: #e02424;
  background-color: #fee2e2;
}

.add-channel-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 0;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--color-heading);
  text-align: left;
  cursor: pointer;
  transition: color 0.15s ease;
}

.add-channel-btn:hover {
  color: var(--color-pink-active);
  text-decoration: underline;
}

/* Step 4: contact rows */
.contact-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-row {
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.contact-row:focus-within {
  border-color: var(--color-focus);
  box-shadow: 0 0 0 1px var(--color-focus), 0 0 0 3px var(--color-focus-ring);
}

.icon-box {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-box img {
  display: block;
  width: 32px;
  height: 32px;
}

.icon-box img.icon-discord {
  width: 30px;
  height: 30px;
}

.icon-box img.icon-whatsapp {
  width: 31px;
  height: 31px;
}

.contact-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--color-heading);
}

.contact-input::placeholder {
  color: var(--color-placeholder);
}

.form-error {
  width: 100%;
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 12px;
  background-color: #fee2e2;
  color: #b91c1c;
  font-size: 14px;
  text-align: center;
}

/* Actions */
.btn-group {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 204px;
  height: 48px;
  border: none;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
  outline: none;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-secondary {
  background-color: var(--color-grey);
  color: var(--color-grey-ink);
}

.btn-secondary:hover {
  background-color: var(--color-grey-hover);
  color: var(--color-heading);
}

.btn-primary {
  background-color: var(--color-pink);
  color: var(--color-pink-ink);
}

.btn-primary:hover {
  background-color: var(--color-pink-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Loading spinner */
.spinner {
  display: none;
  width: 18px;
  height: 18px;
  margin-left: 8px;
  border: 2px solid rgba(75, 23, 76, 0.3);
  border-top-color: var(--color-pink-ink);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn.loading .btn-text {
  opacity: 0.8;
}

.btn.loading .spinner {
  display: inline-block;
}

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

/* Step 5: success */
.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: #fdf5fb;
  border: 2px solid var(--color-pink);
  color: var(--color-pink-ink);
  font-size: 32px;
  font-weight: 700;
}

/* ==========================================================================
   MOBILE (Figma 360×788)
   ========================================================================== */
@media (max-width: 639px) {
  body {
    padding: 56px 20px;
  }

  .progress-bar {
    top: 24px;
    height: 6px;
  }

  .form-container {
    max-width: 320px;
  }

  .step-header {
    margin-bottom: 20px;
  }

  .step-title {
    font-size: min(56px, 15.556vw);
    line-height: min(48px, 13.333vw);
    margin-bottom: 8px;
  }

  .step-subtitle {
    font-size: 16px;
    max-width: 320px;
  }

  .options-grid {
    grid-template-columns: repeat(2, minmax(0, 140px));
    gap: 8px;
  }

  .rpm-card {
    height: 56px;
    font-size: 16px;
    gap: 8px;
  }

  .rpm-card .divider {
    width: 8px;
  }

  .form-input {
    height: 52px;
    padding: 0 12px;
    font-size: 16px;
  }

  .input-row .form-input {
    padding-right: 44px;
  }

  .remove-channel-btn {
    right: 10px;
  }

  .add-channel-btn {
    margin-top: 12px;
  }

  .contact-row {
    height: 52px;
    gap: 8px;
    padding: 0 12px;
  }

  .icon-box {
    width: 32px;
    height: 32px;
  }

  .icon-box img {
    width: 26px;
    height: 26px;
  }

  .icon-box img.icon-discord {
    width: 24px;
    height: 24px;
  }

  .icon-box img.icon-whatsapp {
    width: 26px;
    height: 26px;
  }

  .contact-input {
    font-size: 15px;
  }

  .btn-group {
    gap: 8px;
    margin-top: 24px;
  }

  .btn {
    width: 132px;
    height: 44px;
    font-size: 15px;
  }

  .success-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 20px;
    font-size: 28px;
  }
}
