/**
 * Sell BTC by Hayyat Apps — front-end styles.
 *
 * Scoped under .happs-sbtc-app; the wrapper resets inherited theme styles so
 * popular themes cannot override the widget and the widget cannot leak styles
 * into the theme. Two-panel, fully responsive exchange calculator.
 */

.happs-sbtc-app {
	--sbtc-primary: #3861fb;
	--sbtc-primary-lt: #5b76ff;
	--sbtc-primary-2: #2b4fd6;
	--sbtc-primary-soft: #eaeefe;
	--sbtc-ink: #1a2233;
	--sbtc-text: #26303f;
	--sbtc-muted: #7b8494;
	--sbtc-bg: #ffffff;
	--sbtc-panel: #f4f6fb;
	--sbtc-line: #e7eaf1;
	--sbtc-ok: #16a34a;
	--sbtc-err: #d33a2c;
	--sbtc-radius: 20px;
	--sbtc-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	letter-spacing: -0.006em;

	all: initial;
	display: block;
	box-sizing: border-box;
	font-family: var(--sbtc-font);
	color: var(--sbtc-text);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	width: 100%;
	max-width: 1080px;
	margin: 0 auto;
	overflow-wrap: break-word;
}
.happs-sbtc-app *,
.happs-sbtc-app *::before,
.happs-sbtc-app *::after { box-sizing: border-box; min-width: 0; max-width: 100%; }
.happs-sbtc-app svg { display: inline-block; vertical-align: middle; }

/* Harden text inputs against theme form styling (borders/backgrounds/shadows). */
.happs-sbtc-app .happs-sbtc-amt-in,
.happs-sbtc-app .happs-sbtc-coupon-in {
	border: 0 !important; background: transparent !important; box-shadow: none !important;
	outline: none !important; border-radius: 0 !important; margin: 0 !important; min-height: 0 !important;
	height: auto !important; line-height: 1.3; width: 100%; -webkit-appearance: none; appearance: none; color: var(--sbtc-ink);
}
.happs-sbtc-app .happs-sbtc-dd-search {
	border: 0 !important; border-radius: 0 !important; box-shadow: inset 0 -1px 0 var(--sbtc-line) !important;
	outline: none !important; margin: 0 !important; height: auto !important; min-height: 0 !important; width: 100%;
}

.happs-sbtc-mount { container-type: inline-size; container-name: sbtc; display: block; }

