/* SimpleAuth — OpenClaw Design System */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root {
  --bg: #09090B;
  --card: #111114;
  --accent: #479864;
  --accent-hover: #3d8557;
  --text: #D4D4D8;
  --text-strong: #FAFAFA;
  --muted: #71717A;
  --border: rgba(255,255,255,0.05);
  --border-medium: rgba(255,255,255,0.06);
  --input-bg: rgba(255,255,255,0.04);
  --danger: #EF4444;
  --danger-muted: rgba(239,68,68,0.08);
  --radius: 10px;
  --radius-sm: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

/* ── Auth Screen ── */
.auth-screen {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 36px 32px;
}

/* ── Brand ── */
.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo {
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
}

.auth-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -0.01em;
}

.auth-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── Error ── */
.auth-error {
  background: var(--danger-muted);
  border: 1px solid rgba(239,68,68,0.2);
  color: #FCA5A5;
  font-size: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  line-height: 1.4;
}

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

.auth-field {
  display: grid;
  gap: 6px;
}

.auth-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.auth-field input {
  background: var(--input-bg);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-strong);
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s;
}

.auth-field input:focus {
  border-color: var(--accent);
}

.auth-field input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.auth-btn {
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 20px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.01em;
}

.auth-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-link {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
}

.auth-link a {
  color: var(--accent);
  text-decoration: none;
}

.auth-link a:hover {
  text-decoration: underline;
}

/* ── Password strength indicator ── */
.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.password-strength-bar {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--border-medium);
  transition: background 0.2s;
}

.password-strength-bar.active { background: var(--danger); }
.password-strength-bar.medium { background: #F59E0B; }
.password-strength-bar.strong { background: var(--accent); }

.password-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* ════════════════════════════════════════════
   WIZARD (Setup multi-step)
   ════════════════════════════════════════════ */

.wizard-card {
  background: var(--card);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 32px;
  max-width: 520px;
  width: 100%;
}

/* ── Stepper ── */
.wizard-stepper {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
}

.wizard-stepper-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 48px;
}

.wizard-stepper-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s;
  border: 1px solid var(--border-medium);
  background: var(--bg);
  color: var(--muted);
}

.wizard-stepper-item.active .wizard-stepper-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.wizard-stepper-item.done .wizard-stepper-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.wizard-stepper-label {
  font-size: 10px;
  margin-top: 5px;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.wizard-stepper-item.active .wizard-stepper-label {
  color: var(--text-strong);
  font-weight: 600;
}

.wizard-stepper-item.done .wizard-stepper-label {
  color: var(--accent);
}

.wizard-stepper-line {
  width: 20px;
  height: 1px;
  background: var(--border-medium);
  margin: 13px 2px 0;
  transition: background 0.2s;
  flex-shrink: 0;
}

.wizard-stepper-line.done {
  background: var(--accent);
}

/* ── Step content ── */
.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
}

.wizard-step-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 6px;
}

.wizard-step-desc {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 22px;
  line-height: 1.5;
}

/* ── Navigation buttons ── */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  gap: 12px;
}

.wizard-btn-back {
  background: none;
  border: 1px solid var(--border-medium);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.wizard-btn-back:hover {
  border-color: rgba(255,255,255,0.12);
  color: var(--text-strong);
}

.wizard-btn-next {
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 9px 22px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  margin-left: auto;
}

.wizard-btn-next:hover:not(:disabled) {
  background: var(--accent-hover);
}

.wizard-btn-next:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wizard-btn-skip {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  padding: 6px 10px;
}

.wizard-btn-skip:hover {
  color: var(--text);
}

/* ── Option cards (for model/platform selection) ── */
.wizard-options {
  display: grid;
  gap: 10px;
}

.wizard-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.wizard-option:hover {
  border-color: rgba(255,255,255,0.1);
}

.wizard-option.selected {
  border-color: var(--accent);
  background: rgba(71,152,100,0.06);
}

.wizard-option-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wizard-option-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wizard-option-text {
  flex: 1;
}

.wizard-option-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-strong);
}

.wizard-option-desc {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.wizard-option-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.wizard-option.selected .wizard-option-check {
  background: var(--accent);
  border-color: var(--accent);
}

/* ── Platform toggles ── */
.wizard-platform {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius);
}

.wizard-platform-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-strong);
}

.wizard-platform-hint {
  font-size: 11px;
  color: var(--muted);
}

/* ── Summary (step 5) ── */
.wizard-summary {
  display: grid;
  gap: 12px;
}

.wizard-summary-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.wizard-summary-label {
  color: var(--muted);
}

