/* ═══════════════════════════════════════════════════════
   QuickLoansOnline.ca — Loan Form Styles (form-only)
   Scoped to .plo-form to avoid Bootstrap conflicts
   ═══════════════════════════════════════════════════════ */

/* ── CSS Variables (scoped) ── */
.plo-form, .plo-form * {
  box-sizing: border-box;
}

.plo-form {
  --gold:    #f5a623;
  --gold2:   #e8920f;
  --navy:    #0a1628;
  --cream:   #faf8f3;
  --green:   #1db954;
  --muted:   #8a9bb5;
  --text:    #1a2540;
  --text2:   #4a5872;
  --red:     #e84040;
  --border-l:rgba(0,0,0,0.07);
  --shadow-l:0 24px 64px rgba(0,0,0,0.18);

  font-family: 'DM Sans', sans-serif;
  width: 100%;
  max-width: 520px;
  margin: 20px auto;
  padding: 0 15px;
}

/* ── Form Card ── */
.plo-form .form-card {
  background: #fff;
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: var(--shadow-l);
  width: 100%;
}

/* ── Secure Badge ── */
.plo-form .secure-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: .75rem;
  color: var(--green);
  font-weight: 600;
  margin-bottom: 14px;
  font-family: 'DM Sans', sans-serif;
}

/* ── Form Header ── */
.plo-form .form-header {
  text-align: center;
  margin-bottom: 20px;
}
.plo-form .form-header h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  color: var(--navy);
  margin-bottom: 6px;
  font-weight: normal;
}
.plo-form .form-header h3 {
  font-size: .84rem;
  color: #6b7a99;
  font-weight: normal;
  margin: 0;
  border: none;
  padding: 0;
  background: none;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Progress Steps ── */
.plo-form .progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}
.plo-form .ps {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}
.plo-form .ps:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #e0e6f0;
  z-index: 0;
  transition: background .3s;
}
.plo-form .ps.done::after,
.plo-form .ps.active::after {
  background: var(--gold);
}
.plo-form .ps-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e0e6f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  color: #9aa5b8;
  position: relative;
  z-index: 1;
  transition: all .3s;
  font-family: 'DM Sans', sans-serif;
}
.plo-form .ps.active .ps-circle {
  background: var(--gold);
  color: var(--navy);
}
.plo-form .ps.done .ps-circle {
  background: var(--green);
  color: #fff;
}
.plo-form .ps-lbl {
  font-size: .62rem;
  color: #9aa5b8;
  margin-top: 5px;
  text-align: center;
  white-space: nowrap;
  font-family: 'DM Sans', sans-serif;
}
.plo-form .ps.active .ps-lbl { color: var(--gold); font-weight: 600; }
.plo-form .ps.done .ps-lbl  { color: var(--green); }

/* ── Form Steps ── */
.plo-form .form-step {
  display: none;
  animation: ploFadeUp .3s ease;
}
.plo-form .form-step.active { display: block; }
@keyframes ploFadeUp {
  from { opacity:0; transform:translateY(8px); }
  to   { opacity:1; transform:translateY(0); }
}

.plo-form .step-eyebrow {
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  font-family: 'DM Sans', sans-serif;
}
.plo-form .step-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.15rem;
  color: var(--navy);
  margin-bottom: 18px;
  font-weight: normal;
}

/* ── Amount Grid ── */
.plo-form .amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-bottom: 14px;
}
.plo-form .amount-btn {
  border: 2px solid #e0e6f0;
  background: #fff;
  border-radius: 10px;
  padding: 12px 6px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  line-height: 1;
  /* Reset Bootstrap button styles */
  box-shadow: none;
  outline: none;
  display: block;
  width: 100%;
}
.plo-form .amount-btn:hover,
.plo-form .amount-btn.selected {
  border-color: var(--gold);
  background: rgba(245,166,35,.06);
  color: var(--gold2);
}

/* ── Form Groups ── */
.plo-form .fgroup {
  margin-bottom: 13px;
}
.plo-form .fgroup label {
  display: block;
  font-size: .73rem;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-family: 'DM Sans', sans-serif;
  /* Reset Bootstrap label styles */
  float: none;
  width: auto;
  padding: 0;
}
.plo-form .fgroup input,
.plo-form .fgroup select {
  width: 100%;
  padding: 11px 13px;
  border: 2px solid #e0e6f0 !important;
  border-radius: 10px !important;
  font-size: .9rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--navy);
  background: #fff !important;
  transition: border-color .2s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  /* Reset Bootstrap input styles */
  box-shadow: none !important;
  height: auto !important;
  line-height: normal;
  margin-bottom: 0;
}
.plo-form .fgroup input:focus,
.plo-form .fgroup select:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(245,166,35,.1) !important;
  outline: none;
}
.plo-form .fgroup input.invalid,
.plo-form .fgroup select.invalid {
  border-color: var(--red) !important;
}
.plo-form .field-err {
  font-size: .72rem;
  color: var(--red);
  margin-top: 4px;
  display: none;
  font-family: 'DM Sans', sans-serif;
}
.plo-form .field-err.show { display: block; }

