/* ── Sticky steps row ─────────────────────────────────────── */

@keyframes rsbDotPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(201,144,31,0.2); }
  50%       { box-shadow: 0 0 0 6px rgba(201,144,31,0.08); }
}

/* ── Page Hero ───────────────────────────────────────────────── */
.reg-hero {
  position: relative;
  padding-top: calc(var(--navbar-h) + 48px);
  padding-bottom: 60px;
  background: var(--grad-hero);
  overflow: hidden;
  text-align: center;
}

.reg-hero__shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.reg-hero .shape--1 {
  width: 400px;
  height: 400px;
  top: -120px;
  inset-inline-start: -80px;
  opacity: 0.25;
}

.reg-hero .shape--2 {
  width: 300px;
  height: 300px;
  bottom: -80px;
  inset-inline-end: -60px;
  opacity: 0.2;
}

.reg-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.reg-hero__icon {
  font-size: 3rem;
  animation: heroIconBounce 2s ease-in-out infinite;
}

@keyframes heroIconBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.reg-hero__title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.reg-hero__sub {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ── Progress Steps ─────────────────────────────────────────── */
.reg-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 20px;
  flex-wrap: nowrap;
}

.reg-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: default;
  min-width: 80px;
  position: relative;
}

/* ── CSS tooltip via data-tooltip ────────────────────────── */
.reg-step[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(17,17,17,0.95);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.reg-step[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  border: 5px solid transparent;
  border-top-color: rgba(17,17,17,0.95);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.reg-step:hover[data-tooltip]::after,
.reg-step:hover[data-tooltip]::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Circle base ──────────────────────────────────────────── */
.reg-step__circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  position: relative;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1),
              background 0.3s ease,
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

/* Hover: slight lift + scale */
.reg-step:hover .reg-step__circle {
  transform: scale(1.1) translateY(-2px);
}

/* Pulse ring on active (::before) */
.reg-step__circle::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(201,144,31,0);
  transition: border-color 0.3s ease;
  pointer-events: none;
}

/* Done burst ring (::after) */
.reg-step__circle::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  pointer-events: none;
}

.reg-step span:last-child {
  font-size: 0.72rem;
  color: var(--text-light);
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.3s ease, font-weight 0.1s;
}

/* ── Active state ─────────────────────────────────────────── */
.reg-step.active .reg-step__circle {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 6px 22px rgba(201,144,31,0.24);
  animation: stepPulse 2s ease-in-out infinite;
}

.reg-step.active .reg-step__circle::before {
  border-color: rgba(201,144,31,0.32);
  animation: pulseRing 2s ease-in-out infinite;
}

.reg-step.active span:last-child {
  color: var(--primary);
  font-weight: 700;
}

@keyframes stepPulse {
  0%, 100% { box-shadow: 0 6px 22px rgba(201,144,31,0.24); }
  50%       { box-shadow: 0 6px 30px rgba(201,144,31,0.34), 0 0 0 6px rgba(201,144,31,0.08); }
}

@keyframes pulseRing {
  0%   { transform: scale(1);    opacity: 0.6; }
  60%  { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1);    opacity: 0; }
}

/* ── Done state ───────────────────────────────────────────── */
.reg-step.done .reg-step__circle {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  animation: none;
}

.reg-step.done .reg-step__circle::before {
  animation: none;
  border-color: transparent;
}

.reg-step.done .reg-step__circle::after {
  animation: burstRing 0.45s ease-out forwards;
}

@keyframes burstRing {
  0%   { border-color: var(--accent); transform: scale(1);   opacity: 1; }
  100% { border-color: var(--accent); transform: scale(1.8); opacity: 0; }
}

.reg-step.done span:last-child {
  color: var(--text-muted);
}

/* ── Connector line ───────────────────────────────────────── */
.reg-step__line {
  flex: 1;
  height: 2px;
  background: rgba(17,17,17,0.12);
  margin-bottom: 22px;
  min-width: 24px;
  transition: background 0.4s ease;
  position: relative;
  overflow: hidden;
}

/* Animated fill sweep when done */
.reg-step__line.done {
  background: var(--accent);
}

.reg-step__line.done::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.4);
  animation: lineSweep 0.5s ease-out forwards;
}

@keyframes lineSweep {
  from { transform: scaleX(0); transform-origin: right; }
  to   { transform: scaleX(1); transform-origin: right; opacity: 0; }
}

