/* Loan Form Styles */
.loan-form-wrapper {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 20px 0;
  padding: 0;
  box-sizing: border-box;
}

.form-container {
  background: #ffffff;
  width: 100%;
  max-width: 700px;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  position: relative;
  margin: 20px auto;
}

h1 {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 25px;
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.5px;
}

h2 {
  color: #2c3e50;
  margin-bottom: 15px;
  font-weight: 600;
  font-size: 22px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f0f4f8;
}

.form-inner {
  overflow-y: auto;
  max-height: 755px;
  padding-right: 10px;
  margin-bottom: 15px;
}

input, select, textarea {
  padding: 12px;
  margin: 5px 0 15px;
  border: 1px solid #dde2e8;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s ease;
  box-sizing: border-box;
  background-color: #fafbff;
}

input[type="number"], input[type="text"], input[type="email"], input[type="tel"], input[type="date"], select:not([id$="_frequency"]), textarea {
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #2c7be5;
  box-shadow: 0 0 0 3px rgba(44, 123, 229, 0.2);
  background-color: #ffffff;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #2c7be5;
  box-shadow: 0 0 0 3px rgba(44, 123, 229, 0.2);
  background-color: #ffffff;
}

/* Error field styling */
input.error-field, select.error-field, textarea.error-field {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
  background-color: #fdf2f2;
}

input.error-field:focus, select.error-field:focus, textarea.error-field:focus {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

button {
  padding: 14px 28px;
  background: #2c7be5;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(44, 123, 229, 0.2);
}

button:hover {
  background: #1b6ed1;
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(44, 123, 229, 0.3);
}

button:active {
  transform: translateY(0);
}

.prev-btn {
  background: #f0f4f8;
  color: #2c3e50;
}

.prev-btn:hover {
  background: #e2e8f0;
}

.submit-btn {
  background: linear-gradient(135deg, #00b09b, #96c93d);
}

.submit-btn:hover {
  background: linear-gradient(135deg, #009a87, #7db82d);
  transform: translateY(-2px);
}

.btn-group {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #f0f4f8;
}

.form-step {
  display: none;
}

.form-step.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

/* Input group styling for amount and frequency */
.input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.input-group input {
  flex: 2;
  margin-bottom: 0;
}

.input-group select {
  flex: 1;
  margin-bottom: 0;
}

/* Radio and checkbox group styling */
.radio-group, .checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 10px 0 20px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.radio-group p {
  width: 100%;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 8px 0;
}

.radio-group label, 
.checkbox-group label,
input[type="radio"] + label,
input[type="checkbox"] + label {
  display: flex;
  align-items: center;
  font-weight: 500;
  cursor: pointer;
  margin: 0;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.radio-group label:hover, 
.checkbox-group label:hover {
  background: #e2e8f0;
}

input[type="radio"], input[type="checkbox"] {
  width: auto;
  margin: 0 10px 0 0;
}

/* Individual checkboxes */
input[type="checkbox"] + label {
  margin-right: 20px;
  padding: 8px 12px;
  border-radius: 6px;
}

input[type="checkbox"] + label:hover {
  background: #e2e8f0;
}

/* Keep normal labels block-level for inputs */
label:not(.checkbox-label) {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
  color: #34495e;
}

/* Ensure checkbox declaration text is aligned nicely */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
  margin: 15px 0;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 4px;
}

/* Error styling for radio and checkbox groups */
.radio-group.error-field, .checkbox-group.error-field {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
  background-color: #fdf2f2;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive design */
@media (max-width: 768px) {
  .form-container {
    padding: 20px;
    margin: 10px;
  }
  
  h1 {
    font-size: 24px;
  }
  
  h2 {
    font-size: 20px;
  }
  
  .btn-group {
    flex-direction: column;
    gap: 10px;
  }
  
  .btn-group button {
    width: 100%;
  }
  
  .input-group {
    flex-direction: column;
    gap: 5px;
  }
  
  .input-group input, .input-group select {
    width: 100%;
  }
}