/* ============================================================
   FighterXFighter — Signup Form CSS
   Full rewrite. Clean light mode, editorial athletic tone.
   ============================================================ */

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

/* ── Variables ── */
:root {
  --brand:       #5b4fcf;
  --brand-dark:  #4338b8;
  --brand-glow:  rgba(91, 79, 207, 0.12);
  --bg:          #f4f4f8;
  --surface:     #ffffff;
  --surface-2:   #f8f8fb;
  --border:      #e2e2ec;
  --border-focus:#5b4fcf;
  --text:        #111118;
  --text-muted:  #6b6b80;
  --text-subtle: #a0a0b8;
  --error:       #e03040;
  --success:     #16a863;
  --radius:      10px;
  --radius-lg:   16px;
  --font-head:   'Syne', sans-serif;
  --font-body:   'DM Sans', sans-serif;
  --transition:  0.2s ease;
}

/* ── Wrapper & Root ── */
.fxf-signup-wrapper {
  min-height: 100vh;
  /* background-color: var(--bg); */
  background-image:
    radial-gradient(ellipse 80% 40% at 50% -5%, rgba(91,79,207,0.07) 0%, transparent 70%),
    url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Ccircle fill='%235b4fcf' cx='1' cy='1' r='1' opacity='0.06'/%3E%3C/g%3E%3C/svg%3E");
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px 64px;
  font-family: var(--font-body);
  color: var(--text);
  box-sizing: border-box;
}

.fxf-root {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ── Header ── */
.fxf-header {
  text-align: center;
}

.fxf-header h1 {
  font-family: var(--font-head);
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 6px;
  line-height: 1.1;
}

.fxf-header p {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 300;
  margin: 0;
  letter-spacing: 0.01em;
}

/* ── Stepper ── */
.fxf-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.fxf-step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.fxf-step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  border: 2px solid var(--border);
  color: var(--text-subtle);
  background: var(--surface);
  transition: all 0.3s ease;
  z-index: 1;
}

.fxf-step-circle.fxf-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 0 0 4px var(--brand-glow);
}

.fxf-step-circle.fxf-done {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.fxf-step-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color var(--transition);
  white-space: nowrap;
}

.fxf-step-label.fxf-active {
  color: var(--brand);
}

.fxf-step-label.fxf-done {
  color: var(--success);
}

.fxf-step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
  margin-bottom: 24px; /* offset for label height */
  border-radius: 2px;
  transition: background 0.4s ease;
  position: relative;
  overflow: hidden;
}

.fxf-step-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.fxf-step-line.fxf-line-done::after {
  transform: scaleX(1);
}

/* ── Card ── */
.fxf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 24px rgba(0,0,0,0.07);
}

.fxf-card::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), #9b8fff);
}

/* ── Panes ── */
.fxf-pane {
  display: none;
  flex-direction: column;
  gap: 20px;
  padding: 28px 32px 28px;
  animation: fxfFadeIn 0.25s ease;
}

.fxf-pane.fxf-active-pane {
  display: flex;
}

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

/* ── Card Title ── */
.fxf-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.fxf-card-title svg {
  color: var(--brand);
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

/* ── Fields ── */
.fxf-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.fxf-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fxf-field label span {
  color: var(--brand);
  margin-left: 2px;
}

/* ── Input Wrap ── */
.fxf-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.fxf-input-wrap > svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-subtle);
  pointer-events: none;
  flex-shrink: 0;
  transition: color var(--transition);
}

/* ── Inputs & Selects ── */
.fxf-input-wrap input,
.fxf-input-wrap select {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 42px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.fxf-input-wrap input::placeholder {
  color: var(--text-subtle);
}

/* Focus */
.fxf-input-wrap input:focus,
.fxf-input-wrap select:focus {
  border-color: var(--border-focus);
  background: #fff;
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.fxf-input-wrap input:focus + svg,
.fxf-input-wrap:focus-within > svg {
  color: var(--brand);
}

/* Error state */
.fxf-input-wrap.fxf-error input,
.fxf-input-wrap.fxf-error select {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(240, 79, 90, 0.12);
}

/* ── Select Chevron ── */
.fxf-input-wrap select {
  padding-right: 40px;
  cursor: pointer;
}

/* Chevron pseudo via wrapper — inject after select */
.fxf-input-wrap::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text-subtle);
  pointer-events: none;
  transition: opacity var(--transition);
}