/* ── Main Layout ─────────────────────────────────────────────── */
.reg-main {
  background: var(--bg-alt);
  padding-block: 48px 80px;
  min-height: 60vh;
}

.reg-layout {
  max-width: 860px;
}

.reg-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ── Card ────────────────────────────────────────────────────── */
.reg-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition);
}

.reg-card:focus-within {
  box-shadow: var(--shadow);
  border-color: rgba(201,144,31,0.25);
}

.reg-card__header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 28px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.reg-card__icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}

.reg-card__icon-wrap svg {
  width: 20px;
  height: 20px;
}

.reg-card__title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}

.reg-card__subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.reg-card__badge {
  margin-inline-start: auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
}

.reg-card__body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Form Grids ─────────────────────────────────────────────── */
.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid--2 { grid-template-columns: repeat(2, 1fr); }
.form-grid--3 { grid-template-columns: repeat(3, 1fr); }

/* ── Field Group Label ──────────────────────────────────────── */
.field-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: -4px;
}

.field-group-label__icon {
  font-size: 1rem;
}

/* ── Form Group ─────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.92rem;
  transition: all var(--transition);
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg);
  box-shadow: 0 0 0 3px rgba(201,144,31,0.1);
}

.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible {
  outline: 2.5px solid var(--primary-dark);
  outline-offset: 2px;
}

.form-group input.error,
.form-group select.error {
  border-color: #EF4444;
  background: rgba(239,68,68,0.04);
}

.form-group input.success,
.form-group select.success {
  border-color: var(--primary);
}

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

/* Date input */
input[type="date"] {
  cursor: pointer;
}

input[type="time"] {
  cursor: pointer;
  padding: 8px 12px;
  font-size: 0.88rem;
}

/* ── Select Wrapper ─────────────────────────────────────────── */
.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: '';
  position: absolute;
  top: 50%;
  inset-inline-end: 14px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--text-muted);
  pointer-events: none;
}

.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: 36px;
  cursor: pointer;
}

/* ── Phone Input ─────────────────────────────────────────────── */
.phone-input {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
  transition: all var(--transition);
}

.phone-input:focus-within {
  border-color: var(--primary);
  background: var(--bg);
  box-shadow: 0 0 0 3px rgba(201,144,31,0.1);
}

.phone-input.error {
  border-color: #EF4444;
}

.phone-input input {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  flex: 1;
  padding-inline-start: 12px;
}

.phone-input input:focus {
  box-shadow: none !important;
}

/* ── Required Star ──────────────────────────────────────────── */
.required-star {
  color: #EF4444;
  font-weight: 700;
}

/* ── Subscription End-Date Hint ────────────────────────────── */
.sub-end-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-light);
  border: 1px solid rgba(201,144,31,0.25);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-top: 2px;
  animation: hintFadeIn 0.25s ease;
}

.sub-end-hint svg {
  flex-shrink: 0;
  opacity: 0.8;
}

@keyframes hintFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Field Error ────────────────────────────────────────────── */
.field-error {
  font-size: 0.78rem;
  color: #EF4444;
  font-weight: 500;
  min-height: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Field Hint (format notes under an input) ───────────────── */
.field-hint {
  font-size: 0.76rem;
  color: var(--text-light);
  font-weight: 500;
  line-height: 1.6;
}

/* ── Divider ────────────────────────────────────────────────── */
.reg-divider {
  height: 1px;
  background: var(--border);
  margin-block: 4px;
}

/* ── Terms Box ───────────────────────────────────────────────── */
.reg-card--terms .reg-card__header {
  background: linear-gradient(135deg, rgba(201,144,31,0.08), rgba(201,144,31,0.03));
}

.terms-box {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.terms-content {
  max-height: 260px;
  overflow-y: auto;
  padding: 20px 22px;
  font-size: 0.88rem;
  line-height: 1.9;
  color: var(--text-muted);
  scroll-behavior: smooth;
}

.terms-content::-webkit-scrollbar { width: 6px; }
.terms-content::-webkit-scrollbar-track { background: var(--bg-alt); }
.terms-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.terms-content::-webkit-scrollbar-thumb:hover { background: var(--primary); }

.terms-content h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
}

.terms-content h5 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 14px;
  margin-bottom: 4px;
}

