/* ===== V2 — Cherry Application Sub-Flow Styles =====
 * Layered on top of styles.css. Scoped to .cherry-v2-* classes.
 */

/* Pre-fill info modal */
.cherry-v2-modal[hidden] { display: none; }
.cherry-v2-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.cherry-v2-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 32, 47, 0.5);
}
.cherry-v2-modal-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  max-width: 480px;
  width: 100%;
  padding: 24px 24px 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}
.cherry-v2-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: #4b5563;
  padding: 4px;
}
.cherry-v2-modal-close:hover { color: #0E202F; }
.cherry-v2-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #0E202F;
  margin: 0 32px 12px 0;
}
.cherry-v2-modal-card p {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.55;
  margin: 0 0 14px;
}
.cherry-v2-modal-cta {
  width: 100%;
  margin-top: 8px;
  background: #fff !important;
  color: #0E202F !important;
  border: 1px solid #d1d5db !important;
}

/* ip-done Cherry disclosures — left-aligned, gray underlined links */
.cherry-disclosure {
  text-align: left !important;
  margin-left: 0;
  margin-right: 0;
}
.cherry-disclosure a {
  color: inherit;
  text-decoration: underline;
}

/* ip-done confirmation — green centered title */
.confirm-title {
  width: 100%;
  max-width: 320px;
  margin: 0 auto 12px;
  text-align: center;
  color: #00C37D;
  font-size: 1.5rem;
}
.confirmation-step .confirm-message {
  width: 100%;
  max-width: 320px;
  margin: 0 auto 12px;
  text-align: center;
}

/* ip-done Cherry prompt — title + bulleted benefits + Apply button */
.cherry-prompt {
  align-self: stretch !important;
  max-width: none !important;
  text-align: center;
}
.cherry-prompt .cherry-title {
  margin-bottom: 14px;
}
.cherry-desc-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cherry-desc-list li {
  position: relative;
  padding-left: 28px;
  font-size: 14px;
  color: #4b5563;
  line-height: 1.5;
}
.cherry-desc-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300C37D' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* Apply button on ip-done — icon + label, matches Cherry's pill style */
.cherry-apply-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.cherry-apply-btn .cherry-apply-icon {
  flex-shrink: 0;
}
.cherry-apply-btn span {
  font-weight: 600;
}

.cherry-v2-step .step-content {
  padding: 0 0 32px;
}

.cherry-v2-merchant-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 16px 14px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  align-self: stretch;
}
.cherry-v2-merchant-icon {
  display: block;
  margin: 0 auto 6px;
}
.cherry-v2-merchant-label {
  font-size: 13px;
  color: #4b5563;
}
.cherry-v2-merchant-name {
  font-weight: 700;
  color: #0E202F;
  font-size: 15px;
  margin-top: 2px;
}

.cherry-v2-card {
  background: #fff;
  padding: 20px 16px;
}

.cherry-v2-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.cherry-v2-brand-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}
.cherry-v2-brand-text {
  font-weight: 700;
  color: #0E202F;
  font-size: 14px;
}

.cherry-v2-title {
  font-size: 20px;
  font-weight: 700;
  color: #0E202F;
  margin: 0 0 14px;
  line-height: 1.25;
}

.cherry-v2-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cherry-v2-bullets li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #0E202F;
}

.cherry-v2-label {
  display: block;
  font-size: 14px;
  color: #0E202F;
  margin: 14px 0 6px;
}

.cherry-v2-location-display {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 12px;
  font-size: 14px;
  color: #0E202F;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cherry-v2-disclaimer {
  font-size: 11px;
  color: #6b7280;
  padding: 12px 16px;
  background: #f9fafb;
  margin: 0;
  line-height: 1.45;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}
