/*
 * همکاری در فروش — account screen + landing page.
 *
 * Built on the Abzarct theme's tokens; every custom property carries a literal
 * fallback so the screens still read correctly under another theme.
 * Primary action is TEAL: red is the theme's «buy» colour and blue its
 * «keep going» colour, so neither is borrowed here.
 */

.aff {
	display: flex;
	flex-direction: column;
	gap: 14px;
	font-size: var(--fs-13, 0.8125rem);
	color: var(--c-text, #25272C);
	line-height: 1.9;
}

.aff *,
.aff *::before,
.aff *::after {
	box-sizing: border-box;
}

.aff p {
	margin: 0;
}

/* ---- Cards ------------------------------------------------------------- */

.aff-card {
	background: var(--c-surface, #fff);
	border: 1px solid var(--c-line, #D8DBDF);
	border-radius: var(--r-lg, 12px);
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.aff-cardtitle {
	margin: 0;
	font-size: var(--fs-14, 0.875rem);
	font-weight: var(--fw-bold, 700);
	color: var(--c-gray-700, #40444C);
}

.aff-title {
	margin: 0;
	font-size: var(--fs-16, 1rem);
	font-weight: var(--fw-bold, 700);
	line-height: 1.6;
}

.aff-sub {
	margin: 0;
	font-size: var(--fs-12, 0.75rem);
	color: var(--c-text-muted, #757575);
}

.aff-hint {
	display: block;
	font-size: var(--fs-11, 0.6875rem);
	color: var(--c-text-dim, #8E95A2);
	line-height: 1.9;
}

.aff-center {
	text-align: center;
}

.aff-dot {
	margin-inline: 6px;
	color: var(--c-gray-300, #B6BAC3);
}

/* ---- Hero -------------------------------------------------------------- */

.aff-hero {
	background:
		radial-gradient(120% 90% at 100% 0%, var(--c-teal-100, #CCFBF1) 0%, rgba(204, 251, 241, 0) 60%),
		var(--c-surface, #fff);
}

.aff-hero__head {
	display: flex;
	align-items: center;
	gap: 12px;
}

.aff-hero__ic {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--c-teal, #14B8A6);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: var(--shadow-teal, 0 4px 20px rgba(20, 184, 166, 0.08));
}

.aff-hero__ic svg {
	width: 24px;
	height: 24px;
}

.aff-hero b[dir="ltr"] {
	font-family: ui-monospace, Menlo, Consolas, monospace;
	color: var(--c-teal-600, #0D9488);
	letter-spacing: 0.5px;
}

.aff-prose {
	display: flex;
	flex-direction: column;
	gap: 6px;
	color: var(--c-gray-700, #40444C);
}

/* ---- Steps ------------------------------------------------------------- */

.aff-steps {
	list-style: none;
	margin: 4px 0 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.aff-step {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0;
	padding: 12px;
	background: var(--c-bg, #F9FAFB);
	border-radius: var(--r, 6px);
}

.aff-step__ic {
	position: relative;
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--c-surface, #fff);
	color: var(--c-teal-600, #0D9488);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.aff-step__ic svg {
	width: 20px;
	height: 20px;
}

.aff-step__ic b {
	position: absolute;
	top: -4px;
	inset-inline-end: -4px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--c-teal, #14B8A6);
	color: #fff;
	font-size: 10px;
	line-height: 18px;
	text-align: center;
}

.aff-step__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.aff-step__text strong {
	font-size: var(--fs-13, 0.8125rem);
}

.aff-step__text span {
	font-size: var(--fs-12, 0.75rem);
	color: var(--c-text-muted, #757575);
}

/* ---- Buttons ----------------------------------------------------------- */

.aff-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 44px;
	padding: 10px 18px;
	border: 1px solid transparent;
	border-radius: var(--r, 6px);
	font-family: inherit;
	font-size: var(--fs-13, 0.8125rem);
	font-weight: var(--fw-bold, 700);
	line-height: 1.4;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
	transition: filter 0.15s ease, background-color 0.15s ease;
}

.aff-btn svg {
	width: 18px;
	height: 18px;
}

.aff-btn--primary {
	background: var(--c-teal, #14B8A6);
	color: #fff;
}

.aff-btn--primary:hover {
	filter: brightness(0.95);
	color: #fff;
}

.aff-btn--ghost {
	background: var(--c-surface, #fff);
	border-color: var(--c-line, #D8DBDF);
	color: var(--c-text, #25272C);
}

.aff-btn--soft {
	background: var(--c-bg, #F9FAFB);
	color: var(--c-gray-700, #40444C);
}

.aff-btn--block {
	width: 100%;
}

.aff-btn[disabled] {
	background: var(--c-line, #D8DBDF);
	color: var(--c-gray-500, #757575);
	cursor: not-allowed;
	filter: none;
}

.aff-btn.is-done {
	border-color: var(--c-teal, #14B8A6);
	color: var(--c-teal-600, #0D9488);
}

/* ---- Copy field + share ------------------------------------------------ */

.aff-label {
	font-size: var(--fs-12, 0.75rem);
	color: var(--c-text-muted, #757575);
	margin-top: 4px;
}

.aff-copy {
	display: flex;
	gap: 8px;
}

.aff-copy input,
.aff-builder input {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 44px;
	padding: 8px 12px;
	background: var(--c-bg, #F9FAFB);
	border: 1px solid var(--c-line, #D8DBDF);
	border-radius: var(--r, 6px);
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 12px;
	color: var(--c-text, #25272C);
	text-align: left;
}

.aff-copy input:focus,
.aff-builder input:focus {
	outline: none;
	border-color: var(--c-teal, #14B8A6);
}

.aff-share {
	display: flex;
	gap: 8px;
}

.aff-share .aff-btn {
	flex: 1 1 0;
}

.aff-builder {
	display: flex;
	gap: 8px;
}

.aff-builder__err {
	margin: 0;
	color: var(--c-red, #EB3F3F);
	font-size: var(--fs-12, 0.75rem);
}

/* ---- Stats ------------------------------------------------------------- */

.aff-stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.aff-stat {
	background: var(--c-surface, #fff);
	border: 1px solid var(--c-line, #D8DBDF);
	border-radius: var(--r-lg, 12px);
	padding: 14px 10px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	text-align: center;
}

.aff-stat__num {
	font-size: var(--fs-16, 1rem);
	font-weight: var(--fw-bold, 700);
	color: var(--c-gray-700, #40444C);
	white-space: nowrap;
}

.aff-stat__label {
	font-size: var(--fs-12, 0.75rem);
	color: var(--c-gray-600, #5B616E);
}

.aff-stat--wait .aff-stat__num {
	color: #B97F00;
}

.aff-stat--ok .aff-stat__num {
	color: var(--c-teal-600, #0D9488);
}

/* ---- Forms ------------------------------------------------------------- */

.aff-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.aff-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
}

.aff-field label {
	font-size: var(--fs-12, 0.75rem);
	color: var(--c-text-muted, #757575);
}

.aff-req {
	color: var(--c-red, #EB3F3F);
}

.aff-field input,
.aff-field textarea {
	width: 100%;
	min-height: 46px;
	padding: 10px 14px;
	background: var(--c-bg, #F9FAFB);
	border: 1px solid var(--c-line, #D8DBDF);
	border-radius: var(--r, 6px);
	font-family: inherit;
	font-size: var(--fs-13, 0.8125rem);
	color: var(--c-text, #25272C);
}

.aff-field textarea {
	resize: vertical;
	line-height: 1.9;
}

.aff-field input:focus,
.aff-field textarea:focus {
	outline: none;
	border-color: var(--c-teal, #14B8A6);
}

.aff-static {
	font-weight: var(--fw-bold, 700);
	text-align: right;
}

.aff-prefix {
	display: flex;
	align-items: stretch;
	border: 1px solid var(--c-line, #D8DBDF);
	border-radius: var(--r, 6px);
	background: var(--c-bg, #F9FAFB);
	overflow: hidden;
}

.aff-prefix > span {
	display: inline-flex;
	align-items: center;
	padding: 0 10px;
	background: var(--c-surface, #fff);
	border-inline-end: 1px solid var(--c-line, #D8DBDF);
	font-size: 11px;
	color: var(--c-gray-500, #757575);
	white-space: nowrap;
	max-width: 60%;
	overflow: hidden;
	text-overflow: ellipsis;
}

.aff-field .aff-prefix input {
	border: 0;
	border-radius: 0;
	min-width: 0;
	text-align: left;
}

.aff-check {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: var(--fs-12, 0.75rem);
	cursor: pointer;
}

.aff-check input {
	width: 18px;
	height: 18px;
	margin: 3px 0 0;
	accent-color: var(--c-teal, #14B8A6);
}

/* ---- Notes ------------------------------------------------------------- */

.aff-note {
	padding: 12px 14px;
	border-radius: var(--r, 6px);
	font-size: var(--fs-12, 0.75rem);
	font-weight: var(--fw-medium, 500);
}

.aff-note--ok {
	background: var(--c-teal-100, #CCFBF1);
	color: var(--c-teal-600, #0D9488);
}

.aff-note--err {
	background: #FDECEC;
	color: var(--c-red-ink, #C33E40);
}

.aff-note--info {
	background: #FFF6E0;
	color: #8A5F00;
}

/* ---- Status card ------------------------------------------------------- */

.aff-status {
	align-items: center;
	text-align: center;
	padding-block: 26px;
}

.aff-status__ic {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: #FFF6E0;
	color: #B97F00;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.aff-status__ic svg {
	width: 30px;
	height: 30px;
}

.aff-status--rejected .aff-status__ic,
.aff-status--suspended .aff-status__ic {
	background: #FDECEC;
	color: var(--c-red, #EB3F3F);
}

.aff-status__note {
	padding: 10px 12px;
	background: var(--c-bg, #F9FAFB);
	border-radius: var(--r, 6px);
	font-size: var(--fs-12, 0.75rem);
}

.aff-kv {
	display: flex;
	gap: 24px;
	margin: 6px 0 0;
}

.aff-kv div {
	display: flex;
	flex-direction: column;
}

.aff-kv dt {
	font-size: var(--fs-11, 0.6875rem);
	color: var(--c-text-dim, #8E95A2);
}

.aff-kv dd {
	margin: 0;
	font-weight: var(--fw-bold, 700);
}

/* ---- Wallet ------------------------------------------------------------ */

.aff-wallet__sum {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 14px;
	background: var(--c-teal-100, #CCFBF1);
	border-radius: var(--r, 6px);
	color: var(--c-teal-600, #0D9488);
}

.aff-wallet__sum strong {
	font-size: var(--fs-16, 1rem);
}

.aff-bank {
	padding-top: 10px;
	border-top: 1px dashed var(--c-line, #D8DBDF);
}

.aff-bank .aff-btn {
	align-self: flex-start;
}

#abzaff_sheba {
	font-family: ui-monospace, Menlo, Consolas, monospace;
	letter-spacing: 0.5px;
	text-align: left;
}

.aff-payout {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

/* ---- Ledger rows ------------------------------------------------------- */

.aff-rows {
	list-style: none;
	margin: 0;
	padding: 0;
}

.aff-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0;
	padding: 10px 0;
	border-top: 1px solid var(--c-bg, #F3F4F6);
}

.aff-row:first-child {
	border-top: 0;
}

.aff-row__main,
.aff-row__side {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.aff-row__side {
	align-items: flex-end;
	flex: 0 0 auto;
}

.aff-row__title {
	font-weight: var(--fw-bold, 700);
	font-size: var(--fs-13, 0.8125rem);
}

.aff-row__sub {
	font-size: var(--fs-11, 0.6875rem);
	color: var(--c-text-muted, #757575);
}

.aff-row__amount {
	font-weight: var(--fw-bold, 700);
	white-space: nowrap;
}

.aff-row__amount.is-neg {
	color: var(--c-red, #EB3F3F);
}

.aff-badge {
	font-size: var(--fs-10, 0.625rem);
	font-weight: var(--fw-medium, 500);
	padding: 2px 8px;
	border-radius: var(--r-pill, 100px);
	background: var(--c-bg, #F9FAFB);
	color: var(--c-gray-600, #5B616E);
	white-space: nowrap;
	line-height: 1.8;
}

.aff-badge--pending,
.aff-badge--p-requested { background: #FFEECE; color: #B97F00; }
.aff-badge--approved    { background: var(--c-teal-100, #CCFBF1); color: var(--c-teal-600, #0D9488); }
.aff-badge--paid,
.aff-badge--p-paid      { background: var(--c-indigo-50, #EEEEFF); color: var(--c-indigo-600, #4649E5); }
.aff-badge--rejected,
.aff-badge--p-rejected  { background: #FDECEC; color: var(--c-red, #EB3F3F); }

.aff-empty {
	padding: 18px 0;
	text-align: center;
	color: var(--c-text-muted, #757575);
	font-size: var(--fs-12, 0.75rem);
}

.aff-pager {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding-top: 10px;
	font-size: var(--fs-12, 0.75rem);
	color: var(--c-text-muted, #757575);
}

/* ---- Terms ------------------------------------------------------------- */

.aff-terms {
	gap: 0;
	padding: 0;
}

.aff-terms > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	font-weight: var(--fw-bold, 700);
	font-size: var(--fs-13, 0.8125rem);
	cursor: pointer;
	list-style: none;
}

.aff-terms > summary::-webkit-details-marker {
	display: none;
}

.aff-terms > summary svg {
	width: 18px;
	height: 18px;
	transition: transform 0.2s ease;
}

.aff-terms[open] > summary svg {
	transform: rotate(180deg);
}

.aff-terms ul {
	margin: 0;
	padding: 0 16px 14px 16px;
	padding-inline-start: 32px;
	font-size: var(--fs-12, 0.75rem);
	color: var(--c-gray-700, #40444C);
}

.aff-terms li {
	margin: 0 0 4px;
}

.aff-form .aff-terms {
	border-style: dashed;
}

/* ---- Landing ----------------------------------------------------------- */

.aff--landing {
	max-width: 720px;
	margin-inline: auto;
}

.aff-facts {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.aff-fact {
	background: var(--c-surface, #fff);
	border: 1px solid var(--c-line, #D8DBDF);
	border-radius: var(--r-lg, 12px);
	padding: 14px 8px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 2px;
}

.aff-fact strong {
	font-size: var(--fs-14, 0.875rem);
	color: var(--c-teal-600, #0D9488);
}

.aff-fact span {
	font-size: var(--fs-11, 0.6875rem);
	color: var(--c-text-muted, #757575);
}

/* ---- Desktop ----------------------------------------------------------- */

@media (min-width: 768px) {
	.aff-stats {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.aff-steps {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.aff-step {
		flex-direction: column;
	}

	.aff-share {
		max-width: 360px;
	}

	.aff-card {
		padding: 20px;
	}

	.aff-bank {
		display: grid;
		grid-template-columns: 1fr 1fr;
		align-items: end;
	}

	.aff-bank .aff-hint,
	.aff-bank .aff-btn {
		grid-column: 1 / -1;
	}

	.aff-payout {
		max-width: 360px;
	}
}