.terms-content p {
  margin-bottom: 8px;
}

.terms-list {
  margin: 6px 0 10px;
  padding-inline-start: 20px;
  list-style: decimal;
}

.terms-list li {
  margin-bottom: 8px;
}

.terms-scroll-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 500;
  transition: opacity var(--transition);
}

.terms-scroll-indicator.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Terms Checkbox */
.terms-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  padding: 16px 18px;
  background: var(--bg-alt);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  user-select: none;
}

.terms-checkbox:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.terms-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.terms-checkbox input:checked ~ .terms-checkbox__box {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.terms-checkbox input:checked ~ .terms-checkbox__box ~ .terms-checkbox__text {
  color: var(--text);
}

.terms-checkbox__box {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all var(--transition);
  color: transparent;
}

.terms-checkbox__text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  transition: color var(--transition);
}

.terms-checkbox__text strong {
  color: var(--primary);
}

.terms-checkbox.shake {
  animation: shake 0.4s ease;
  border-color: #EF4444;
  background: rgba(239,68,68,0.04);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

/* ── Submit Area ─────────────────────────────────────────────── */
.reg-submit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 24px 0 0;
}

.reg-submit__back {
  color: var(--text-muted);
  border-color: var(--border);
}

.reg-submit__btn {
  padding-inline: 40px;
  gap: 10px;
  font-size: 1rem;
  box-shadow: 0 8px 28px rgba(201,144,31,0.35);
}

.reg-submit__btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

/* Spinner */
.spinner {
  animation: spin 0.8s linear infinite;
}

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

/* ── Success Overlay ─────────────────────────────────────────── */
.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.success-modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.success-modal__icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C9901F, #E0AC42);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(201,144,31,0.35);
}

.success-modal__icon svg {
  width: 36px;
  height: 36px;
  stroke: #fff;
  stroke-width: 2.5;
}

.success-modal__title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}

.success-modal__desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 20px;
}

.success-modal__ref {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  padding: 8px 20px;
  font-size: 0.88rem;
  margin-bottom: 28px;
}

.success-modal__ref strong {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  
  .form-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .form-grid--2 { grid-template-columns: 1fr; }

  .reg-card__body { padding: 20px; }
  .reg-card__header { padding: 16px 20px; }

.reg-steps { gap: 0; }
  .reg-step { min-width: 60px; }
  .reg-step span:last-child { font-size: 0.65rem; }
  .reg-step__circle { width: 36px; height: 36px; }
  .reg-step__line { min-width: 12px; }

  .reg-submit { flex-direction: column-reverse; }
  .reg-submit__back,
.reg-submit__btn { width: 100%; justify-content: center; }

  .success-modal { padding: 32px 24px; }}

@media (max-width: 480px) {
  .form-grid--3 { grid-template-columns: 1fr; }

  .reg-main { padding-block: 28px 60px; }
  .reg-hero { padding-bottom: 40px; }
  .reg-hero__title { font-size: 1.3rem; }

.reg-card__body { padding: 16px; }
  .reg-card__header { padding: 14px 16px; }

  }

@media (max-width: 380px) {
  .reg-step span:last-child { display: none; }}

/* ══════════════════════════════════════════════════════════════
   Dark Theme Overrides
   ══════════════════════════════════════════════════════════════ */
[data-theme="dark"] .reg-step__circle {
  background: rgba(28, 25, 21, 0.92);
  border-color: var(--border);
}

[data-theme="dark"] .reg-step__line {
  background: rgba(255, 255, 255, 0.1);
}

@keyframes rsbDotPulseDark {
  0%, 100% { box-shadow: 0 0 0 3px rgba(229, 185, 71, 0.25); }
  50%       { box-shadow: 0 0 0 6px rgba(229, 185, 71, 0.1); }
}

[data-theme="dark"] .select-wrap::after {
  border-top-color: var(--text-muted);
}

[data-theme="dark"] .reg-card__icon-wrap {
  background: rgba(229, 185, 71, 0.12);
}

[data-theme="dark"] .terms-checkbox__box {
  background: var(--bg);
  border-color: var(--border);
}

[data-theme="dark"] .terms-scroll-indicator {
  background: var(--bg-alt);
  border-top-color: var(--border);
}

[data-theme="dark"] .success-overlay {
  background: rgba(0, 0, 0, 0.7);
}
