/* ============================================================
   RCS Onboarding — Public Form (Futuristic 2026)
   ============================================================ */

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

/* ── Reset & Root ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #05050f;
  --surface:     rgba(255,255,255,.03);
  --surface-2:   rgba(255,255,255,.06);
  --border:      rgba(255,255,255,.08);
  --border-hover:rgba(0,212,255,.3);
  --primary:     #00d4ff;
  --primary-dim: rgba(0,212,255,.15);
  --secondary:   #7b2fff;
  --success:     #00ff88;
  --warning:     #ffaa00;
  --danger:      #ff4d4d;
  --text:        #f0f0f0;
  --text-sub:    #7a7a8c;
  --text-dim:    #4a4a5a;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 8px 32px rgba(0,0,0,.4);
  --shadow-glow: 0 0 30px rgba(0,212,255,.15);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Background glow spots ───────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  top: -200px; left: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,212,255,.06) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  bottom: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(123,47,255,.06) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

/* ── Header ──────────────────────────────────────────────── */
.site-header {
  text-align: center;
  padding: 40px 20px 0;
  position: relative; z-index: 1;
}
.site-header .logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 22px; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.site-header .logo img { height: 36px; }
.site-header .tagline {
  margin-top: 6px; color: var(--text-sub); font-size: 14px;
}

/* ── Progress Bar ────────────────────────────────────────── */
.progress-wrap {
  position: sticky; top: 0; z-index: 100;
  background: rgba(5,5,15,.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
}
.progress-inner { max-width: 860px; margin: 0 auto; }
.steps-row {
  display: flex; align-items: center; justify-content: center;
  gap: 0; flex-wrap: nowrap;
}
.step-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 500; color: var(--text-dim);
  cursor: default; white-space: nowrap;
}
.step-item.active { color: var(--primary); }
.step-item.done   { color: var(--success); }

.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  transition: all .3s;
  flex-shrink: 0;
}
.step-item.active .step-num {
  border-color: var(--primary);
  background: var(--primary-dim);
  color: var(--primary);
  box-shadow: 0 0 12px rgba(0,212,255,.3);
}
.step-item.done .step-num {
  border-color: var(--success);
  background: rgba(0,255,136,.1);
  color: var(--success);
}
.step-item.done .step-num::after { content: '✓'; }

.step-connector {
  flex: 1; height: 1px;
  background: var(--border);
  min-width: 20px; max-width: 60px;
  margin: 0 4px;
}
.step-connector.done { background: var(--success); opacity: .4; }

.progress-bar {
  margin-top: 10px; height: 2px;
  background: var(--border);
  border-radius: 2px; overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 8px var(--primary);
}

/* ── Form Container ──────────────────────────────────────── */
.form-container {
  max-width: 860px; margin: 32px auto;
  padding: 0 20px 60px;
  position: relative; z-index: 1;
}

/* ── Steps ───────────────────────────────────────────────── */
.form-step { display: none; }
.form-step.active { display: block; animation: fadeIn .4s ease; }

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

