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

:root {
  --reg-bg: #f4f6fb;
  --reg-bg-accent: #ede9fe;
  --reg-surface: #ffffff;
  --reg-text: #0f172a;
  --reg-muted: #64748b;
  --reg-border: #e2e8f0;
  --reg-border-focus: #c4b5fd;
  --reg-primary: #7c3aed;
  --reg-primary-hover: #6d28d9;
  --reg-primary-soft: rgba(124, 58, 237, 0.08);
  --reg-link: #6d28d9;
  --reg-radius: 12px;
  --reg-radius-lg: 16px;
  --reg-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 40px rgba(15, 23, 42, 0.06);
  --reg-font: "Inter", system-ui, -apple-system, sans-serif;
}

html, body {
  min-height: 100%;
  height: 100%;
  font-family: var(--reg-font);
  background: var(--reg-bg);
  color: var(--reg-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(167, 139, 250, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(124, 58, 237, 0.06), transparent 50%),
    linear-gradient(180deg, #f8fafc 0%, var(--reg-bg) 100%);
}

.reg-page {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  margin: 0 auto;
}

.reg-topbar {
  width: 100%;
  max-width: 720px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.reg-back {
  position: absolute;
  left: 0;
  top: 4px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--reg-border);
  background: var(--reg-surface);
  color: var(--reg-muted);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.reg-back:hover {
  border-color: var(--reg-border-focus);
  color: var(--reg-primary);
  background: var(--reg-primary-soft);
}

/* nlpchatbot.php sb-header-title — birebir EstoriX logosu */
.reg-brand-block {
  text-align: center;
}

.reg-brand-title {
  margin: 0;
  font-family: var(--reg-font);
  font-size: 24px;
  font-weight: 700;
  color: var(--reg-text);
  letter-spacing: -0.035em;
  line-height: 1;
  font-feature-settings: "cv01", "cv03";
  -webkit-font-smoothing: antialiased;
}

.reg-brand-x {
  color: transparent;
  background: linear-gradient(135deg, #a78bfa, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
}

.reg-brand-tagline {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--reg-muted);
  letter-spacing: 0.01em;
}

.reg-shell {
  width: 100%;
  max-width: 720px;
  flex-shrink: 0;
  margin: 0 auto;
}

.reg-card {
  background: var(--reg-surface);
  border: 1px solid var(--reg-border);
  border-radius: var(--reg-radius-lg);
  box-shadow: var(--reg-shadow);
  padding: 32px 28px 28px;
}

.reg-step-head {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f1f5f9;
}

.reg-step-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--reg-primary-soft);
  border: 1px solid rgba(124, 58, 237, 0.12);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--reg-primary);
  margin-bottom: 10px;
}

.reg-step-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--reg-text);
  margin-bottom: 6px;
}

.reg-step-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--reg-muted);
}

.reg-progress {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.reg-progress-dot {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: #e2e8f0;
  transition: background 0.25s;
}

.reg-progress-dot.is-active,
.reg-progress-dot.is-done {
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.reg-step { display: none; animation: regFade 0.35s ease; }
.reg-step.is-active { display: block; }

@keyframes regFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.reg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.reg-field { display: flex; flex-direction: column; gap: 6px; }
.reg-field--full { grid-column: 1 / -1; }

.reg-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.reg-input, .reg-select {
  width: 100%;
  border: 1px solid var(--reg-border);
  border-radius: var(--reg-radius);
  background: #fafbfc;
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  color: var(--reg-text);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.reg-input::placeholder { color: #94a3b8; }

.reg-input:hover, .reg-select:hover {
  border-color: #cbd5e1;
  background: #fff;
}

.reg-input:focus, .reg-select:focus {
  outline: none;
  border-color: var(--reg-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.reg-phone-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--reg-border);
  border-radius: var(--reg-radius);
  background: #fafbfc;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.reg-phone-wrap:hover {
  border-color: #cbd5e1;
  background: #fff;
}

.reg-phone-prefix {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-right: 1px solid var(--reg-border);
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  white-space: nowrap;
  background: #f8fafc;
}

.reg-phone-wrap .reg-input {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.reg-phone-wrap:focus-within {
  border-color: var(--reg-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.reg-pwd-wrap { position: relative; }
.reg-pwd-wrap .reg-input { padding-right: 44px; }

.reg-pwd-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.reg-pwd-toggle:hover {
  color: var(--reg-primary);
  background: var(--reg-primary-soft);
}

.reg-terms-hint {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: var(--reg-radius);
  background: #f0fdfa;
  border: 1px solid #ccfbf1;
  font-size: 13px;
  line-height: 1.55;
  color: #475569;
}

textarea.reg-input {
  resize: vertical;
  min-height: 84px;
  font: inherit;
}

input.reg-input[type="file"] {
  padding: 10px 12px;
  font-size: 13px;
}

.reg-terms-hint.is-ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.reg-terms-pending__icon {
  background: #f0fdfa !important;
  color: #0f766e !important;
}

.reg-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}

.reg-btn {
  border: none;
  border-radius: var(--reg-radius);
  padding: 13px 24px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.reg-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.reg-btn--primary {
  background: var(--reg-primary);
  color: #fff;
  min-width: 160px;
  box-shadow: 0 1px 2px rgba(124, 58, 237, 0.2), 0 4px 14px rgba(124, 58, 237, 0.22);
}

.reg-btn--primary:hover:not(:disabled) {
  background: var(--reg-primary-hover);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.28);
}

.reg-btn--primary:active:not(:disabled) { transform: translateY(1px); }

.reg-btn--wide { width: 100%; max-width: 360px; }

.reg-settings-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.reg-preview-box {
  padding: 20px;
  border-radius: var(--reg-radius);
  background: linear-gradient(180deg, #faf5ff 0%, #f8fafc 100%);
  border: 1px solid #ede9fe;
  text-align: center;
}

.reg-preview-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--reg-muted);
  margin-bottom: 8px;
}

.reg-preview-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--reg-text);
  font-variant-numeric: tabular-nums;
}

.reg-err {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--reg-radius);
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.45;
}

/* Başarı ekranı */
.reg-step--success {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
  padding: 8px 0 4px;
}

.reg-success-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(167, 139, 250, 0.08));
  border: 1px solid rgba(124, 58, 237, 0.15);
  color: var(--reg-primary);
}