.wizard-summary-value {
  color: var(--text-strong);
  font-weight: 500;
}

/* ── Features list (welcome step) ── */
.wizard-features {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.wizard-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text);
}

.wizard-feature-icon {
  color: var(--accent);
  flex-shrink: 0;
}

/* ════════════════════════════════════════════
   PLAN CARD (Payment step)
   ════════════════════════════════════════════ */

.wizard-plan-card {
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.wizard-plan-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 0 0 0 8px;
  letter-spacing: 0.02em;
}

.wizard-plan-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 8px;
}

.wizard-plan-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-bottom: 18px;
}

.wizard-plan-currency {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-strong);
}

.wizard-plan-amount {
  font-size: 40px;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1;
}

.wizard-plan-period {
  font-size: 13px;
  color: var(--muted);
}

.wizard-plan-features {
  display: grid;
  gap: 10px;
}

.wizard-plan-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
}

/* ════════════════════════════════════════════
   STATUS ICON (Approval step)
   ════════════════════════════════════════════ */

.wizard-status-icon {
  text-align: center;
  margin-bottom: 20px;
}

.wizard-status-icon.success {
  color: var(--accent);
}

.wizard-status-icon.error {
  color: var(--danger);
}

/* ════════════════════════════════════════════
   SUMMARY ROW
   ════════════════════════════════════════════ */

.wizard-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.wizard-summary-row:last-child {
  border-bottom: none;
}

/* ════════════════════════════════════════════
   DEPLOY PROGRESS (Deploy step)
   ════════════════════════════════════════════ */

.wizard-deploy-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.wizard-deploy-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.wizard-deploy-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.wizard-deploy-percent {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
  min-width: 36px;
  text-align: right;
}

/* ── Deploy log ── */
.wizard-deploy-log {
  display: grid;
  gap: 8px;
}

.wizard-deploy-log-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  transition: all 0.2s;
}

.wizard-deploy-log-item .wizard-deploy-log-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border-medium);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: all 0.2s;
}

.wizard-deploy-log-item.active {
  color: var(--text-strong);
  background: rgba(71,152,100,0.06);
}

.wizard-deploy-log-item.active .wizard-deploy-log-icon {
  border-color: var(--accent);
  background: rgba(71,152,100,0.15);
  box-shadow: 0 0 0 3px rgba(71,152,100,0.1);
}

.wizard-deploy-log-item.active .wizard-deploy-log-icon::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: deployPulse 1s ease-in-out infinite;
}

.wizard-deploy-log-item.done {
  color: var(--accent);
}

.wizard-deploy-log-item.done .wizard-deploy-log-icon {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.wizard-deploy-log-item.done .wizard-deploy-log-icon::after {
  content: "\2713";
  font-size: 10px;
  font-weight: 700;
}

@keyframes deployPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ════════════════════════════════════════════
   ACCESS (Final step)
   ════════════════════════════════════════════ */

.wizard-success-icon {
  text-align: center;
  color: var(--accent);
  margin-bottom: 16px;
}

.wizard-access-url {
  text-align: center;
  margin: 20px 0;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius);
}

.wizard-access-url-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}

.wizard-access-url-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

.wizard-access-url-link:hover {
  text-decoration: underline;
}

/* ── Credentials display ── */

.wizard-credentials {
  margin-top: 16px;
  padding: 14px 16px;
  background: rgba(71, 152, 100, 0.08);
  border: 1px solid rgba(71, 152, 100, 0.25);
  border-radius: var(--radius);
  text-align: left;
}

.wizard-credentials-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wizard-credentials-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.wizard-credentials-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.wizard-credentials-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--border-medium);
  user-select: all;
  letter-spacing: 0.5px;
}

.wizard-credentials-hint {
  font-size: 11px;
  color: var(--danger);
  font-style: italic;
}

/* ════════════════════════════════════════════
   RESPONSIVE — 8-step stepper
   ════════════════════════════════════════════ */

@media (max-width: 620px) {
  .auth-card, .wizard-card { padding: 24px 18px; }
  .wizard-stepper-item { min-width: auto; }
  .wizard-stepper-label { display: none; }
  .wizard-stepper-circle { width: 24px; height: 24px; font-size: 10px; }
  .wizard-stepper-line { width: 12px; }
}

@media (max-width: 520px) {
  .auth-card, .wizard-card { padding: 20px 14px; }
  .wizard-stepper-circle { width: 22px; height: 22px; font-size: 9px; }
  .wizard-stepper-line { width: 8px; }
  .wizard-plan-amount { font-size: 32px; }
}
