/* Base form container */
.erf-form {
  max-width: 560px;
  margin: 20px auto;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#erf-bundle-hint {
  color: #1a7f37; /* green */
  font-weight: 500;
  margin-left: 8px;
}

/* Inputs */
.erf-form p { margin-bottom: 16px; }
.erf-form label {
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}
/* All inputs + selects */
.erf-form input[type="text"],
.erf-form input[type="email"],
.erf-form input[type="date"],
.erf-form input[type="tel"] {
    width: 100%;
    height: 44px;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    background-color: #fff;
}
.erf-form select {
    width: 100%;
    height: 84px;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}
#helmet_size,#stick_side,#skate_size {
    width: 100%;
    height: 44px;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}
.erf-card-element {
  border: 1px solid #ccc;
  padding: 12px;
  border-radius: 6px;
  background: #fafafa;
  margin: 16px 0;
}

.erf-help { font-size: 12px; color: #666; }

/* Total row */
.erf-total {
  margin: 12px 0;
  font-size: 16px;
  font-weight: 600;
  text-align: right;
}

/* ---------- Button: consistent & centered ---------- */
.erf-btn {
  width: 100%;                    /* Match input width */
  height: 48px;
  background: #0b1a8a;
  color: #fff;
  font-size: 16px;                /* Match inputs to avoid iOS zoom */
  line-height: 1;                 /* Avoid line-height variability across devices */
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  position: relative;             /* For centering spinner via absolute */
  margin-top: 20px;

  /* Normalize mobile rendering */
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  text-decoration: none;

  /* Use grid to center both text and spinner perfectly */
  display: grid;
  place-items: center;
}

/* Hide text when loading to keep spinner truly centered */
.erf-btn.loading .btn-text {
  display: none;
}

/* Spinner: absolute center ensures same look across devices */
.erf-btn .btn-spinner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.6);
  border-top-color: #fff;
  display: none;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);  /* Perfect center on all browsers */
}

/* Show spinner when loading */
.erf-btn.loading .btn-spinner {
  display: block;
  animation: spin 0.9s linear infinite;
}

/* Motion prefs */
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .erf-btn.loading .btn-spinner { animation: none; }
}

/* Focus and active states for accessibility and tap feedback */
.erf-btn:focus-visible {
  outline: 2px solid #2e5cff;
  outline-offset: 2px;
}
.erf-btn:active {
  filter: brightness(0.95);
}

/* Messages */
.erf-message {
  max-width: 560px;
  margin: 12px auto;
  display: none;
  text-align: center;
}
.erf-message p { margin: 0; }
.erf-message .erf-error { color: #b00020; }
.erf-message .erf-success { color: #0a7a2c; }

/* Confirmation box */
.erf-confirmation {
  max-width: 560px;
  margin: 20px auto;
  padding: 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
}

/* ---------- Mobile-specific polish ---------- */
@media (max-width: 480px) {
  .erf-form {
    padding: 16px;               /* Slightly tighter on mobile */
    border-radius: 10px;         /* Softer corners look nicer on small screens */
  }
  .erf-form input,
  .erf-form select {
    padding: 14px;               /* Larger tap target */
  }
  .erf-btn {
    height: 52px;                /* Larger tap target for thumbs */
    border-radius: 10px;         /* Match form corners */
  }
}
