/* ==========================================================================
   eClass Installer -- Split Layout Design
   Sidebar: #1a2332 | Active: #FF7350 | Completed: #28a745
   ========================================================================== */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, 'Segoe UI', system-ui, Roboto, Helvetica, Arial, sans-serif;
  color: #29303B;
  background: #F7F8FA;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Split Container ---------- */
.installer-container {
  display: flex;
  min-height: 100vh;
}

/* ---------- Left Sidebar ---------- */
.installer-sidebar {
  width: 350px;
  min-width: 350px;
  background: #1a2332;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 40px 32px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 10;
  overflow-y: auto;
}

/* -- Sidebar brand -- */
.sidebar-brand {
  margin-bottom: 48px;
}
.sidebar-brand img {
  max-height: 40px;
  width: auto;
  display: block;
  margin-bottom: 16px;
}
.sidebar-brand h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 16px;
  letter-spacing: -0.5px;
}
.sidebar-brand p {
  font-size: 14px;
  color: rgba(255,255,255,0.55);
  line-height: 1.6;
  margin: 0;
}

/* -- Sidebar Step List (vertical) -- */
.sidebar-steps {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-steps .step {
  display: flex;
  align-items: flex-start;
  position: relative;
  padding-bottom: 36px;
}

.sidebar-steps .step:last-child {
  padding-bottom: 0;
}

/* Vertical connecting line */
.sidebar-steps .step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 38px;
  bottom: 0;
  width: 2px;
  background: #2d3a4a;
}
.sidebar-steps .step.completed:not(:last-child)::before {
  background: #28a745;
}
.sidebar-steps .step.active:not(:last-child)::before {
  background: linear-gradient(to bottom, #FF7350 0%, #2d3a4a 100%);
}

/* Step circle */
.sidebar-steps .step-circle {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  margin-right: 16px;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

/* Pending */
.sidebar-steps .step.pending .step-circle {
  background: #2d3a4a;
  color: #5a6a7e;
  border: 2px solid #3a4a5e;
}

/* Active */
.sidebar-steps .step.active .step-circle {
  background: #FF7350;
  color: #fff;
  border: 2px solid #FF7350;
  box-shadow: 0 0 0 5px rgba(255,115,80,0.25), 0 0 20px rgba(255,115,80,0.2);
}

/* Completed */
.sidebar-steps .step.completed .step-circle {
  background: #28a745;
  color: #fff;
  border: 2px solid #28a745;
}
.sidebar-steps .step.completed .step-circle .check-svg {
  display: inline-block;
}

/* Step text */
.sidebar-steps .step-info {
  padding-top: 6px;
}
.sidebar-steps .step-label {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  line-height: 1.2;
  margin: 0;
  transition: color 0.3s;
}
.sidebar-steps .step.active .step-label {
  color: #fff;
}
.sidebar-steps .step.completed .step-label {
  color: rgba(255,255,255,0.7);
}
.sidebar-steps .step-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.25);
  margin-top: 4px;
  line-height: 1.4;
}
.sidebar-steps .step.active .step-desc {
  color: rgba(255,255,255,0.5);
}
.sidebar-steps .step.completed .step-desc {
  color: rgba(255,255,255,0.35);
}

/* -- Sidebar footer -- */
.sidebar-footer {
  margin-top: auto;
  padding-top: 32px;
  font-size: 12px;
  color: rgba(255,255,255,0.25);
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ---------- Right Content Area ---------- */
.installer-content {
  flex: 1;
  margin-left: 350px;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #F7F8FA;
}

/* -- Content header (page title) -- */
.content-header {
  margin-bottom: 32px;
}
.content-header h3 {
  font-size: 26px;
  font-weight: 700;
  color: #1a2332;
  margin: 0 0 6px;
  letter-spacing: -0.3px;
}
.content-header p {
  font-size: 15px;
  color: #6b7280;
  margin: 0;
}

/* -- Content card -- */
.installer-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 24px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.05);
  overflow: hidden;
  flex: 1;
}
.installer-card-body {
  padding: 36px;
}

/* -- Section titles inside card -- */
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: #29303B;
  margin-bottom: 4px;
}
.section-divider {
  height: 3px;
  width: 40px;
  background: #FF7350;
  border-radius: 2px;
  margin: 8px 0 24px;
  border: none;
}

