/**
 * Installer Wizard — Premium dark gradient theme
 * Standalone CSS (no Vite/Tailwind pipeline)
 */

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; line-height: 1.5; }
body { font-family: 'Rubik', system-ui, -apple-system, sans-serif; color: #e2e8f0; background: #0f0f0f; min-height: 100vh; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
ul, ol { list-style: none; padding: 0; }

/* === Variables === */
:root {
  --primary: #8d523f;
  --primary-dark: #6b3d2e;
  --primary-light: #a86b56;
  --accent: #c97a5e;
  --surface: #1a1a1a;
  --surface-elevated: #222222;
  --surface-hover: #2a2a2a;
  --border: #333333;
  --border-light: #444444;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* === Animated Gradient Background === */
.installer-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(-45deg, #0f0f0f, #1a1a1a, #2d1f1a, #1a0f0a, #0f0f0f);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  position: relative;
  overflow: hidden;
}

.installer-bg::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(141, 82, 63, 0.08) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(141, 82, 63, 0.05) 0%, transparent 50%);
  animation: gradientOrb 20s ease-in-out infinite;
  pointer-events: none;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes gradientOrb {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(120deg); }
  66% { transform: translate(-20px, 20px) rotate(240deg); }
}

/* === Wrapper === */
.installer-wrapper {
  width: 100%;
  max-width: 560px;
  position: relative;
  z-index: 1;
}

/* === Card === */
.installer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.installer-card-header {
  padding: 32px 32px 0;
}

.installer-card-body {
  padding: 24px 32px 32px;
}

/* === Title === */
.installer-title {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 0;
  letter-spacing: -0.01em;
}

/* === Footer text === */
.installer-footer-text {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 20px;
}

/* === Step Track === */
.installer-track {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-bottom: 28px;
  gap: 0;
}

.installer-track li {
  display: flex;
  align-items: center;
}

.installer-track li:last-child .track-line {
  display: none;
}

.installer-track li::after {
  content: '';
  width: 32px;
  height: 2px;
  background: var(--border);
  transition: background 0.3s ease;
}

.installer-track li:last-child::after {
  display: none;
}

.installer-track li.done::after {
  background: var(--primary);
}

.installer-track li i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 0.8rem;
  border: 2px solid var(--border);
  color: var(--text-muted);
  background: var(--surface);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.installer-track li.done {
  cursor: pointer;
}

.installer-track li.done i {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary-light);
}

.installer-track li.active i {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(141, 82, 63, 0.2);
}

/* === Divider === */
.installer-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 4px 0 24px;
}

/* === Form Elements === */
.form-group {
  margin-bottom: 20px;
}

.form-group:last-of-type {
  margin-bottom: 28px;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

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

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(141, 82, 63, 0.15);
}

.form-input.is-invalid {
  border-color: var(--danger);
}

.form-error {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--danger);
  font-weight: 500;
}

.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--muted-foreground, #94a3b8);
  font-weight: 400;
  line-height: 1.4;
}

/* === Alert === */
.installer-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-xs);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  margin-bottom: 20px;
  font-size: 0.8125rem;
  color: #fca5a5;
}

.installer-alert i {
  flex-shrink: 0;
  margin-top: 1px;
}

.installer-alert-close {
  margin-left: auto;
  background: none;
  border: none;
  color: #fca5a5;
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.installer-alert-close:hover {
  opacity: 1;
}

/* === Checklist (Requirements / Permissions) === */
.installer-checklist {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 24px;
}

.installer-checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.installer-checklist-header h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.installer-checklist-header .version-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--success);
}

.installer-checklist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.installer-checklist-item:last-child {
  border-bottom: none;
}

.installer-checklist-item:hover {
  background: var(--surface-hover);
}

.installer-checklist-item span {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.installer-checklist-item .check-icon {
  font-size: 0.875rem;
}

.check-icon.success { color: var(--success); }
.check-icon.danger { color: var(--danger); }

/* === Buttons === */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  min-height: 44px;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(141, 82, 63, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary i {
  font-size: 0.75rem;
}

.btn-center {
  display: flex;
  justify-content: center;
}

/* === Info Card (Final page login info) === */
.info-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 28px;
}

.info-card-header {
  padding: 12px 16px;
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.info-card-body {
  padding: 14px 16px;
}

.info-card-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.info-card-row strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* === Success message === */
.success-message {
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
  color: var(--success);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* === Welcome message === */
.welcome-message {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.6;
}

/* === Responsive === */
@media (max-width: 640px) {
  .installer-bg {
    padding: 16px 12px;
    align-items: flex-start;
    padding-top: 32px;
  }

  .installer-card-header {
    padding: 24px 20px 0;
  }

  .installer-card-body {
    padding: 20px 20px 24px;
  }

  .installer-title {
    font-size: 1.2rem;
  }

  .installer-track li::after {
    width: 20px;
  }

  .installer-track li i {
    width: 32px;
    height: 32px;
    font-size: 0.7rem;
  }

  .btn-primary {
    width: 100%;
  }
}
