/* Modern KSM Registration CSS System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary-color: #061d36;      /* Dashboard Deep Navy */
  --primary-light: #0d2c4e;
  --accent-color: #27ae60;       /* Success Green */
  --accent-light: #2ecc71;
  --bg-color: #f4f6f9;           /* Content Grey */
  --card-bg: #ffffff;
  --text-dark: #1e293b;          /* Slate Dark */
  --text-muted: #64748b;         /* Slate Muted */
  --border-color: #cbd5e1;       /* Light border */
  --focus-shadow: rgba(6, 29, 54, 0.15);
  --error-color: #e74c3c;
}

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

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
}

/* Header Navbar Styles */
.signup-header {
  background-color: var(--primary-color);
  padding: 15px 30px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
}

.header-content {
  width: 100%;
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-link {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.2s ease;
}

.back-link:hover {
  opacity: 0.8;
}

.back-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
}

.brand-text {
  text-align: left;
}

.brand-text h1 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

.brand-text p {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 400;
}

/* Page Wrapper */
.signup-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  min-height: calc(100vh - 72px);
}

/* Main Form Wrapper */
#msform {
  width: 100%;
  max-width: 900px;
  text-align: center;
  position: relative;
}

/* Stepper Progressbar */
#progressbar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 35px;
  counter-reset: step;
  width: 100%;
  padding: 0 10px;
}

#progressbar li {
  list-style-type: none;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
  width: 20%;
  position: relative;
  text-align: center;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}

#progressbar li:before {
  content: counter(step);
  counter-increment: step;
  width: 28px;
  line-height: 28px;
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  background: #e2e8f0;
  border-radius: 50%;
  margin: 0 auto 8px auto;
  font-weight: 700;
  transition: all 0.3s ease;
  border: 2px solid #e2e8f0;
  position: relative;
  z-index: 5;
}

/* Progressbar Connectors */
#progressbar li:after {
  content: '';
  width: 100%;
  height: 3px;
  background: #e2e8f0;
  position: absolute;
  left: -50%;
  top: 14px;
  z-index: 1;
  transition: background 0.3s ease;
}

#progressbar li:first-child:after {
  content: none;
}

/* Active & Completed States */
#progressbar li.active {
  color: var(--primary-color);
}

#progressbar li.active:before {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.2);
}

#progressbar li.active:after {
  background: var(--accent-color);
}

/* Fieldset/Card Styles */
#msform fieldset {
  background: var(--card-bg);
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  padding: 40px;
  box-sizing: border-box;
  width: 100%;
  position: relative;
  text-align: left;
}

/* Hide all except first fieldset */
#msform fieldset:not(:first-of-type) {
  display: none;
}

/* Fieldset Headers */
.card-header-custom {
  margin-bottom: 30px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 20px;
}

.fs-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 6px;
}

.fs-subtitle {
  font-weight: 400;
  font-size: 14px;
  color: var(--text-muted);
}

/* Form Layout Grid */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.form-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 220px;
}

/* Responsive columns */
.col-12 {
  flex: 0 0 100%;
  min-width: 100%;
}

.col-8 {
  flex: 0 0 calc(66.66% - 10px);
}

.col-6 {
  flex: 0 0 calc(50% - 10px);
}

.col-4 {
  flex: 0 0 calc(33.33% - 13.3px);
}

.col-3 {
  flex: 0 0 calc(25% - 15px);
}

@media (max-width: 768px) {
  .form-group {
    flex: 0 0 100% !important;
    min-width: 100% !important;
  }
  .form-row {
    gap: 15px;
  }
  #msform fieldset {
    padding: 24px 16px;
  }
  #progressbar li {
    font-size: 8px;
  }
}

/* Input Fields & Labels */
.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#msform input[type=text],
#msform input[type=email],
#msform input[type=date],
#msform input[type=number],
#msform textarea,
#msform select {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-dark);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: #fff;
  transition: all 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

#msform input[type=text]:focus,
#msform input[type=email]:focus,
#msform input[type=date]:focus,
#msform input[type=number]:focus,
#msform textarea:focus,
#msform select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--focus-shadow);
  background-color: #fff;
}

/* Dropdown/Select customization */
#msform select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 40px;
}

/* Conditional Containers */
.conditional-fields {
  background: #f8fafc;
  border-radius: 8px;
  padding: 20px;
  margin-top: 5px;
  margin-bottom: 5px;
  width: 100%;
}

.conditional-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Custom Checkbox/Radio */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  color: var(--text-dark);
  padding: 5px 0;
}

.checkbox-container input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent-color);
  cursor: pointer;
}

/* Inline Switch Container for office checking */
.switch-container {
  background: #f8fafc;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
}

.switch-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-color);
}

/* Input Display Conditional styling (siblings of checkbox) */
.input-display {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: scale(0.98);
  transition: all 0.3s ease;
  width: 100%;
}

input[type="checkbox"]:checked ~ .input-display {
  opacity: 1;
  max-height: 160px;
  transform: scale(1);
  margin-top: 10px;
  overflow: visible;
}

/* Actions Buttons & Footer */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #f1f5f9;
}

#msform .action-button {
  min-width: 110px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  outline: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

#msform .next.action-button, 
#msform .submit.action-button {
  background-color: var(--accent-color);
  color: #fff;
}

#msform .next.action-button:hover,
#msform .submit.action-button:hover:not(:disabled) {
  background-color: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(39, 174, 96, 0.2);
}

#msform .previous.action-button {
  background-color: #fff;
  color: var(--text-dark);
  border: 1px solid var(--border-color);
}

#msform .previous.action-button:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

#msform .submit.action-button:disabled {
  background-color: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Availability Loader/Badge positioning */
.input-with-loader {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.loader-gif {
  position: absolute;
  right: 12px;
  width: 20px;
  height: 20px;
}

.availability-status {
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
  display: block;
}

.status-available {
  color: var(--accent-color);
}

.status-not-available {
  color: var(--error-color);
}

/* Terms and conditions specific card styles */
.terms-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  max-height: 200px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.terms-box p {
  margin-bottom: 10px;
}

.terms-agree {
  margin-top: 20px;
  margin-bottom: 10px;
}

/* Footer elements */
.signup-footer {
  text-align: center;
  margin-top: 40px;
  font-size: 12px;
  color: var(--text-muted);
}