.cherry-v2-disclaimer a { color: #0E202F; text-decoration: underline; }

.cherry-v2-step .btn-primary {
  margin-top: 12px;
}

/* Screen 2 + 3 + 4: large icon at top */
.cherry-v2-icon-lg {
  padding: 24px 16px 8px;
}

.cherry-v2-step-icon {
  width: 100%;
  max-width: 320px;
  margin: 12px auto 12px;
  text-align: left;
}

.cherry-v2-h2 {
  font-size: 22px;
  font-weight: 700;
  color: #0E202F;
  margin: 0 auto 12px;
  padding: 0;
  text-align: left;
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
}

/* Screen 2: Requirements */
.cherry-v2-requirements {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}
.cherry-v2-requirements li {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
}
.cherry-v2-requirements li > div { flex: 1; text-align: left; }
.cherry-v2-requirements li .req-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: #e6f9f0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cherry-v2-requirements li strong {
  font-weight: 600;
  color: #0E202F;
  font-size: 15px;
  display: block;
}
.cherry-v2-requirements li p {
  font-size: 13px;
  color: #4b5563;
  margin: 4px 0 0;
  line-height: 1.45;
}
.cherry-v2-requirements li p strong { display: inline; font-size: inherit; color: #0E202F; }

.cherry-v2-consent {
  font-size: 12px;
  color: #6b7280;
  padding: 14px 16px 16px;
  background: transparent;
  margin: 0;
  line-height: 1.5;
  text-align: left;
}
.cherry-v2-consent a { color: inherit; text-decoration: underline; }

/* Screen 3: Phone — field block is 320px-wide, centered like the rest */
.cherry-v2-field-block {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  text-align: left;
}
.cherry-v2-input {
  width: 100%;
  padding: 14px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
  background: #fff;
  box-sizing: border-box;
}
.cherry-v2-input:focus {
  outline: none;
  border-color: #0E202F;
}
.cherry-v2-field-block .field-error {
  display: block;
  font-size: 12px;
  color: #dc2626;
  min-height: 14px;
  margin-top: 4px;
}

.cherry-v2-inline-link {
  font-size: 13px;
  margin: 8px 0 16px;
}
.cherry-v2-inline-link a {
  color: #00C37D;
  text-decoration: underline;
  font-weight: 500;
}

.cherry-v2-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.cherry-v2-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #00C37D;
  cursor: pointer;
}
.cherry-v2-checkbox-label { font-size: 14px; color: #0E202F; }

/* Screen 4: OTP */
.cherry-v2-otp-row {
  display: flex;
  gap: 8px;
  padding: 0;
  margin: 0 0 8px;
  width: 100%;
}
.cherry-v2-otp-input {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  height: 56px;
  padding: 0;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
  -moz-appearance: textfield;
}
.cherry-v2-otp-input::-webkit-outer-spin-button,
.cherry-v2-otp-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.cherry-v2-otp-input:focus {
  outline: none;
  border-color: #0E202F;
  border-width: 2px;
}
.cherry-v2-helper {
  font-size: 13px;
  color: #4b5563;
  margin: 0 0 8px;
}
.cherry-v2-error {
  font-size: 13px;
  color: #dc2626;
  min-height: 16px;
  margin: 0 0 8px;
}

/* Screen 5: Approved */
.cherry-v2-approved-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 32px auto 16px;
  width: 100%;
  max-width: 320px;
  padding: 0;
}
.cherry-v2-confetti {
  font-size: 28px;
}
.cherry-v2-approved-title {
  font-size: 24px;
  font-weight: 700;
  color: #0E202F;
  margin: 0;
}

.cherry-v2-approval-card {
  margin: 0 auto 12px;
  width: 100%;
  max-width: 320px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  box-sizing: border-box;
}
.cherry-v2-up-to {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.cherry-v2-amount {
  font-size: 44px;
  font-weight: 700;
  color: #0E202F;
  line-height: 1.1;
  margin: 4px 0;
}
.cherry-v2-available {
  font-size: 14px;
  color: #4b5563;
  margin-bottom: 16px;
}
.cherry-v2-valid-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #d1fae5;
  color: #047857;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
}

.cherry-v2-step .cherry-v2-login-btn {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  margin-top: 0;
  margin-bottom: 8px;
}

.cherry-v2-privacy-bottom {
  margin-top: auto;
  padding-top: 24px;
}