/* ---------- Form Styling ---------- */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}
.form-group label .text-muted {
  font-weight: 400;
  font-size: 12px;
}
.form-control {
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: #29303B;
  background: #F7F8FA;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  width: 100%;
  height: auto;
}
.form-control:focus {
  border-color: #FF7350;
  box-shadow: 0 0 0 3px rgba(255,115,80,0.12);
  background: #fff;
  outline: none;
}
.form-control::placeholder {
  color: #9ca3af;
}

/* ---------- Password eye toggle ---------- */
.eyeCy {
  position: relative;
}
.eyeCy .fa-eye,
.eyeCy .fa-eye-slash {
  position: absolute;
  top: 40px;
  right: 14px;
  font-size: 15px;
  color: #9ca3af;
  cursor: pointer;
  z-index: 2;
  transition: color 0.2s;
}
.eyeCy .fa-eye:hover,
.eyeCy .fa-eye-slash:hover {
  color: #FF7350;
}

/* ---------- Buttons ---------- */
.btn-primary,
.btn-install {
  background: linear-gradient(135deg, #FF7350 0%, #e85d3a 100%);
  border: none;
  color: #fff;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s;
  letter-spacing: 0.2px;
}
.btn-primary:hover,
.btn-install:hover {
  background: linear-gradient(135deg, #e85d3a 0%, #d04e2e 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255,115,80,0.35);
  color: #fff;
}
.btn-primary:active,
.btn-install:active {
  transform: translateY(0);
}
.btn-primary:focus,
.btn-install:focus {
  box-shadow: 0 0 0 3px rgba(255,115,80,0.3);
}
.btn-secondary {
  background: #F7F8FA;
  border: 1.5px solid #e5e7eb;
  color: #4b5563;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover {
  background: #e5e7eb;
  color: #29303B;
}

/* ---------- Checkbox (EULA) ---------- */
.custom-checkbox-group {
  background: #F7F8FA;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
}
.custom-checkbox-group .custom-control-label {
  cursor: pointer;
  font-size: 13px;
  line-height: 1.6;
  color: #4b5563;
}
.custom-checkbox-group .custom-control-label b {
  color: #29303B;
}
.custom-checkbox-group .custom-control-input:checked ~ .custom-control-label::before {
  background-color: #FF7350;
  border-color: #FF7350;
}

/* ---------- EULA text ---------- */
.eula-text {
  background: #F7F8FA;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px 24px;
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 24px;
  font-size: 13px;
  line-height: 1.7;
  color: #4b5563;
}
.eula-text::-webkit-scrollbar {
  width: 6px;
}
.eula-text::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}
.eula-text p {
  margin-bottom: 12px;
}

/* ---------- Help link ---------- */
.help-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0284A2;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}
.help-link:hover {
  color: #FF7350;
  text-decoration: underline;
}