/* Only show chevron when wrapping a select */
.fxf-input-wrap:not(:has(select))::after {
  display: none;
}

/* ── Field Hint ── */
.fxf-field-hint {
  font-size: 11px;
  color: var(--text-subtle);
  margin: 0;
  letter-spacing: 0.01em;
}

/* ── Error Message ── */
.fxf-field-error {
  font-size: 11px;
  color: var(--error);
  margin: 0;
  display: none;
}

.fxf-field-error.fxf-visible {
  display: block;
}

/* ── Actions ── */
.fxf-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
}

/* ── Buttons ── */
.fxf-btn-next,
.fxf-btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  padding: 0 22px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.01em;
  vertical-align: middle;
}

.fxf-btn-next {
  background: var(--brand);
  color: #fff;
  margin-left: auto;
}

.fxf-btn-next:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(91, 79, 207, 0.35);
}

.fxf-btn-next:active {
  transform: translateY(0);
  box-shadow: none;
}

.fxf-btn-next svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.fxf-btn-back {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0 18px;
}

.fxf-btn-back:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: #c8c8d8;
}

.fxf-btn-back svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ── Success State ── */
.fxf-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 32px;
  gap: 14px;
}

.fxf-success-icon {
  width: 64px;
  height: 64px;
  background: rgba(34, 201, 122, 0.12);
  border: 2px solid rgba(34, 201, 122, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
  margin-bottom: 4px;
}

.fxf-success h2 {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.02em;
}

.fxf-success p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 360px;
  line-height: 1.6;
  margin: 0;
}

.fxf-timer {
  font-size: 12px;
  color: var(--text-subtle);
  margin-top: 4px;
}

/* ── Toast ── */
.fxf-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-body);
  padding: 10px 18px;
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.fxf-toast.fxf-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.fxf-toast.fxf-toast-error {
  border-color: var(--error);
  color: var(--error);
}

/* ── Phone Prefix Group ── */
.fxf-phone-wrap {
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

.fxf-phone-wrap > svg {
  display: none; /* icon replaced by prefix span */
}

.fxf-phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
  font-family: var(--font-body);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
  cursor: default;
}

.fxf-phone-wrap input[type="tel"] {
  flex: 1;
  padding-left: 14px !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: var(--surface);
  min-width: 0;
}

.fxf-phone-wrap input[type="tel"]:focus {
  outline: none;
  box-shadow: none !important;
  border: none !important;
}

.fxf-phone-wrap.fxf-err,
.fxf-phone-wrap input[type="tel"].fxf-err ~ .fxf-phone-prefix {
  border-color: var(--error);
}

/* ── City Autocomplete Dropdown ── */
.fxf-city-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 100;
  display: none;
  overflow: hidden;
}

.fxf-city-option {
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
}

.fxf-city-option:hover {
  background: var(--brand-glow);
  color: var(--brand);
}

.fxf-city-option + .fxf-city-option {
  border-top: 1px solid var(--border);
}

/* ── Responsive ── */
@media (max-width: 560px) {
  .fxf-signup-wrapper {
    padding: 32px 12px 48px;
  }

  .fxf-pane {
    padding: 22px 20px;
  }

  .fxf-success {
    padding: 36px 20px;
  }

  .fxf-header h1 {
    font-size: 26px;
  }

  .fxf-step-label {
    font-size: 10px;
  }

  .fxf-btn-next,
  .fxf-btn-back {
    font-size: 13px;
    height: 42px;
    padding: 0 16px;
  }
}