/**
 * Installment CTA — brand accent, tones, and the lead answer panel.
 *
 * The card keeps the theme's `.aitp-credit-cta` geometry so it always lines up with
 * the add-to-cart button above it; everything that changes per rule (provider colour,
 * warning/offline look) is driven by the `--im-inst-accent` custom property and one
 * `im-inst-tone-*` class, both printed on the element by IM_Installment.
 */

.im-inst-slot,
.im-inst-block,
.im-inst-wrap { display: block; }

.im-inst-block[hidden] { display: none; }

/* ---------- the card ---------- */

.im-inst-cta-box {
	--im-inst-accent: #1159fc;
	border-color: color-mix(in srgb, var(--im-inst-accent) 28%, transparent);
	color: var(--im-inst-accent);
}

/* Browsers without color-mix still get a readable card. */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
	.im-inst-cta-box { border-color: rgba(0, 62, 255, .28); }
}

.im-inst-cta-box:hover {
	background: color-mix(in srgb, var(--im-inst-accent) 4%, #fff);
	border-color: color-mix(in srgb, var(--im-inst-accent) 46%, transparent);
}

.im-inst-cta-box .aitp-credit-cta__icon {
	background: color-mix(in srgb, var(--im-inst-accent) 8%, transparent);
	overflow: hidden;
}
.im-inst-cta-box .aitp-credit-cta__icon img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

/* ---------- lead panel (title + reason + CTA) ---------- */

/* The theme's card is a centred flex row; the lead panel stacks instead. */
.im-inst-panel {
	display: block;
	box-sizing: border-box;
	padding: 12px;
	text-align: right;
}

.im-inst-panel__head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 6px;
}

.im-inst-panel__title {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
}

.im-inst-panel__note {
	display: flex;
	align-items: flex-start;
	gap: 7px;
	margin: 0 0 10px;
	font-size: 12.5px;
	font-weight: 500;
	line-height: 1.85;
}

.im-inst-panel__x {
	flex-shrink: 0;
	width: 17px;
	height: 17px;
	margin-top: 3px;
	color: #dc2626;
}
.im-inst-panel__x svg { width: 100%; height: 100%; display: block; }

/* The CTA that actually collects the number. */
.im-inst-btn {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 10px 16px;
	border: 0;
	border-radius: 10px;
	background: var(--im-inst-accent, #1159fc);
	color: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
	text-align: center;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	transition: filter .15s, transform .12s;
}
.im-inst-btn:hover { filter: brightness(1.07); }
.im-inst-btn:active { transform: translateY(1px); }

.im-inst-btn.is-busy {
	opacity: .6;
	pointer-events: none;
}

/* ---------- tones ---------- */

/* «اخطار» — the offer exists but is not usable right now. */
.im-inst-tone-warning {
	border-color: rgba(234, 88, 12, .42);
	background: rgba(234, 88, 12, .05);
}
.im-inst-tone-warning:hover {
	background: rgba(234, 88, 12, .09);
	border-color: rgba(234, 88, 12, .6);
}
.im-inst-tone-warning .aitp-credit-cta__text strong,
.im-inst-tone-warning .im-inst-panel__title { color: #9a3412; }
.im-inst-tone-warning .im-inst-panel__note { color: #7c2d12; }
.im-inst-tone-warning .im-inst-sub {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: #b45309;
	font-weight: 700;
	opacity: 1;
}
.im-inst-tone-warning .im-inst-sub::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #f59e0b;
	flex-shrink: 0;
}

/* «خاموش» — reads as switched off; still clickable in lead mode. */
.im-inst-tone-muted {
	border-color: rgba(100, 116, 139, .32);
	background: rgba(100, 116, 139, .05);
}
.im-inst-tone-muted:hover {
	background: rgba(100, 116, 139, .09);
	border-color: rgba(100, 116, 139, .48);
}
.im-inst-tone-muted .aitp-credit-cta__text strong,
.im-inst-tone-muted .im-inst-panel__title { color: #475569; }
.im-inst-tone-muted .im-inst-panel__note { color: #64748b; }
.im-inst-tone-muted .im-inst-btn { background: #64748b; }
.im-inst-tone-muted .im-inst-sub { color: #64748b; font-weight: 600; opacity: 1; }
.im-inst-tone-muted .aitp-credit-cta__icon { background: rgba(100, 116, 139, .1); }
.im-inst-tone-muted .aitp-credit-cta__icon svg,
.im-inst-tone-muted .aitp-credit-cta__icon img { filter: grayscale(1); opacity: .75; }

/* ---------- lead answer ---------- */

/* Confirmation after the number is stored. */
.im-inst-result {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 16px 16px;
	padding: 12px;
	border: 1px solid rgba(22, 163, 74, .34);
	border-radius: 12px;
	background: rgba(22, 163, 74, .07);
	color: #14532d;
	line-height: 1.7;
}

.im-inst-result[hidden] { display: none; }

.im-inst-result__icon {
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	margin-top: 2px;
	color: #16a34a;
}

.im-inst-result__icon svg { width: 100%; height: 100%; display: block; }

.im-inst-result__text p {
	margin: 0 0 4px;
	font-size: 13.5px;
	font-weight: 500;
}

.im-inst-result__text p:last-child { margin-bottom: 0; }

.im-inst-error {
	margin: -8px 16px 12px;
	font-size: 12.5px;
	font-weight: 600;
	color: #b91c1c;
}

@media (max-width: 720px) {
	button.im-inst-cta-box { width: calc(100% - 24px); }
	.im-inst-result { margin: 0 12px 12px; }
	.im-inst-result__text p { font-size: 12.5px; }
	.im-inst-error { margin: -6px 12px 10px; }
}
