/* ============================================================
   PayFlow — Installation Wizard CSS
   ============================================================ */

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

body.install-wrapper {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, #eef2ff 0%, #e0f2fe 50%, #f0f9ff 100%);
  color: #1e293b;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

a {
  color: #6366f1;
  text-decoration: none;
}

a:hover {
  color: #4f46e5;
}

/* ── Install Container ────────────────────────────────────── */

.install-container {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
}

/* ── Brand Header ─────────────────────────────────────────── */

.install-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.install-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}

.install-brand svg {
  width: 40px;
  height: 40px;
  color: #6366f1;
  flex-shrink: 0;
}

.install-brand span {
  font-size: 1.5rem;
  font-weight: 700;
  color: #6366f1;
}

/* ── Step Indicator ───────────────────────────────────────── */

.install-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.5rem;
  padding: 0 1rem;
}

.install-steps .step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.install-steps .step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #94a3b8;
  transition: all 0.3s;
  flex-shrink: 0;
}

.install-steps .step-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #94a3b8;
  white-space: nowrap;
  transition: color 0.3s;
}

.install-steps .step.active .step-number {
  background: #6366f1;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.install-steps .step.active .step-label {
  color: #6366f1;
  font-weight: 600;
}

.install-steps .step-divider {
  width: 40px;
  height: 2px;
  background: #e2e8f0;
  margin: 0 0.5rem;
  flex-shrink: 0;
}

/* ── Install Card ─────────────────────────────────────────── */

.install-content {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  padding: 2rem;
}

.install-card {
  width: 100%;
}

.install-card-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.install-card-header .card-icon {
  width: 56px;
  height: 56px;
  color: #6366f1;
  margin: 0 auto 0.75rem;
  display: block;
}

.install-card-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.25rem;
}

.install-card-header > p {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}

/* ── Radio Card Group ─────────────────────────────────────── */

.radio-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.radio-card {
  position: relative;
  display: block;
  cursor: pointer;
}

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

.radio-card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  transition: all 0.2s;
  text-align: center;
}

.radio-card-content svg {
  width: 40px;
  height: 40px;
  color: #64748b;
  flex-shrink: 0;
}

.radio-card:hover .radio-card-content {
  border-color: #c7d2fe;
  background: #fafaff;
}

.radio-card.selected .radio-card-content,
.radio-card input[type="radio"]:checked ~ .radio-card-content {
  border-color: #6366f1;
  background: #eef2ff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.radio-card.selected .radio-card-content svg,
.radio-card input[type="radio"]:checked ~ .radio-card-content svg {
  color: #6366f1;
}

.radio-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1e293b;
}

.radio-card-desc {
  font-size: 0.75rem;
  color: #64748b;
}

/* ── Database Sections ────────────────────────────────────── */

.db-section {
  margin-top: 1.25rem;
}

/* ── Form ─────────────────────────────────────────────────── */

.install-form {
  width: 100%;
}

.form-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6366f1;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.install-form .form-group {
  margin-bottom: 1rem;
}

.install-form label,
.install-form .form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.375rem;
}

.install-form input[type="text"],
.install-form input[type="number"],
.install-form input[type="password"],
.install-form input[type="email"],
.install-form input[type="url"] {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  transition: all 0.2s;
  background: #fff;
  font-family: inherit;
  color: #1e293b;
  outline: none;
}

.install-form input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.install-form input::placeholder {
  color: #9ca3af;
}

.install-form input.input-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-error {
  font-size: 0.75rem;
  color: #ef4444;
  margin-top: 0.25rem;
  display: block;
}

/* ── Buttons ──────────────────────────────────────────────── */

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #f1f5f9;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}

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

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-primary {
  background: #6366f1;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid #e2e8f0;
  color: #475569;
}

.btn-outline:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #d1d5db;
}

.btn-success {
  background: #22c55e;
  color: #fff;
}

.btn-success:hover:not(:disabled) {
  background: #16a34a;
}

.btn-block {
  width: 100%;
}

/* ── Alerts ───────────────────────────────────────────────── */

.alert {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert p {
  margin: 0;
}

.alert code {
  background: rgba(0,0,0,0.06);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.8125rem;
}

.alert-success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.alert-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.alert-error ul {
  margin: 0;
  padding-left: 1.25rem;
}

.alert-warning {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.alert-info {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

/* ── Spinner ──────────────────────────────────────────────── */

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-dark {
  border-color: rgba(0,0,0,0.1);
  border-top-color: #6366f1;
}

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

/* ── Footer ───────────────────────────────────────────────── */

.install-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: #94a3b8;
}

/* ── Login extras ─────────────────────────────────────────── */

.form-row {
  display: flex;
  gap: 0.75rem;
}

.form-row-between {
  justify-content: space-between;
  align-items: center;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #475569;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #6366f1;
  cursor: pointer;
}

.btn-full {
  width: 100%;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 640px) {
  body.install-wrapper {
    padding: 1rem 0.75rem;
    align-items: flex-start;
  }

  .install-content {
    padding: 1.5rem;
  }

  .radio-group {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  .install-steps .step-label {
    display: none;
  }

  .install-steps .step-divider {
    width: 24px;
  }
}

/* ── Install success (completed) ──────────────────────────── */
.install-success-hero {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}
.install-success-hero .success-icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: #ecfdf5;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pf-pop 0.4s ease;
}
.install-success-hero .success-icon svg {
  width: 52px;
  height: 52px;
  color: #16a34a;
}
@keyframes pf-pop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}
.install-success-hero h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 0.4rem;
}
.install-success-hero p {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0 auto;
  max-width: 380px;
}
.install-success-note {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 0.6rem;
  padding: 0.85rem 1rem;
  margin: 1.5rem 0;
}
.install-success-note svg {
  width: 18px;
  height: 18px;
  color: #d97706;
  flex-shrink: 0;
  margin-top: 1px;
}
.install-success-note p {
  margin: 0;
  font-size: 0.82rem;
  color: #92400e;
  line-height: 1.5;
}
.form-actions-center {
  justify-content: center;
  border-top: none;
  padding-top: 0;
}