/* ── Card ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  transition: border-color .3s;
}
.card:hover { border-color: var(--border-hover); }

.card-title {
  font-size: 15px; font-weight: 600; color: var(--primary);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}
.card-title::before {
  content: ''; width: 3px; height: 18px;
  background: linear-gradient(var(--primary), var(--secondary));
  border-radius: 2px;
}

/* ── Step header ─────────────────────────────────────────── */
.step-header {
  margin-bottom: 28px;
}
.step-header h2 {
  font-size: 24px; font-weight: 700;
  background: linear-gradient(135deg, #fff, var(--primary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.step-header p { color: var(--text-sub); font-size: 14px; margin-top: 4px; }

/* ── Field groups ────────────────────────────────────────── */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.field-row.single { grid-template-columns: 1fr; }
.field-row.triple { grid-template-columns: 1fr 1fr 1fr; }

.field { display: flex; flex-direction: column; gap: 6px; }

/* ── Labels ──────────────────────────────────────────────── */
.field label {
  font-size: 12px; font-weight: 600;
  color: var(--text-sub); text-transform: uppercase; letter-spacing: .6px;
  display: flex; align-items: center; gap: 6px;
}
.badge-required {
  font-size: 9px; background: rgba(255,77,77,.15);
  color: var(--danger); padding: 1px 6px; border-radius: 4px;
  font-weight: 600; letter-spacing: .4px;
}

/* ── Inputs ──────────────────────────────────────────────── */
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="url"],
.field input[type="number"],
.field select,
.field textarea {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 11px 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  background: rgba(0,212,255,.04);
  box-shadow: 0 0 0 3px rgba(0,212,255,.1);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-dim); }

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a7a8c' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
.field select option { background: #0f0f1a; color: var(--text); }

.field textarea {
  resize: vertical; min-height: 100px;
  font-size: 13px; line-height: 1.7;
}

/* ── Color picker ────────────────────────────────────────── */
.color-row {
  display: flex; gap: 10px; align-items: center;
}
.color-row input[type="color"] {
  width: 46px; height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer; padding: 2px;
}
.color-row input[type="text"] { flex: 1; }

/* ── Character counter ───────────────────────────────────── */
.char-count { font-size: 11px; color: var(--text-dim); text-align: right; }
.char-count.warn { color: var(--warning); }
.char-count.over { color: var(--danger); }

/* ── Info tooltip ────────────────────────────────────────── */
.info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1px solid var(--text-dim);
  color: var(--text-dim); font-size: 10px; font-weight: 700;
  cursor: pointer; position: relative;
  flex-shrink: 0; user-select: none;
  transition: border-color .2s, color .2s;
}
.info-btn:hover { border-color: var(--primary); color: var(--primary); }
.info-btn .tooltip {
  position: absolute; bottom: calc(100% + 8px);
  left: 50%; transform: translateX(-50%);
  background: #1a1a2e; border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
  font-size: 12px; color: var(--text-sub); font-weight: 400;
  width: 260px; line-height: 1.6; z-index: 200;
  pointer-events: none; opacity: 0;
  transition: opacity .2s;
  white-space: normal; text-transform: none; letter-spacing: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.info-btn .tooltip::after {
  content: ''; position: absolute;
  top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1a1a2e;
}
.info-btn:hover .tooltip { opacity: 1; }

/* ── File upload zone ────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all .3s;
  position: relative; overflow: hidden;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-dim);
}
.upload-zone input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer; z-index: 2;
}
.upload-icon { font-size: 28px; margin-bottom: 6px; }
.upload-label { font-size: 13px; color: var(--text-sub); }
.upload-label span { color: var(--primary); }
.upload-hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.upload-preview {
  display: none; margin-top: 10px;
  align-items: center; gap: 10px;
  background: rgba(0,255,136,.06); border-radius: 6px;
  padding: 8px 12px; font-size: 12px; color: var(--success);
}
.upload-preview.show { display: flex; }
.upload-preview .remove-file {
  margin-left: auto; cursor: pointer;
  color: var(--danger); font-size: 16px; line-height: 1;
}

/* ── Existing file (update form) ─────────────────────────── */
.existing-file {
  font-size: 12px; color: var(--text-sub);
  padding: 6px 0; display: flex; align-items: center; gap: 6px;
}
.existing-file a { color: var(--primary); text-decoration: none; }
.existing-file a:hover { text-decoration: underline; }

/* ── Field error ─────────────────────────────────────────── */
.field-error {
  font-size: 11px; color: var(--danger);
  display: flex; align-items: center; gap: 4px;
}
.field input.error, .field select.error, .field textarea.error {
  border-color: var(--danger);
}

/* ── Update reason banner ────────────────────────────────── */
.update-banner {
  background: rgba(255,170,0,.08);
  border: 1px solid rgba(255,170,0,.25);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex; gap: 12px; align-items: flex-start;
}
.update-banner .icon { font-size: 20px; flex-shrink: 0; }
.update-banner h4 { font-size: 13px; color: var(--warning); font-weight: 600; }
.update-banner p  { font-size: 13px; color: var(--text-sub); margin-top: 4px; }

/* ── Navigation buttons ──────────────────────────────────── */
.nav-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 32px; padding-top: 20px;
  border-top: 1px solid var(--border);
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; outline: none;
  transition: all .25s; text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #0099cc);
  color: #000;
  box-shadow: 0 4px 15px rgba(0,212,255,.3);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(0,212,255,.5);
  transform: translateY(-1px);
}
.btn-ghost {
  background: var(--surface-2); color: var(--text-sub);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-hover); }

