/**
 * Conventional Pre-Qual widget styles.
 *
 * Source HTML scoped everything to .mms-rate; we re-scope to .mms-conv
 * here so it never collides with find-my-rate (.mms-rate) or refinance
 * (.mms-refi) on the same page.
 *
 * Brand colors come from --mms-{token} with hex fallbacks. Neutrals stay
 * hardcoded.
 */

/* ── ISOLATION RESET ─────────────────────────────────────────────── */
.mms-conv, .mms-conv *, .mms-conv *::before, .mms-conv *::after {
	box-sizing: border-box;
	-webkit-font-smoothing: antialiased;
}
.mms-conv .step-title,.mms-conv .success-title,.mms-conv .mms-conv-card-title {
	font-family: 'DM Sans', sans-serif !important;
	font-weight: 700; line-height: 1.2;
	margin: 0; padding: 0; border: none; background: none;
	color: #1f2937; letter-spacing: -0.01em;
}
.mms-conv p,.mms-conv ul,.mms-conv ol,.mms-conv li {
	margin: 0; padding: 0; list-style: none;
	font-family: 'DM Sans', sans-serif !important;
}
.mms-conv a { text-decoration: none; color: inherit; }
.mms-conv input,.mms-conv select,.mms-conv button,.mms-conv textarea {
	font-family: 'DM Sans', sans-serif !important;
	-webkit-appearance: none; -moz-appearance: none; appearance: none; margin: 0;
}
.mms-conv input[type="number"]::-webkit-inner-spin-button,
.mms-conv input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ── ROOT (full-screen overlay) ──────────────────────────────────── */
.mms-conv {
	font-family: 'DM Sans', sans-serif !important;
	font-size: 16px; line-height: 1.5; color: #1f2937;
	background: rgba(0, 0, 0, 0.6);
	position: fixed;
	top: 0; left: 0;
	width: 100%; height: 100%;
	z-index: 999999;
	display: flex; align-items: center; justify-content: center; padding: 16px;

	--p:    var(--mms-p,   #1e3295);
	--pdk:  var(--mms-pdk, #171e3b);
	--sec:  var(--mms-sec, #0ea5c9);
	--p50:  #eff6ff; --p100: #dbeafe;
	--n50:  #f9fafb; --n100: #f3f4f6; --n200: #e5e7eb;
	--n300: #d1d5db; --n400: #9ca3af; --n500: #6b7280;
	--n600: #4b5563; --n700: #374151; --n800: #1f2937;

	animation: mmsConvFadeIn 0.2s ease;
}
@keyframes mmsConvFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── SIMPLE INTRO CARD ───────────────────────────────────────────── */
/* Source HTML scoped the card to .mms-quote-card; we use .mms-conv-card
   to keep widget-specific scoping consistent across the plugin. */
.mms-conv-card, .mms-conv-card * {
	box-sizing: border-box;
	font-family: 'DM Sans', sans-serif !important;
	-webkit-font-smoothing: antialiased;
}
.mms-conv-card {
	background: #ffffff;
	border: 1px solid #f0f0f0;
	border-radius: 15px;
	padding: 36px 32px;
	max-width: 420px;
	width: 100%;
	--p:   var(--mms-p,   #1e3295);
	--pdk: var(--mms-pdk, #171e3b);
}
.mms-conv-card .mms-conv-card-title {
	font-size: 1.4rem; font-weight: 800; color: #171e3b;
	margin: 0 0 24px; line-height: 1.3;
}
.mms-conv-card .qc-field { margin-bottom: 16px; }
.mms-conv-card .qc-label {
	display: block; font-size: 0.8rem; font-weight: 600; color: #4b5563; margin-bottom: 6px;
}
.mms-conv-card .qc-input,
.mms-conv-card .qc-select {
	width: 100%; padding: 12px 14px;
	border: 2px solid #e5e7eb; border-radius: 999px;
	font-size: 0.95rem; color: #1f2937; background: #fff;
	outline: none; transition: border-color 0.15s, box-shadow 0.15s;
	-webkit-appearance: none; -moz-appearance: none; appearance: none;
}
.mms-conv-card .qc-select {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%236b7280' d='M6 8L0 0h12z'/></svg>");
	background-repeat: no-repeat; background-position: right 14px center;
	padding-right: 36px;
}
.mms-conv-card .qc-input:focus,
.mms-conv-card .qc-select:focus {
	border-color: var(--p);
	box-shadow: 0 0 0 3px rgba(30, 50, 149, 0.1);
}
.mms-conv-card .qc-input::placeholder { color: #9ca3af; }
.mms-conv-card .btn-submit {
	width: 100%; padding: 14px 24px; border: none; border-radius: 999px;
	background: linear-gradient(to right, var(--p), var(--pdk));
	color: #ffffff; font-size: 1rem; font-weight: 700; cursor: pointer;
	transition: transform 0.2s, box-shadow 0.2s; margin-top: 8px;
	text-transform: none; letter-spacing: 0; line-height: 1;
	font-family: 'DM Sans', sans-serif !important;
}
.mms-conv-card .btn-submit:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(23, 30, 59, 0.25);
}
.mms-conv-card .btn-submit:active { transform: translateY(0); }
.mms-conv-card .qc-note {
	font-size: 0.75rem; color: #9ca3af; text-align: center;
	margin-top: 14px; line-height: 1.5;
}
@media (max-width: 480px) {
	.mms-conv-card .btn-submit:hover { transform: none; box-shadow: none; }
	.mms-conv-card .btn-submit:active { filter: brightness(88%); }
}

/* ── MODAL ───────────────────────────────────────────────────────── */
.mms-conv .modal {
	background: white; border-radius: 15px; box-shadow: 0 25px 60px rgba(0,0,0,0.2);
	width: 100%; max-width: 560px; max-height: calc(100vh - 32px);
	display: flex; flex-direction: column;
	animation: mmsConvSlideIn 0.3s ease; overflow: hidden; position: relative;
}
.mms-conv .modal-body   { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; }
.mms-conv .modal-footer { flex: 0 0 auto; }

/* Inline success-screen close button — pinned to top-right. */
.mms-conv .success-screen { position: relative; }
.mms-conv .success-close-btn {
	position: absolute;
	top: -8px;
	right: -8px;
	width: 36px;
	height: 36px;
	border-radius: 999px;
	border: none;
	background: rgba(23,30,59,0.05);
	color: #6b7280;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
	padding: 0;
	z-index: 2;
}
.mms-conv .success-close-btn:hover,
.mms-conv .success-close-btn:focus {
	background: rgba(23,30,59,0.12);
	color: #171E3B;
	outline: none;
}
@keyframes mmsConvSlideIn { from { opacity: 0; transform: translateY(20px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.mms-conv .close-btn {
	position: absolute; top: 16px; right: 16px; width: 36px; height: 36px;
	border-radius: 50%; border: none; background: transparent; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	color: var(--n400); transition: background 0.15s; z-index: 10;
}
.mms-conv .close-btn:hover { background: var(--n100); color: var(--n700); }

.mms-conv .modal-body { padding: 32px 40px 24px; }
@media (max-width: 480px) { .mms-conv .modal-body { padding: 24px 20px 16px; } }

/* ── PROGRESS ────────────────────────────────────────────────────── */
.mms-conv .progress-wrap { margin-bottom: 28px; }
.mms-conv .progress-labels { display: flex; justify-content: space-between; font-size: 0.8rem; margin-bottom: 8px; }
.mms-conv .progress-labels span:first-child { color: var(--n500); }
.mms-conv .progress-labels span:last-child { color: var(--n700); font-weight: 600; }
.mms-conv .progress-track { height: 8px; background: var(--n100); border-radius: 99px; overflow: hidden; }
.mms-conv .progress-bar { height: 100%; background: linear-gradient(to right, var(--p), var(--sec)); border-radius: 99px; transition: width 0.5s cubic-bezier(0.4,0,0.2,1); }

/* ── STEP HEADER ─────────────────────────────────────────────────── */
.mms-conv .step-header { text-align: center; margin-bottom: 28px; }
.mms-conv .step-icon { width: 64px; height: 64px; background: linear-gradient(135deg, var(--p100), #cffafe); border-radius: 15px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.mms-conv .step-icon svg { width: 30px; height: 30px; color: var(--p); }
.mms-conv .step-header .step-title { font-size: 1.7rem; font-weight: 700; color: var(--n800); margin-bottom: 6px; }
.mms-conv .step-header p { font-size: 0.95rem; color: var(--n500); line-height: 1.5; }

/* ── OPTIONS ─────────────────────────────────────────────────────── */
.mms-conv .options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.mms-conv .option-label { display: block; padding: 14px 16px; border: 2px solid var(--n200); border-radius: 15px; cursor: pointer; transition: all 0.15s; background: white; }
.mms-conv .option-label:hover { border-color: var(--n300); background: var(--n50); }
.mms-conv .option-label.selected { border-color: var(--p); background: var(--p50); }
.mms-conv .option-inner { display: flex; align-items: center; gap: 14px; }
.mms-conv .option-icon { width: 42px; height: 42px; border-radius: 15px; background: var(--n100); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 0.15s; }
.mms-conv .option-label.selected .option-icon { background: var(--p100); }
.mms-conv .option-icon svg { width: 20px; height: 20px; color: var(--n500); }
.mms-conv .option-label.selected .option-icon svg { color: var(--p); }
.mms-conv .option-text { flex: 1; }
.mms-conv .option-title { font-size: 0.95rem; font-weight: 600; color: var(--n800); }
.mms-conv .option-desc { font-size: 0.82rem; color: var(--n500); margin-top: 2px; }
.mms-conv .option-radio-dot { width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; border: 2px solid #d1d5db; background: white; transition: all 0.15s; }
.mms-conv .option-radio-dot.checked { border-color: var(--p); background: var(--p); box-shadow: inset 0 0 0 3px white; }

/* ── INPUT FIELDS ────────────────────────────────────────────────── */
.mms-conv .input-group { margin-bottom: 16px; }
.mms-conv .input-group label { display: block; font-size: 0.75rem; font-weight: 700; color: var(--n600); margin-bottom: 7px; text-transform: uppercase; letter-spacing: 0.04em; }
.mms-conv .input-wrap { position: relative; }
.mms-conv .input-prefix { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--n400); font-weight: 500; font-size: 0.95rem; pointer-events: none; }
.mms-conv .input-wrap input,
.mms-conv .input-group input,
.mms-conv .input-group select {
	width: 100%; padding: 12px 14px; border: 2px solid var(--n200); border-radius: 999px;
	font-size: 0.95rem; color: var(--n800);
	outline: none; transition: border-color 0.15s, box-shadow 0.15s; background: white; line-height: 1.4;
}
.mms-conv .input-wrap input { padding-left: 30px; }
.mms-conv .input-group input:focus,
.mms-conv .input-group select:focus,
.mms-conv .input-wrap input:focus { border-color: var(--p); box-shadow: 0 0 0 3px rgba(30, 50, 149, 0.1); }
.mms-conv .input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 400px) { .mms-conv .input-row { grid-template-columns: 1fr; } }


/* ── SUCCESS ─────────────────────────────────────────────────────── */
.mms-conv .success-screen { text-align: center; padding: 16px 0 8px; }
.mms-conv .success-icon { width: 80px; height: 80px; background: linear-gradient(135deg, #d1fae5, #a7f3d0); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.mms-conv .success-icon svg { width: 36px; height: 36px; color: #059669; }
.mms-conv .success-screen .success-title { font-size: 1.8rem; font-weight: 700; color: var(--n800); margin-bottom: 10px; }
.mms-conv .success-screen p { font-size: 0.95rem; color: var(--n500); line-height: 1.6; max-width: 380px; margin: 0 auto 24px; }
.mms-conv .success-details { background: var(--n50); border: 1px solid var(--n200); border-radius: 15px; padding: 18px 20px; text-align: left; margin-bottom: 20px; }
.mms-conv .detail-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--n100); font-size: 0.85rem; }
.mms-conv .detail-row:last-child { border-bottom: none; }
.mms-conv .detail-row span { color: var(--n500); }
.mms-conv .detail-row strong { color: var(--n800); font-weight: 600; }

/* ── FOOTER NAV ──────────────────────────────────────────────────── */
.mms-conv .modal-footer { display: flex; align-items: center; justify-content: space-between; padding: 16px 40px 28px; }
@media (max-width: 480px) { .mms-conv .modal-footer { padding: 12px 20px 20px; } }

.mms-conv .btn-back { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border: none; background: transparent; font-size: 0.95rem; font-weight: 600; color: var(--n600); cursor: pointer; border-radius: 999px; transition: all 0.15s; line-height: 1; }
.mms-conv .btn-back:hover:not(:disabled) { background: var(--n100); color: var(--n800); }
.mms-conv .btn-back:disabled { opacity: 0.4; cursor: not-allowed; }

.mms-conv .btn-next { display: flex; align-items: center; gap: 8px; padding: 12px 28px; border: none; background: linear-gradient(to right, var(--p), var(--pdk)); color: white; font-size: 0.95rem; font-weight: 700; border-radius: 999px; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 14px rgba(23, 30, 59, 0.2); line-height: 1; }
.mms-conv .btn-next:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(23, 30, 59, 0.3); }
.mms-conv .btn-next:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.mms-conv .step-content { animation: mmsConvFadeSlide 0.25s ease; }
@keyframes mmsConvFadeSlide { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }

/* ── MULTI-SELECT CHECKBOX OPTIONS (refinance goal step) ─────────── */
.mms-conv .option-checkbox .option-check-box {
	width: 22px; height: 22px; flex-shrink: 0;
	border: 2px solid #d1d5db; border-radius: 6px; background: white;
	display: flex; align-items: center; justify-content: center;
	transition: all 0.15s; color: transparent;
}
.mms-conv .option-checkbox .option-check-box svg { width: 14px; height: 14px; }
.mms-conv .option-checkbox.selected .option-check-box,
.mms-conv .option-checkbox .option-check-box.checked {
	border-color: var(--p); background: var(--p); color: white;
}

/* ── INPUT SUFFIX (% on rate / down-payment percentage) ───────────── */
.mms-conv .input-wrap-suffix .input-suffix {
	position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
	color: var(--n400); font-weight: 500; font-size: 0.95rem; pointer-events: none;
}
.mms-conv .input-wrap-suffix input { padding-right: 40px; padding-left: 18px; }

/* ── PROPERTY ADDRESS ROW (city / state / ZIP three-up) ───────────── */
.mms-conv .input-row-address { grid-template-columns: 2fr 1.2fr 1fr; }
@media (max-width: 600px) { .mms-conv .input-row-address { grid-template-columns: 1fr; } }

/* ── DISCLOSURE (credit score "won't affect your credit" notice) ──── */
.mms-conv .mms-disclosure {
	display: flex; align-items: center; gap: 10px;
	margin-top: 12px;
	padding: 12px 14px;
	background: var(--p50);
	border-radius: 12px;
	font-size: 0.85rem; color: var(--p);
	font-weight: 500;
}
.mms-conv .mms-disclosure svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Estimate disclaimer — small italic block below step content. */
.mms-conv .mms-conv-estimate-disclaimer {
	margin-top: 18px;
	padding: 12px 14px;
	background: var(--n50);
	border-radius: 10px;
	font-size: 0.72rem;
	font-style: italic;
	color: var(--n500);
	line-height: 1.5;
}