.cherry-v2-larger-approval {
  width: calc(100% - 32px);
  margin: 0 16px 16px;
  padding: 14px 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #0E202F;
  font-weight: 500;
  cursor: pointer;
}
.cherry-v2-larger-approval span { flex: 1; text-align: left; }
.cherry-v2-larger-approval:hover { background: #f9fafb; }

.cherry-v2-calculator {
  margin: 0 16px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}
.cherry-v2-calc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 8px;
  font-weight: 700;
  color: #0E202F;
  font-size: 16px;
}
.cherry-v2-calc-input-row {
  display: flex;
  gap: 0;
  padding: 0 14px 14px;
  align-items: stretch;
}
.cherry-v2-calc-input-wrap {
  flex: 1;
  border: 1px solid #d1d5db;
  border-right: none;
  border-radius: 8px 0 0 8px;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.cherry-v2-calc-input-label {
  font-size: 11px;
  color: #6b7280;
}
.cherry-v2-calc-input {
  border: none;
  outline: none;
  font-size: 16px;
  font-weight: 600;
  color: #0E202F;
  padding: 0;
  background: transparent;
}
.cherry-v2-preview-btn {
  background: #00C37D;
  color: #fff;
  border: none;
  border-radius: 0 8px 8px 0;
  padding: 0 22px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.cherry-v2-preview-btn:hover { background: #00b372; }

.cherry-v2-table-wrap {
  border-top: 1px solid #e5e7eb;
}
.cherry-v2-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.cherry-v2-table th {
  background: #f3f4f6;
  text-align: left;
  padding: 10px 8px;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: #6b7280;
  font-weight: 600;
  text-transform: uppercase;
  border-bottom: 1px solid #e5e7eb;
}
.cherry-v2-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: top;
  font-size: 13px;
  color: #0E202F;
}
.cherry-v2-table td strong {
  display: block;
  font-weight: 600;
  font-size: 13px;
}
.cherry-v2-cell-sub {
  display: block;
  font-size: 10px;
  color: #6b7280;
  margin-top: 2px;
}
.cherry-v2-apr-pill {
  display: inline-block;
  background: #d1fae5;
  color: #047857;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
}
.cherry-v2-no-interest {
  display: block;
  color: #6b7280;
  font-size: 10px;
  margin-top: 4px;
}
.cherry-v2-total-interest {
  display: block;
  color: #6b7280;
  font-size: 10px;
  font-weight: 400;
  margin-top: 2px;
}
.cherry-v2-learn {
  color: #00C37D;
  font-weight: 500;
  text-decoration: underline;
}

/* Provider logo placeholder on home screen */
.logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 280px;
  height: 80px;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-family: 'Open Sans', sans-serif;
  margin: 0 auto;
}

/* ===== V3 — confirmation screen: 12px gap from progress bar to "You're All Set!" ===== */
.confirmation-step {
  padding-top: 12px;
}
.confirmation-step .confirm-title {
  margin-top: 0;
}
.confirmation-step .confirm-message {
  font-size: 12px;
}
.confirmation-step .summary {
  margin-bottom: 10px;
}

/* Pre-qualification result card — sits under the Cherry logo on ip-done. Matches V1 styling. */
.cherry-prequal-card {
  margin: 8px auto 12px;
  max-width: 320px;
  width: 100%;
  box-sizing: border-box;
}

/* Pre-fill checkbox on ip-done above the Apply button */
.cherry-v3-prefill {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px auto;
  max-width: 320px;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.cherry-v3-prefill .cherry-v2-checkbox-label {
  font-size: 13px;
  color: #0E202F;
}
.cherry-v3-prefill-info {
  font-size: 11px;
  color: #6b7280;
  text-decoration: underline;
  font-weight: 400;
  margin-left: 4px;
}

/* ===== V3 — requirements list folded onto ip-done page (matches .cherry-desc-list above) ===== */
/* Override cherry-desc-list bottom margin in V3 so the gap to .cherry-v3-reqs is exactly 8px */
.cherry-desc-list {
  margin-bottom: 0;
}
.cherry-v3-reqs {
  margin-top: 8px;
  gap: 8px;
}
.cherry-v3-reqs li {
  align-items: flex-start;
}
.cherry-v3-reqs li::before {
  top: 2px;
}
.cherry-v3-note {
  display: block;
  font-size: 11px;
  color: #6b7280;
  line-height: 1.35;
  margin-top: 2px;
}

/* ===== /iframe-apply — Cherry application embedded via iframe ===== */
.iframe-step-content {
  padding: 0 !important;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch !important;
}
.cherry-iframe {
  flex: 1;
  width: 100%;
  min-height: 600px;
  border: 0;
  display: block;
  background: #fff;
}
.iframe-fallback {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 0;
  font-size: 14px;
  color: #4b5563;
  text-align: center;
  max-width: 320px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.iframe-fallback a {
  color: #00C37D;
  font-weight: 600;
  text-decoration: underline;
}

/* ===== ASBS-specific overrides — tighten ip-done so the Apply button sits in view ===== */
/* Override .step-content's 56/48 top/bottom padding for the confirmation step.
   .step-content.confirmation-step has 2-class specificity, beating .step-content. */
.step-content.confirmation-step {
  padding: 12px 24px 20px;
  gap: 0;
}
.confirmation-step .summary {
  margin: 0 auto 12px;
  padding: 4px 12px;
}
.confirmation-step .summary-item {
  padding: 6px 0;
}
.confirmation-step .cherry-prompt {
  margin-top: 4px !important;
}
.confirmation-step .cherry-prompt .cherry-logo {
  margin-bottom: 4px;
}
.confirmation-step .cherry-prompt .cherry-title {
  margin: 0 0 8px;
}
.confirmation-step .cherry-desc-list {
  margin-bottom: 10px;
}
.confirmation-step .cherry-v3-prefill {
  margin: 4px auto 10px;
}
.confirmation-step .cherry-apply-btn {
  margin-top: 0;
}
.confirmation-step .cherry-disclosure {
  margin: 8px 0 0;
}

/* Make ip-done feel like the V3 reference on desktop: cap the column so the
   prefill checkbox, Apply button, and disclosures don't diverge in width. */
.step-content.confirmation-step {
  max-width: 380px;
  margin: 0 auto;
}

/* "You're All Set!" inherits the ASBS brand blue instead of the Cherry green
   from the V3 reference's .confirm-title color — matches the rest of the
   booking flow's branding. */
.confirmation-step .confirm-title {
  color: var(--pink);
}

/* Apply button: Cherry brand green (V3 reference uses --teal=#00C37D).
   ASBS's `.btn-cherry` uses the blue brand color, which is correct elsewhere
   in the app but wrong on the Cherry confirmation. Scope the green to the
   Cherry Apply button specifically. */
.confirmation-step .cherry-apply-btn,
.confirmation-step .cherry-apply-btn:focus-visible {
  background: #00C37D;
  color: #fff;
  border-color: transparent;
}
.confirmation-step .cherry-apply-btn:hover:not(:disabled) {
  background: #00B372;
  box-shadow: 0 4px 12px rgba(0, 195, 125, 0.25);
}