.btn:disabled, .btn.loading {
  opacity: .6; cursor: not-allowed; transform: none !important;
}
.btn.loading .btn-text { opacity: .7; }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(0,0,0,.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: none;
}
.btn.loading .spinner { display: block; }

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

/* ── Toast notification ──────────────────────────────────── */
#toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #1a1a2e; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 18px;
  font-size: 13px; z-index: 9999;
  transform: translateY(20px); opacity: 0;
  transition: all .3s; pointer-events: none;
  max-width: 360px; box-shadow: var(--shadow);
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.success { border-color: rgba(0,255,136,.3); color: var(--success); }
#toast.error   { border-color: rgba(255,77,77,.3);  color: var(--danger); }
#toast.info    { border-color: rgba(0,212,255,.3);  color: var(--primary); }

/* ── Review step ─────────────────────────────────────────── */
.review-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.review-item {
  padding: 10px 14px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.review-item .rlabel {
  font-size: 10px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .6px; font-weight: 600;
}
.review-item .rval {
  font-size: 13px; color: var(--text); margin-top: 2px;
  word-break: break-all;
}
.review-item .rval.empty { color: var(--text-dim); font-style: italic; }

.color-dot {
  display: inline-block; width: 12px; height: 12px;
  border-radius: 50%; border: 1px solid var(--border);
  vertical-align: middle; margin-right: 4px;
}

/* ── Success page ────────────────────────────────────────── */
.success-wrap {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  padding: 40px 20px;
}
.success-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  max-width: 560px; width: 100%;
  text-align: center;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow), var(--shadow-glow);
}
.success-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(0,255,136,.1);
  border: 2px solid rgba(0,255,136,.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; margin: 0 auto 20px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,255,136,.3); }
  50%       { box-shadow: 0 0 0 12px transparent; }
}
.success-card h1 { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.success-id {
  display: inline-block;
  background: var(--primary-dim);
  border: 1px solid rgba(0,212,255,.2);
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 14px; font-weight: 700; color: var(--primary);
  letter-spacing: 1px; margin: 16px 0;
}
.success-card .message { color: var(--text-sub); font-size: 14px; line-height: 1.7; }
.support-box {
  margin-top: 24px; padding: 16px 20px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  text-align: left;
}
.support-box h4 { font-size: 12px; color: var(--text-sub); font-weight: 600; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 10px; }
.support-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text); margin-bottom: 6px;
}
.support-item:last-child { margin-bottom: 0; }
.support-item a { color: var(--primary); text-decoration: none; }

/* ── Expired link page ───────────────────────────────────── */
.expired-wrap {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center; padding: 40px 20px;
}
.expired-card {
  background: var(--surface);
  border: 1px solid rgba(255,77,77,.2);
  border-radius: 16px; padding: 48px 40px;
  max-width: 480px; width: 100%; text-align: center;
}
.expired-card .icon { font-size: 48px; margin-bottom: 16px; }
.expired-card h2 { font-size: 22px; color: var(--danger); margin-bottom: 8px; }
.expired-card p  { color: var(--text-sub); font-size: 14px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
  .field-row.triple { grid-template-columns: 1fr 1fr; }
  .card { padding: 20px 16px; }
  .form-container { padding: 0 12px 40px; }
  .steps-row { gap: 0; }
  .step-item .step-label { display: none; }
  .review-grid { grid-template-columns: 1fr; }
  .success-card { padding: 32px 20px; }
}
