/* ==========================================================================
   ExpressCred Multi-Step Loan Application (Google Stitch UI)
   Scoped to #stitchAppRoot to avoid conflicts with landing page CSS.
   Brand Tokens:
     Primary Green: #0A5A3C | Dark Green: #043B2C | Gold: #D4AF37
   ========================================================================== */

#stitchAppRoot {
  --sc-primary: #0A5A3C;
  --sc-primary-hover: #084830;
  --sc-dark-green: #043B2C;
  --sc-gold: #D4AF37;
  --sc-bg: #F7FAF8;
  --sc-surface: #FFFFFF;
  --sc-text: #202B27;
  --sc-muted: #718078;
  --sc-border: #E4EBE7;
  --sc-success-bg: #E6F4EE;
  --sc-error: #DC2626;
  --sc-error-bg: #FEF2F2;
  --sc-error-border: #FECACA;
  font-family: 'Poppins', sans-serif;
  color: var(--sc-text);
  width: 100%;
}

#stitchAppRoot *,
#stitchAppRoot *::before,
#stitchAppRoot *::after {
  box-sizing: border-box;
}

.sc-app-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Eligibility Top Pill */
.sc-elig-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--sc-success-bg);
  border: 1px solid #CBE6D9;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--sc-dark-green);
}

.sc-elig-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sc-elig-badge .material-symbols-outlined {
  font-size: 16px;
  color: var(--sc-primary);
}

.sc-elig-salary {
  color: var(--sc-primary);
  font-weight: 700;
}

/* Progress Header */
.sc-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sc-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--sc-muted);
}

.sc-progress-step-label {
  color: var(--sc-primary);
  font-weight: 700;
}

.sc-progress-track {
  width: 100%;
  height: 6px;
  background: var(--sc-border);
  border-radius: 999px;
  overflow: hidden;
}

.sc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sc-primary), var(--sc-gold));
  border-radius: 999px;
  transition: width 0.25s ease;
}

/* Step Headings */
.sc-step-header {
  margin-bottom: 4px;
}

.sc-step-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--sc-dark-green);
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.sc-step-subtitle {
  font-size: 13px;
  color: var(--sc-muted);
  margin: 0;
  line-height: 1.5;
}

/* Fields & Inputs */
.sc-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.sc-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sc-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sc-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 0;
}

.sc-label-hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--sc-muted);
}

.sc-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.sc-prefix {
  position: absolute;
  left: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--sc-text);
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sc-input,
.sc-select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--sc-text);
  background: var(--sc-surface);
  border: 1.5px solid var(--sc-border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sc-input.has-prefix {
  padding-left: 46px;
}

.sc-input.has-rupee {
  padding-left: 30px;
}

.sc-input:focus,
.sc-select:focus {
  border-color: var(--sc-primary);
  box-shadow: 0 0 0 3px rgba(10, 90, 60, 0.12);
}

.sc-input.is-invalid,
.sc-select.is-invalid {
  border-color: var(--sc-error);
  background: var(--sc-error-bg);
}

.sc-field-error-msg {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--sc-error);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.sc-field-error-msg .material-symbols-outlined {
  font-size: 14px;
}

/* Consent Checkbox */
.sc-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--sc-muted);
  cursor: pointer;
  margin: 4px 0 8px 0;
}

.sc-consent-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--sc-primary);
  flex-shrink: 0;
  cursor: pointer;
}

.sc-consent-label a {
  color: var(--sc-primary);
  font-weight: 600;
  text-decoration: underline;
}

/* OTP 6-Box Grid */
.sc-otp-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--sc-bg);
  border: 1px solid var(--sc-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}

.sc-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sc-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.sc-link-btn:hover {
  text-decoration: underline;
}

.sc-link-btn:disabled {
  color: var(--sc-muted);
  cursor: not-allowed;
  text-decoration: none;
}

.sc-otp-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 8px 0;
}

.sc-otp-box {
  width: 100%;
  height: 48px;
  text-align: center;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  color: var(--sc-dark-green);
  background: var(--sc-surface);
  border: 1.5px solid var(--sc-border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sc-otp-box:focus {
  border-color: var(--sc-primary);
  box-shadow: 0 0 0 3px rgba(10, 90, 60, 0.12);
}

.sc-otp-box.is-invalid {
  border-color: var(--sc-error);
  background: var(--sc-error-bg);
}

.sc-otp-resend {
  font-size: 12px;
  color: var(--sc-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Selectable Option Cards */
.sc-option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sc-option-grid-purpose {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.sc-option-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: var(--sc-surface);
  border: 1.5px solid var(--sc-border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sc-text);
  transition: all 0.18s ease;
}

.sc-option-card .material-symbols-outlined {
  font-size: 19px;
  color: var(--sc-primary);
  flex-shrink: 0;
}

.sc-option-card:hover {
  border-color: var(--sc-primary);
  background: var(--sc-bg);
}

.sc-option-card.is-selected {
  border-color: var(--sc-primary);
  background: var(--sc-success-bg);
  color: var(--sc-dark-green);
  box-shadow: 0 0 0 1px var(--sc-primary);
}

.sc-option-card-full {
  grid-column: 1 / -1;
}

.sc-option-card-sub {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--sc-muted);
  margin-top: 2px;
}

/* Range Slider */
.sc-range {
  width: 100%;
  height: 6px;
  accent-color: var(--sc-primary);
  cursor: pointer;
  margin: 8px 0 4px 0;
}

.sc-range-bounds {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--sc-muted);
  font-weight: 500;
}

/* Review Summary Cards */
.sc-review-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sc-review-card {
  background: var(--sc-bg);
  border: 1px solid var(--sc-border);
  border-radius: 10px;
  padding: 12px 14px;
}

.sc-review-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--sc-border);
}

