/* Loan Application Form Styles */

/* Main Section */
.loan-application {
  padding: 60px 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #fff 100%);
}

.loan-application .container {
  max-width: 800px;
}

/* Progress Bar and Steps */
.progress-container {
  margin-bottom: 50px;
}

.progress-bar-wrapper {
  height: 4px;
  background-color: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 30px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #007b40 0%, #005a2e 100%);
  width: 16.67%;
  transition: width 0.3s ease;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.progress-step {
  flex: 1;
  text-align: center;
  position: relative;
}

.progress-step .step-number {
  width: 50px;
  height: 50px;
  margin: 0 auto 10px;
  background-color: #f0f0f0;
  border: 2px solid #e0e0e0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  color: #666;
  transition: all 0.3s ease;
}

.progress-step.active .step-number {
  background: linear-gradient(135deg, #007b40 0%, #005a2e 100%);
  color: white;
  border-color: #007b40;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 123, 64, 0.3);
}

.progress-step.completed .step-number {
  background-color: #27ae60;
  color: white;
  border-color: #27ae60;
}

.progress-step.completed .step-number::after {
  content: '\f058';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
}

.progress-step .step-label {
  font-size: 12px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}

.progress-step.active .step-label {
  color: #007b40;
  font-weight: 700;
}

/* Form Styles */
.application-form {
  background: white;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Form Steps */
.form-step {
  display: none;
  animation: fadeIn 0.3s ease;
}

.form-step.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-header {
  margin-bottom: 40px;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 20px;
}

.step-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: #007b40;
  margin-bottom: 8px;
}

.step-header p {
  font-size: 14px;
  color: #888;
  margin: 0;
}

/* Form Section */
.form-section {
  background: #fafafa;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 25px;
  border-left: 4px solid #007b40;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-row.full-width {
  grid-template-columns: 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

/* Form Labels and Inputs */
.form-label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-label i {
  color: #007b40;
  font-size: 16px;
}

.form-label .required {
  color: #e74c3c;
  font-weight: 700;
}

.form-control {
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  transition: all 0.3s ease;
  background-color: white;
}

.form-control:focus {
  border-color: #007b40;
  background-color: #fafafa;
  box-shadow: 0 0 0 3px rgba(0, 123, 64, 0.1);
  outline: none;
}

.form-control::placeholder {
  color: #bbb;
}

.form-control[type="date"],
.form-control[type="email"],
.form-control[type="tel"],
.form-control[type="text"],
.form-control[type="number"],
.form-control[readonly] {
  color: #333;
}

.form-control[readonly] {
  background-color: #f5f5f5;
  cursor: not-allowed;
}

select.form-control {
  cursor: pointer;
  padding-right: 30px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23007b40' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 35px;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Input Groups */
.input-group {
  display: flex;
  border-radius: 6px;
  border: 1px solid #ddd;
  overflow: hidden;
  transition: all 0.3s ease;
}

.input-group:focus-within {
  border-color: #007b40;
  box-shadow: 0 0 0 3px rgba(0, 123, 64, 0.1);
}

.input-group .form-control {
  border: none;
  flex: 1;
}

.input-group .form-control:focus {
  box-shadow: none;
}

.input-group-text {
  padding: 12px 14px;
  background-color: #f5f5f5;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  white-space: nowrap;
}

.currency-badge {
  background: linear-gradient(135deg, #007b40 0%, #005a2e 100%);
  color: white;
  font-weight: 700;
}

.period-badge {
  background-color: #e8f5e9;
  color: #007b40;
}

/* File Upload */
.file-upload-wrapper {
  position: relative;
  border: 2px dashed #007b40;
  border-radius: 6px;
  padding: 30px;
  text-align: center;
  background-color: rgba(0, 123, 64, 0.03);
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.file-upload-wrapper:hover {
  background-color: rgba(0, 123, 64, 0.08);
  border-color: #005a2e;
}

.file-upload-wrapper i {
  font-size: 32px;
  color: #007b40;
  margin-bottom: 10px;
  display: block;
}

.file-upload-wrapper p {
  margin: 10px 0;
  color: #333;
  font-weight: 500;
}

.file-upload-wrapper small {
  display: block;
  color: #888;
  font-size: 12px;
  margin-top: 8px;
}

.file-input:valid ~ .file-upload-hint::after {
  content: 'File selected ✓';
  display: block;
  color: #27ae60;
  font-weight: 600;
  margin-top: 10px;
}

/* Assets Table */
.assets-table {
  margin: 20px 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #ddd;
}

.assets-table table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.assets-table th {
  background: linear-gradient(135deg, #007b40 0%, #005a2e 100%);
  color: white;
  padding: 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  border: none;
}

.assets-table td {
  padding: 12px;
  border-bottom: 1px solid #e0e0e0;
}

.assets-table tr:last-child td {
  border-bottom: none;
}

.assets-table .asset-input {
  border: 1px solid #ddd;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 4px;
}

.assets-table .asset-input:focus {
  border-color: #007b40;
  background-color: #fafafa;
  outline: none;
}

/* Bank Details Disclaimer */
.bank-disclaimer {
  background-color: #fef3cd;
  border-left: 4px solid #ffc107;
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #664d03;
}

/* Declaration Box */
.declaration-box {
  background-color: #f0f8ff;
  border-left: 4px solid #3498db;
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 25px;
}

.declaration-box h4 {
  color: #007b40;
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: 600;
}

.declaration-box p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #333;
  text-align: justify;
}

/* Loan Summary Card */
.loan-summary-card {
  background: linear-gradient(135deg, #007b40 0%, #005a2e 100%);
  border-radius: 8px;
  padding: 25px;
  color: white;
  margin-top: 30px;
}

.loan-summary-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 15px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.summary-label {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.9;
}

.summary-value {
  font-size: 18px;
  font-weight: 700;
  color: #90ee90;
}

/* Form Navigation Buttons */
.form-navigation {
  display: flex;
  gap: 15px;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid #f0f0f0;
  justify-content: flex-end;
}

.btn {
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background-color: #f0f0f0;
  color: #666;
}

.btn-secondary:hover:not(:disabled) {
  background-color: #e0e0e0;
  transform: translateX(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, #007b40 0%, #005a2e 100%);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 123, 64, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
  color: white;
}

.btn-success:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(39, 174, 96, 0.3);
}

/* Error Messages */
.error-message {
  color: #e74c3c;
  font-size: 12px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-control.error {
  border-color: #e74c3c;
  background-color: rgba(231, 76, 60, 0.05);
}

.form-control.error:focus {
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Success Message */
.success-message {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 6px;
  padding: 15px;
  color: #155724;
  margin-bottom: 20px;
  display: none;
}

.success-message.show {
  display: block;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading Spinner */
.spinner {
  border: 3px solid #f0f0f0;
  border-top: 3px solid #007b40;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .progress-steps {
    gap: 5px;
  }

  .progress-step .step-number {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .progress-step .step-label {
    font-size: 10px;
  }

  .application-form {
    padding: 25px 15px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .form-section {
    padding: 15px;
  }

  .step-header h2 {
    font-size: 22px;
  }

  .form-navigation {
    flex-direction: column-reverse;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .loan-summary-card {
    padding: 20px;
  }

  .form-label {
    font-size: 13px;
  }

  .form-control {
    font-size: 13px;
  }

  .assets-table th,
  .assets-table td {
    padding: 10px;
    font-size: 12px;
  }
}

@media (max-width: 576px) {
  .loan-application {
    padding: 30px 0;
  }

  .progress-container {
    margin-bottom: 30px;
  }

  .progress-step .step-number {
    width: 35px;
    height: 35px;
    font-size: 12px;
  }

  .progress-step .step-label {
    display: none;
  }

  .application-form {
    padding: 15px;
    border-radius: 8px;
  }

  .form-section {
    padding: 12px;
    margin-bottom: 15px;
  }

  .step-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
  }

  .step-header h2 {
    font-size: 18px;
  }

  .step-header p {
    font-size: 12px;
  }

  .form-control {
    padding: 10px 12px;
  }

  .input-group-text {
    padding: 10px 12px;
    font-size: 12px;
  }

  .loan-summary-card h3 {
    font-size: 16px;
  }

  .summary-label {
    font-size: 12px;
  }

  .summary-value {
    font-size: 14px;
  }

  .file-upload-wrapper {
    padding: 20px;
  }

  .file-upload-wrapper i {
    font-size: 24px;
  }

  .form-navigation {
    gap: 10px;
  }

  .btn {
    padding: 10px 16px;
    font-size: 12px;
  }

  .assets-table {
    font-size: 12px;
  }

  .assets-table th,
  .assets-table td {
    padding: 8px;
  }

  .declaration-box {
    font-size: 12px;
  }
}