/* ---- layout ---- */
.happs-sbtc-cards-row { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
@container sbtc (min-width: 800px) {
	.happs-sbtc-cards-row { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 24px; }
}

.happs-sbtc-panel {
	background: var(--sbtc-bg); border: 1px solid #eef1f6; border-radius: var(--sbtc-radius);
	padding: 30px 32px; box-shadow: 0 6px 30px rgba(18, 38, 63, .05);
}
@container sbtc (max-width: 480px) { .happs-sbtc-panel { padding: 20px; } }

.happs-sbtc-step { font-size: 18px; font-weight: 700; color: var(--sbtc-ink); margin: 0 0 20px; letter-spacing: -.01em; }
.happs-sbtc-step-opt { color: var(--sbtc-muted); font-weight: 500; font-size: 14px; letter-spacing: 0; }
.happs-sbtc-lbl { display: block; font-size: 13px; color: var(--sbtc-muted); font-weight: 500; margin: 0 0 9px; }

/* ---- combined currency + amount control ---- */
.happs-sbtc-exch {
	display: flex; align-items: stretch; border: 1px solid #e6e9f1;
	border-radius: 14px; background: var(--sbtc-bg); margin-bottom: 4px; transition: border-color .15s, box-shadow .15s;
}
.happs-sbtc-exch:focus-within { border-color: var(--sbtc-primary); box-shadow: 0 0 0 3px var(--sbtc-primary-soft); }

.happs-sbtc-exch .happs-sbtc-dd { position: relative; flex: 0 0 auto; max-width: 52%; display: flex; }
.happs-sbtc-cursel {
	display: flex; align-items: center; gap: 11px; width: 100%; padding: 15px 16px; border: 0;
	border-right: 1px solid #e6e9f1; background: transparent; cursor: pointer; font: inherit;
	border-radius: 14px 0 0 14px; text-align: left; outline: none; transition: background .15s;
}
.happs-sbtc-cursel:hover { background: #fafbfe; }
.happs-sbtc-cursel-logo { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.happs-sbtc-cursel .happs-sbtc-coin-badge { width: 38px; height: 38px; font-size: 15px; }
.happs-sbtc-cursel-name { font-weight: 700; font-size: 15px; color: var(--sbtc-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.happs-sbtc-cursel-sym { color: var(--sbtc-muted); font-weight: 500; font-size: 13px; flex: 0 0 auto; }
.happs-sbtc-cursel-caret { color: #9aa2b2; margin-left: auto; flex: 0 0 auto; display: inline-flex; align-items: center; transition: transform .18s ease; }
.happs-sbtc-cursel-caret svg { width: 16px; height: 16px; }
.happs-sbtc-dd.is-open .happs-sbtc-cursel-caret { transform: rotate(180deg); color: var(--sbtc-primary); }

.happs-sbtc-amt { flex: 1 1 auto; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 10px 18px; min-width: 0; }
.happs-sbtc-amt-in { flex: 1 1 auto; min-width: 0; text-align: right; font-size: 24px; font-weight: 700; color: var(--sbtc-ink); font-variant-numeric: tabular-nums; }
.happs-sbtc-amt-in::placeholder { color: #c3c9d4; font-weight: 600; }
.happs-sbtc-amt-unit { color: var(--sbtc-muted); font-weight: 600; font-size: 15px; flex: 0 0 auto; }
.happs-sbtc-amt-spin { display: none; flex: 0 0 auto; align-items: center; }
.happs-sbtc-exch.is-loading .happs-sbtc-amt-in { display: none; }
.happs-sbtc-exch.is-loading .happs-sbtc-amt-spin { display: inline-flex; }
.happs-sbtc-spin2 { display: inline-block; width: 20px; height: 20px; border: 2.5px solid rgba(56, 97, 251, .2); border-top-color: var(--sbtc-primary); border-radius: 50%; animation: happs-sbtc-spin .7s linear infinite; }
@container sbtc (max-width: 420px) {
	.happs-sbtc-amt-in { font-size: 19px; }
	.happs-sbtc-cursel-name { display: none; }
	.happs-sbtc-exch .happs-sbtc-dd { max-width: 44%; }
}

/* ---- swap ---- */
.happs-sbtc-swap-wrap { display: flex; justify-content: center; margin: 12px 0; position: relative; z-index: 3; }
/* Scoped under .happs-sbtc-app with !important so aggressive theme `button`
   styles (blue fill, pill shape, hidden icon) can't hijack the swap button. */
.happs-sbtc-app .happs-sbtc-swap {
	-webkit-appearance: none !important; appearance: none !important; box-sizing: border-box !important;
	width: 44px !important; height: 44px !important; min-width: 0 !important; max-width: none !important;
	padding: 0 !important; margin: 0 !important; border-radius: 50% !important;
	border: 1px solid #e6e9f1 !important; background: var(--sbtc-bg) !important; color: #8b93a3 !important;
	cursor: pointer; display: inline-flex !important; align-items: center !important; justify-content: center !important;
	text-indent: 0 !important; font-size: 0 !important; line-height: 0 !important; text-shadow: none !important;
	box-shadow: 0 4px 14px rgba(15, 23, 42, .08) !important;
	transition: transform .22s ease, color .18s ease, box-shadow .18s;
}
.happs-sbtc-app .happs-sbtc-swap > svg {
	display: block !important; width: 18px !important; height: 18px !important;
	fill: none !important; stroke: currentColor !important; opacity: 1 !important;
}
.happs-sbtc-app .happs-sbtc-swap:hover {
	color: var(--sbtc-primary) !important; background: var(--sbtc-bg) !important; transform: rotate(180deg);
	box-shadow: 0 6px 18px color-mix(in srgb, var(--sbtc-primary) 18%, transparent) !important;
}
.happs-sbtc-app .happs-sbtc-swap:focus-visible { outline: 2px solid var(--sbtc-primary); outline-offset: 2px; }

/* ---- dropdown ---- */
.happs-sbtc-dd-panel {
	position: absolute; top: calc(100% + 8px); left: 0; z-index: 50; width: 280px; max-width: 78vw;
	background: var(--sbtc-bg); border: 1px solid var(--sbtc-line); border-radius: 14px;
	box-shadow: 0 16px 44px rgba(15, 23, 42, .18); display: none; overflow: hidden;
}
.happs-sbtc-dd-panel.is-open { display: block; }
.happs-sbtc-dd-search { width: 100%; border: 0; border-bottom: 1px solid var(--sbtc-line); padding: 12px 14px; font: inherit; outline: none; background: var(--sbtc-panel); color: var(--sbtc-text); }
.happs-sbtc-dd-list { max-height: 280px; overflow-y: auto; }
.happs-sbtc-dd-opt { display: flex; align-items: center; gap: 9px; padding: 10px 13px; cursor: pointer; }
.happs-sbtc-dd-opt:hover, .happs-sbtc-dd-opt.is-sel { background: var(--sbtc-panel); }
.happs-sbtc-dd-opt img { width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto; object-fit: cover; }
.happs-sbtc-dd-optsym { font-weight: 700; flex: 0 0 auto; color: var(--sbtc-ink); }
.happs-sbtc-dd-optname { color: var(--sbtc-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.happs-sbtc-dd-sep { padding: 7px 13px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--sbtc-muted); background: var(--sbtc-panel); border-top: 1px solid var(--sbtc-line); border-bottom: 1px solid var(--sbtc-line); }
.happs-sbtc-dd-empty { padding: 14px; text-align: center; color: var(--sbtc-muted); }
.happs-sbtc-coin-badge { width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; background: var(--sbtc-panel); color: var(--sbtc-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }

/* ---- coupon ---- */
.happs-sbtc-coupon { margin-top: 22px; }
.happs-sbtc-coupon .happs-sbtc-step { margin: 0 0 14px; }
.happs-sbtc-coupon-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.happs-sbtc-coupon-box { display: flex; align-items: center; gap: 10px; flex: 1 1 220px; border: 1px solid #e6e9f1; border-radius: 12px; padding: 14px 15px; background: var(--sbtc-bg); }
.happs-sbtc-coupon-box:focus-within { border-color: var(--sbtc-primary); box-shadow: 0 0 0 3px var(--sbtc-primary-soft); }
.happs-sbtc-coupon-box.is-applied { border-color: var(--sbtc-ok); }
.happs-sbtc-coupon-tag { color: #aeb4c0; display: inline-flex; flex: 0 0 auto; }
.happs-sbtc-coupon-in { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 15px; color: var(--sbtc-ink); }
.happs-sbtc-coupon-in::placeholder { color: #aab0bd; }
.happs-sbtc-coupon-check { color: var(--sbtc-ok); display: none; flex: 0 0 auto; }
.happs-sbtc-coupon-badge { display: none; align-items: center; background: #dcfce7; color: #15803d; font-weight: 700; font-size: 12px; padding: 7px 12px; border-radius: 8px; flex: 0 0 auto; }
.happs-sbtc-coupon-apply { border: 1px solid #e6e9f1; background: var(--sbtc-bg); border-radius: 12px; padding: 14px 22px; font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; color: var(--sbtc-ink); flex: 0 0 auto; transition: background .15s; }
.happs-sbtc-coupon-apply:hover { background: var(--sbtc-panel); }
.happs-sbtc-coupon-remove { color: var(--sbtc-primary); font-weight: 600; text-decoration: none; font-size: 14px; flex: 0 0 auto; }
.happs-sbtc-coupon-msg { display: flex; align-items: center; gap: 6px; margin-top: 11px; font-size: 13.5px; }
.happs-sbtc-coupon-msg.is-ok { color: var(--sbtc-ok); }
.happs-sbtc-coupon-msg.is-error { color: var(--sbtc-err); }
.happs-sbtc-coupon-msg.is-hidden { display: none; }
.happs-sbtc-coupon-msg svg { flex: 0 0 auto; }

/* ---- primary buttons ---- */
.happs-sbtc-cta {
	display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; border: 0;
	border-radius: 14px; padding: 17px 22px; cursor: pointer; font: inherit; font-weight: 700; font-size: 16px;
	color: #fff; background: linear-gradient(135deg, var(--sbtc-primary-lt) 0%, var(--sbtc-primary) 100%);
	box-shadow: 0 12px 24px color-mix(in srgb, var(--sbtc-primary) 30%, transparent); transition: filter .15s ease, box-shadow .15s ease, transform .05s;
}
.happs-sbtc-panel-form > .happs-sbtc-cta { margin-top: 24px; }
.happs-sbtc-panel-sum > .happs-sbtc-cta { margin-top: 18px; }
.happs-sbtc-cta-note {
	margin: 18px 0 0; padding: 13px 16px; border-radius: 12px; text-align: center;
	background: var(--sbtc-soft, #f1f4fb); color: var(--sbtc-muted, #64748b); font-size: 13.5px; font-weight: 500;
}
.happs-sbtc-cta:hover { filter: brightness(1.05); box-shadow: 0 14px 30px color-mix(in srgb, var(--sbtc-primary) 38%, transparent); }
.happs-sbtc-cta:active { transform: translateY(1px); }
.happs-sbtc-cta[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; filter: none; }
.happs-sbtc-cta-ic { display: inline-flex; }

.happs-sbtc-secure { display: flex; align-items: center; justify-content: center; gap: 6px; color: #9aa2b2; font-size: 13px; margin-top: 14px; }

/* ---- conversion summary ---- */
.happs-sbtc-sum-title { font-size: 19px; font-weight: 700; color: var(--sbtc-ink); margin: 0 0 20px; letter-spacing: -.01em; }
.happs-sbtc-sum-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; font-size: 13px; }
.happs-sbtc-sum-row > span { color: var(--sbtc-muted); font-weight: 500; }
.happs-sbtc-sum-row b { color: var(--sbtc-ink); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.happs-sbtc-sum-div { height: 1px; background: #eef1f6; margin: 16px 0; }
.happs-sbtc-sum-lines { display: flex; flex-direction: column; gap: 16px; }
.happs-sbtc-sum-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; }
.happs-sbtc-sum-line-lbl { color: var(--sbtc-muted); font-weight: 500; display: inline-flex; align-items: center; gap: 5px; }
.happs-sbtc-sum-line-lbl svg { opacity: .5; }
.happs-sbtc-sum-line > span:last-child { color: var(--sbtc-ink); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.happs-sbtc-sum-line.is-fees { font-size: 13px; }
.happs-sbtc-sum-line.is-fees .happs-sbtc-sum-line-lbl { color: var(--sbtc-ink); font-weight: 700; }
.happs-sbtc-sum-line.is-fees > span:last-child { font-weight: 700; }
.happs-sbtc-sum-line s { color: #aab0bd; font-weight: 400; margin-right: 6px; }
.happs-sbtc-pos { color: var(--sbtc-ok); font-style: normal; font-weight: 700; }
.happs-sbtc-sum-highlight { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--sbtc-primary-soft); border-radius: 14px; padding: 18px 20px; margin: 18px 0 6px; }
.happs-sbtc-sum-highlight > span { color: var(--sbtc-ink); font-weight: 700; font-size: 13px; }
.happs-sbtc-sum-hl-val { color: var(--sbtc-primary); font-weight: 800; font-size: 21px; text-align: right; font-variant-numeric: tabular-nums; }
.happs-sbtc-sum-timer { text-align: center; font-size: 12.5px; color: var(--sbtc-muted); margin: 14px 0 2px; }
.happs-sbtc-sum-timer b { color: var(--sbtc-ink); font-variant-numeric: tabular-nums; }
.happs-sbtc-sum-timer.is-expired { color: var(--sbtc-err); }

.happs-sbtc-sum-body { transition: opacity .12s ease; }
.happs-sbtc-sum-body.is-loading { opacity: .5; }
.happs-sbtc-sum-ph { text-align: center; color: var(--sbtc-muted); padding: 34px 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.happs-sbtc-sum-ph-ic { width: 46px; height: 46px; border-radius: 50%; background: var(--sbtc-panel); display: inline-flex; align-items: center; justify-content: center; color: var(--sbtc-muted); }
.happs-sbtc-sum-ph p { margin: 0; font-size: 14px; }

.happs-sbtc-trust { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.happs-sbtc-trust-item { display: inline-flex; align-items: center; gap: 6px; color: var(--sbtc-muted); font-size: 13px; }
.happs-sbtc-trust-ic { color: var(--sbtc-ok); display: inline-flex; }

/* ---- info bar ---- */
.happs-sbtc-infobar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--sbtc-primary-soft); border-radius: 14px; padding: 16px 22px; margin-top: 20px; font-size: 14px; color: #46506a; }
.happs-sbtc-infobar-left { display: inline-flex; align-items: center; gap: 8px; }
.happs-sbtc-infobar-ic { color: var(--sbtc-primary); display: inline-flex; }
.happs-sbtc-infobar-right { display: inline-flex; align-items: center; gap: 8px; color: var(--sbtc-muted); white-space: nowrap; }
.happs-sbtc-infobar-right b { color: var(--sbtc-ink); }
.happs-sbtc-refresh { border: 0; background: transparent; color: var(--sbtc-primary); cursor: pointer; display: inline-flex; padding: 2px; }

/* ---- states / message / spinner ---- */
.happs-sbtc-msg { font-size: 13.5px; margin-top: 14px; padding: 11px 15px; border-radius: 11px; }
.happs-sbtc-msg.is-info { background: var(--sbtc-panel); color: var(--sbtc-muted); }
.happs-sbtc-msg.is-error { background: rgba(211, 58, 44, .08); color: var(--sbtc-err); }
.happs-sbtc-msg.is-hidden { display: none; }
.happs-sbtc-spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; border-radius: 50%; animation: happs-sbtc-spin .7s linear infinite; }
.happs-sbtc-sum-ph .happs-sbtc-spinner { border-color: rgba(56, 97, 251, .25); border-top-color: var(--sbtc-primary); }
@keyframes happs-sbtc-spin { to { transform: rotate(360deg); } }

.happs-sbtc-branding { font-size: 11.5px; color: var(--sbtc-muted); text-align: center; margin-top: 12px; }
.happs-sbtc-branding a { color: var(--sbtc-primary); text-decoration: none; }

/* ---- rate table shortcode ---- */
.happs-sbtc-rate-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.happs-sbtc-rate-table th, .happs-sbtc-rate-table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--sbtc-line); }
.happs-sbtc-rate-table th { color: var(--sbtc-muted); font-weight: 600; }
.happs-sbtc-rate-table img { vertical-align: middle; margin-right: 6px; border-radius: 50%; object-fit: cover; }

/* ---- breathing room on small screens ---- */
@media (max-width: 640px) {
	.happs-sbtc-app { padding-left: 16px; padding-right: 16px; }
}

/* ---- dark theme opt-in ---- */
.happs-sbtc-app[data-theme="dark"] {
	--sbtc-ink: #eef2f8; --sbtc-text: #dbe2ec; --sbtc-muted: #97a2b4; --sbtc-bg: #131a24;
	--sbtc-panel: #1c2531; --sbtc-line: #2b3644; --sbtc-primary-soft: #1e2a4a;
}