.reg-success-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--reg-text);
  margin-bottom: 8px;
}

.reg-success-lead, .reg-success-sub {
  font-size: 14px;
  color: var(--reg-muted);
  line-height: 1.55;
}

.reg-success-sub { margin-bottom: 24px; }

.reg-pin-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}

.reg-pin-digit {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--reg-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--reg-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.reg-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.reg-modal-backdrop.is-open { display: flex; }

.reg-modal {
  width: 100%;
  max-width: 440px;
  background: var(--reg-surface);
  border: 1px solid var(--reg-border);
  border-radius: var(--reg-radius-lg);
  padding: 28px 24px 24px;
  box-shadow: var(--reg-shadow);
  animation: regFade 0.25s ease;
}

.reg-modal h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  text-align: center;
  color: var(--reg-text);
}

.reg-modal p {
  font-size: 14px;
  color: var(--reg-muted);
  text-align: center;
  margin-bottom: 22px;
  line-height: 1.55;
}

.reg-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reg-modal-actions .reg-btn { width: 100%; }

.reg-btn--locked {
  gap: 10px;
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  box-shadow: 0 4px 14px rgba(75, 85, 99, 0.35);
}

.reg-btn--locked:hover:not(:disabled) {
  background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
  transform: translateY(-1px);
}

.reg-btn__lock-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.reg-custom-lock-hint {
  margin: -2px 0 4px;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  color: #9ca3af;
}

.reg-custom-pending {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.reg-custom-pending.is-open { display: flex; }

.reg-custom-pending__card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}

.reg-custom-pending__lock {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}

.reg-custom-pending__lock svg {
  width: 26px;
  height: 26px;
}

.reg-custom-pending__card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  color: #111827;
}

.reg-custom-pending__card p {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.55;
  color: #4b5563;
}

.reg-custom-pending__hint {
  font-size: 12px !important;
  color: #9ca3af !important;
}

.reg-btn--ghost {
  background: #f8fafc;
  color: #334155;
  border: 1px solid var(--reg-border);
}

.reg-btn--ghost:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.reg-loading {
  position: fixed;
  inset: 0;
  background: rgba(248, 250, 252, 0.82);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  font-size: 14px;
  font-weight: 500;
  color: var(--reg-muted);
  gap: 12px;
}

.reg-loading.is-open { display: flex; }

.reg-loading::before {
  content: "";
  width: 22px;
  height: 22px;
  border: 2px solid rgba(124, 58, 237, 0.15);
  border-top-color: var(--reg-primary);
  border-radius: 50%;
  animation: regSpin 0.7s linear infinite;
}

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

@media (max-width: 768px) {
  .reg-page {
    justify-content: center;
    padding: 16px;
  }
  .reg-card { padding: 24px 18px 20px; }
  .reg-grid { grid-template-columns: 1fr; }
  .reg-settings-row { grid-template-columns: 1fr; }
  .reg-preview-value { font-size: 26px; }
  .reg-pin-digit { width: 42px; height: 42px; font-size: 17px; }
  .reg-actions { justify-content: stretch; }
  .reg-btn--primary { width: 100%; }
}

@media (max-height: 820px) {
  .reg-page {
    justify-content: flex-start;
    padding-top: 20px;
    padding-bottom: 20px;
  }
}