.sc-review-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--sc-dark-green);
  margin: 0;
}

.sc-review-rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  font-size: 12px;
}

.sc-review-item-label {
  color: var(--sc-muted);
  font-size: 11px;
  display: block;
}

.sc-review-item-val {
  color: var(--sc-text);
  font-weight: 600;
  word-break: break-word;
}

/* Alert / Error Banner */
.sc-alert-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: var(--sc-error-bg);
  border: 1px solid var(--sc-error-border);
  border-radius: 10px;
  color: var(--sc-error);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
}

.sc-alert-error .material-symbols-outlined {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Action Buttons */
.sc-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

.sc-btn-primary,
.sc-btn-secondary {
  height: 46px;
  padding: 0 20px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sc-btn-primary {
  flex: 1;
  background: var(--sc-primary);
  color: #FFFFFF;
  border: none;
}

.sc-btn-primary:hover:not(:disabled) {
  background: var(--sc-primary-hover);
}

.sc-btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.sc-btn-secondary {
  background: var(--sc-surface);
  color: var(--sc-text);
  border: 1.5px solid var(--sc-border);
}

.sc-btn-secondary:hover:not(:disabled) {
  background: var(--sc-bg);
  border-color: var(--sc-muted);
}

.sc-btn-primary .material-symbols-outlined,
.sc-btn-secondary .material-symbols-outlined {
  font-size: 18px;
}

/* Spinner */
.sc-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: scSpin 0.7s linear infinite;
}

@keyframes scSpin {
  to { transform: rotate(360deg); }
}

/* Success Screen */
.sc-success-wrap {
  text-align: center;
  padding: 12px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.sc-success-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--sc-success-bg);
  color: var(--sc-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sc-success-icon .material-symbols-outlined {
  font-size: 34px;
}

.sc-ref-box {
  width: 100%;
  background: var(--sc-bg);
  border: 1.5px dashed var(--sc-gold);
  border-radius: 12px;
  padding: 14px;
}

.sc-ref-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--sc-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sc-ref-code {
  font-size: 20px;
  font-weight: 800;
  color: var(--sc-dark-green);
  margin: 4px 0;
  letter-spacing: 0.5px;
}

.sc-ref-hint {
  font-size: 11.5px;
  color: var(--sc-muted);
}

.sc-trust-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  background: var(--sc-bg);
  border: 1px solid var(--sc-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 11.5px;
  color: var(--sc-muted);
  line-height: 1.45;
}

.sc-trust-note .material-symbols-outlined {
  font-size: 18px;
  color: var(--sc-primary);
  flex-shrink: 0;
}

/* Mobile Responsiveness */
@media (max-width: 576px) {
  .sc-grid-2,
  .sc-option-grid,
  .sc-option-grid-purpose,
  .sc-review-rows {
    grid-template-columns: 1fr;
  }

  .sc-otp-grid {
    gap: 6px;
  }

  .sc-otp-box {
    height: 44px;
    font-size: 16px;
  }

  .sc-actions {
    flex-direction: column-reverse;
  }

  .sc-btn-primary,
  .sc-btn-secondary {
    width: 100%;
  }
}


/* 4-Step Horizontal Stepper (Mobile No. -> Personal Info -> Loan Details -> Review & Submit) */
.sc-stepper {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: #F4F7FB;
  border: 1px solid var(--sc-border);
  border-radius: 12px;
  padding: 14px 10px 12px;
}

.sc-stepper::before {
  content: "";
  position: absolute;
  top: 29px;
  left: 12.5%;
  right: 12.5%;
  height: 2px;
  background: #CBD5E1;
  z-index: 0;
}

.sc-stepper-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.sc-stepper-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid #CBD5E1;
  color: #64748B;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sc-stepper-item.is-active .sc-stepper-circle {
  background: linear-gradient(135deg, #0A5A3C 0%, #84CC16 100%);
  border-color: #D4AF37;
  color: #FFFFFF;
  box-shadow: 0 0 0 5px rgba(10, 90, 60, 0.14);
}

.sc-stepper-item.is-done .sc-stepper-circle {
  background: #0A5A3C;
  border-color: #0A5A3C;
  color: #FFFFFF;
}

.sc-stepper-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748B;
  line-height: 1.25;
}

.sc-stepper-item.is-active .sc-stepper-label {
  color: #043B2C;
  font-weight: 700;
}

.sc-stepper-item.is-done .sc-stepper-label {
  color: #0A5A3C;
}

@media (max-width: 420px) {
  .sc-stepper-label {
    font-size: 10.5px;
  }
}