/* ---------- Error display ---------- */
.error-alert {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ---------- Content footer ---------- */
.installer-footer {
  text-align: center;
  padding: 24px 0 12px;
  font-size: 13px;
  color: #6b7280;
  margin-top: auto;
}
.installer-footer a {
  color: #0284A2;
  text-decoration: none;
  font-weight: 500;
}
.installer-footer a:hover {
  text-decoration: underline;
}

/* ---------- Preloader ---------- */
.preL {
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  position: fixed;
  z-index: 99999;
  display: flex !important;
  align-items: center;
  justify-content: center;
}
.preL.display-none {
  display: none !important;
}
.preloader3 {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top: 4px solid #FF7350;
  border-radius: 50%;
  animation: preloader-spin 0.8s linear infinite;
}
.preloader3.display-none {
  display: none !important;
}
@keyframes preloader-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.display-none {
  display: none;
}

/* ---------- Progress Page: Step List ---------- */
.install-step {
  padding: 14px 18px;
  margin-bottom: 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F7F8FA;
  border: 1.5px solid #e5e7eb;
  transition: all 0.3s ease;
}
.install-step.active {
  background: #fff7ed;
  border-color: #FF7350;
}
.install-step.completed {
  background: #f0fdf4;
  border-color: #86efac;
}
.install-step.failed {
  background: #fef2f2;
  border-color: #fca5a5;
}
.install-step .step-label {
  font-weight: 500;
  color: #29303B;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}
.install-step .step-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.install-step .step-icon.pending {
  background: #e5e7eb;
  color: #6c757d;
}
.install-step .step-icon.running {
  background: #FF7350;
  color: #fff;
}
.install-step .step-icon.done {
  background: #28a745;
  color: #fff;
}
.install-step .step-icon.error {
  background: #dc3545;
  color: #fff;
}
.install-step .step-status {
  font-size: 13px;
  color: #9ca3af;
  font-weight: 500;
}
.install-step.active .step-status {
  color: #FF7350;
}
.install-step.completed .step-status {
  color: #28a745;
}
.install-step.failed .step-status {
  color: #dc3545;
}

/* Spinner */
@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.fa-spinner {
  animation: spin 1s linear infinite;
}

/* Progress bar */
.install-progress-bar {
  height: 8px;
  border-radius: 6px;
  background: #e5e7eb;
  overflow: hidden;
  margin-bottom: 24px;
}
.install-progress-bar .bar {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #FF7350, #28a745);
  transition: width 0.6s ease;
  width: 0%;
}

/* Error detail box */
.error-detail {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  padding: 14px 18px;
  margin-top: 16px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #991b1b;
  word-break: break-word;
  max-height: 160px;
  overflow-y: auto;
  display: none;
}

/* Success box */
.success-box {
  text-align: center;
  padding: 32px 24px;
  display: none;
}
.success-box .fa-check-circle {
  font-size: 64px;
  color: #28a745;
  margin-bottom: 16px;
}
.success-box h4 {
  color: #28a745;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}
.success-box p {
  color: #6b7280;
  margin-bottom: 24px;
  font-size: 15px;
}

/* Status text */
.status-text {
  text-align: center;
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 20px;
  min-height: 20px;
  font-weight: 500;
}

/* ---------- Validation feedback ---------- */
.was-validated .form-control:valid {
  border-color: #28a745;
}
.was-validated .form-control:invalid {
  border-color: #dc3545;
}
.valid-feedback {
  color: #28a745;
  font-size: 12px;
  margin-top: 4px;
}
.invalid-feedback {
  color: #dc3545;
  font-size: 12px;
  margin-top: 4px;
}

/* ---------- Alerts ---------- */
.alert-secondary {
  color: #383d41;
  background-color: #F7F8FA;
  border-color: #e5e7eb;
  border-radius: 10px;
}

/* ---------- Scroll box ---------- */
.scroll-down {
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ---------- Card override (legacy compat) ---------- */
.card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

/* ---------- Mobile: horizontal progress bar ---------- */
.mobile-progress {
  display: none;
}

@media (max-width: 991px) {
  /* Hide fixed sidebar */
  .installer-sidebar {
    display: none;
  }

  /* Show mobile progress bar */
  .mobile-progress {
    display: block;
    background: #1a2332;
    padding: 20px 24px 24px;
  }
  .mobile-progress .mobile-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
  }
  .mobile-progress .mobile-brand img {
    height: 32px;
    width: auto;
  }
  .mobile-progress .mobile-brand h2 {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
  }
  .mobile-progress .progress-steps {
    display: flex;
    align-items: center;
    gap: 0;
    justify-content: center;
  }
  .mobile-progress .progress-step {
    display: flex;
    align-items: center;
  }
  .mobile-progress .progress-dot {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.3s;
  }
  .mobile-progress .progress-dot.pending {
    background: #2d3a4a;
    color: #5a6a7e;
    border: 2px solid #3a4a5e;
  }
  .mobile-progress .progress-dot.active {
    background: #FF7350;
    color: #fff;
    border: 2px solid #FF7350;
    box-shadow: 0 0 0 4px rgba(255,115,80,0.25);
  }
  .mobile-progress .progress-dot.completed {
    background: #28a745;
    color: #fff;
    border: 2px solid #28a745;
  }
  .mobile-progress .progress-line {
    width: 32px;
    height: 2px;
    background: #2d3a4a;
    flex-shrink: 0;
  }
  .mobile-progress .progress-line.done {
    background: #28a745;
  }
  .mobile-progress .step-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding: 0 2px;
  }
  .mobile-progress .step-labels span {
    font-size: 10px;
    color: rgba(255,255,255,0.35);
    text-align: center;
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
  }
  .mobile-progress .step-labels span.is-active {
    color: #FF7350;
  }
  .mobile-progress .step-labels span.is-done {
    color: rgba(255,255,255,0.6);
  }

  /* Content fills full width */
  .installer-content {
    margin-left: 0;
    padding: 24px 20px;
  }

  .content-header h3 {
    font-size: 22px;
  }

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

  .btn-install {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .installer-content {
    padding: 16px 12px;
  }
  .installer-card-body {
    padding: 20px 16px;
  }
  .mobile-progress .progress-line {
    width: 20px;
  }
  .mobile-progress .progress-dot {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 12px;
  }
}