/* ── Two-column row ── */
.plo-form .frow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── Buttons ── */
.plo-form .form-submit {
  width: 100%;
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 15px;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .15s;
  margin-top: 6px;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: .3px;
  display: block;
  text-align: center;
  /* Reset Bootstrap */
  box-shadow: none;
  line-height: normal;
  height: auto;
  white-space: normal;
  text-shadow: none;
  background-image: none;
}
.plo-form .form-submit:hover:not(:disabled) {
  background: var(--gold);
  color: var(--navy);
  transform: translateY(-1px);
}
.plo-form .form-submit:disabled {
  opacity: .6;
  cursor: not-allowed;
}
.plo-form .form-back {
  background: none;
  border: none;
  color: var(--muted);
  font-size: .82rem;
  cursor: pointer;
  margin-top: 10px;
  width: 100%;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  transition: color .2s;
  display: block;
  padding: 0;
  box-shadow: none;
  text-shadow: none;
  background-image: none;
}
.plo-form .form-back:hover { color: var(--navy); }

/* ── Disclaimer ── */
.plo-form .form-disclaimer {
  font-size: .67rem;
  color: #aab0c0;
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
  font-family: 'DM Sans', sans-serif;
}
.plo-form .form-disclaimer a { color: var(--gold); }

/* ── Error Message Box ── */
.plo-form .form-err-msg {
  background: rgba(232,64,64,.06);
  border: 1px solid rgba(232,64,64,.2);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: .82rem;
  color: var(--red);
  margin-top: 12px;
  line-height: 1.5;
  display: none;
  font-family: 'DM Sans', sans-serif;
}
.plo-form .form-err-msg.show { display: block; }

/* ── Loading State ── */
.plo-form .form-loading {
  display: none;
  text-align: center;
  padding: 40px 0;
}
.plo-form .form-loading.show { display: block; }
.plo-form .spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(245,166,35,.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: ploSpin .8s linear infinite;
  margin: 0 auto 20px;
}
@keyframes ploSpin { to { transform: rotate(360deg); } }
.plo-form .form-loading h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.3rem;
  color: var(--navy);
  margin-bottom: 8px;
  font-weight: normal;
  border: none;
  padding: 0;
  background: none;
  text-transform: none;
  letter-spacing: 0;
}
.plo-form .form-loading p {
  color: #6b7a99;
  font-size: .875rem;
  font-family: 'DM Sans', sans-serif;
}
.plo-form .dots span {
  animation: ploBlink 1.4s infinite;
  color: var(--gold);
}
.plo-form .dots span:nth-child(2) { animation-delay: .2s; }
.plo-form .dots span:nth-child(3) { animation-delay: .4s; }
@keyframes ploBlink { 0%,80%,100%{opacity:0} 40%{opacity:1} }

/* ── Result States ── */
.plo-form .result-state {
  display: none;
  text-align: center;
  padding: 20px 0;
}
.plo-form .result-state.show { display: block; }
.plo-form .result-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 18px;
  animation: ploPopIn .5s ease;
}
@keyframes ploPopIn {
  from { transform:scale(.5); opacity:0; }
  to   { transform:scale(1);  opacity:1; }
}
.plo-form .result-icon-green { background: rgba(29,185,84,.1); }
.plo-form .result-icon-gold  { background: rgba(245,166,35,.1); }
.plo-form .result-state h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.35rem;
  color: var(--navy);
  margin-bottom: 10px;
  font-weight: normal;
  border: none;
  padding: 0;
  background: none;
  text-transform: none;
  letter-spacing: 0;
}
.plo-form .result-state p {
  color: #6b7a99;
  font-size: .875rem;
  line-height: 1.7;
  font-family: 'DM Sans', sans-serif;
}

/* ── Review Summary ── */
.plo-form #review-summary {
  background: var(--cream);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
}

/* ── Opt-in checkbox row ── */
.plo-form .optin-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.plo-form .optin-row input[type="checkbox"] {
  width: 18px !important;
  min-width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  padding: 0 !important;
  border: 2px solid #e0e6f0 !important;
  border-radius: 4px !important;
  cursor: pointer;
}
.plo-form .optin-row label {
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: .8rem !important;
  color: var(--text2);
  font-weight: 400 !important;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════
   MOBILE FIXES
   ═══════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .plo-form {
    padding: 0 10px;
    margin: 10px auto;
  }
  .plo-form .form-card {
    padding: 22px 16px;
    border-radius: 14px;
  }
  .plo-form .amount-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .plo-form .amount-btn {
    padding: 11px 4px;
    font-size: .88rem;
  }
  .plo-form .frow {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .plo-form .form-header h2 {
    font-size: 1.25rem;
  }
  .plo-form .step-title {
    font-size: 1rem;
  }
  .plo-form .ps-lbl {
    font-size: .55rem;
  }
  .plo-form .ps-circle {
    width: 24px;
    height: 24px;
    font-size: .65rem;
  }
  .plo-form .form-submit {
    padding: 14px;
    font-size: .9rem;
  }
  .plo-form .fgroup input,
  .plo-form .fgroup select {
    font-size: 16px !important; /* Prevents iOS zoom on input focus */
    padding: 12px 11px;
  }
}

@media (max-width: 380px) {
  .plo-form .form-card {
    padding: 18px 12px;
  }
  .plo-form .amount-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .plo-form .progress-steps {
    gap: 0;
  }
  .plo-form .ps-lbl {
    display: none; /* Hide labels on very small screens */
  }
}