/**
 * SF Client Portal - frontend styles.
 *
 * Mobile-first, RTL, editorial look: wide whitespace, big Arabic type, and
 * the studio tint carrying the page.
 *
 * Every colour comes from a custom property. The brand ones are printed by
 * Settings::inline_css() from the three colours the owner picked, including
 * derived tones and contrast-corrected inks; the semantic ones are declared
 * once below, because a status colour must keep meaning red or green
 * whatever the brand hue is.
 */

.sf-portal {
	--sf-radius: 14px;

	/* Status colours: meaning first, so these do not follow the brand. */
	--sf-danger: #b3261e;
	--sf-danger-bg: #fdecea;
	--sf-success: #1e7e34;
	--sf-success-bg: #e6f4ea;
	--sf-info: #1a56db;
	--sf-info-bg: #e8f0fe;
	--sf-warn: #b45309;
	--sf-warn-bg: #fef3e2;
	--sf-neutral: #4b5563;
	--sf-neutral-bg: #eceef1;
	--sf-whatsapp: #167f3d;
	--sf-whatsapp-ink: #ffffff;

	font-family: var( --sf-font, system-ui, sans-serif );
	color: var( --sf-text );
	max-width: 720px;
	margin: 0 auto;
	padding: 24px 16px 64px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	position: relative;
	/* Also on the element itself, so the column stays tinted even where the
	   fixed layer below cannot paint. */
	background: var( --sf-bg );
}

/*
 * The portal is a shortcode dropped into whatever page template the theme
 * provides, so it cannot own the document background. A fixed layer behind
 * the content lets the studio tint carry the whole viewport the way it does
 * on the transfer page and in the emails.
 */
.sf-portal::before {
	content: '';
	position: fixed;
	inset: 0;
	background: var( --sf-bg );
	z-index: -1;
}

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

/* One visible focus ring for every interactive element. There was none. */
.sf-portal :focus-visible {
	outline: 3px solid var( --sf-primary );
	outline-offset: 2px;
	border-radius: 6px;
}

/* ------------------------------------------------------------------ */
/* Standalone layout                                                   */
/* ------------------------------------------------------------------ */

/* The portal owns the document: no theme header, menu, sidebar or footer. */
body.sf-standalone {
	margin: 0;
	padding: 0;
	background: var( --sf-bg );
}

.sf-portal-intro {
	max-width: 720px;
	margin: 0 auto;
	padding: 24px 16px 0;
	font-family: var( --sf-font, system-ui, sans-serif );
	color: var( --sf-text );
	line-height: 1.8;
}

.sf-portal-intro p {
	margin: 0 0 10px;
}

/* ------------------------------------------------------------------ */
/* Brand header                                                        */
/* ------------------------------------------------------------------ */

/*
 * Themes routinely style content images with a background, a border, a
 * shadow or padding, which on the brand tint shows up as a box around the
 * logo. None of it belongs here, so it is refused outright.
 */
.sf-portal img {
	background: none !important;
	border: 0 !important;
	box-shadow: none !important;
	padding: 0 !important;
	border-radius: 0 !important;
}

.sf-brand {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-bottom: 22px;
	text-align: center;
}

.sf-brand-logo {
	display: block;
	max-width: 168px;
	max-height: 52px;
	width: auto;
	height: auto;
}

.sf-brand-name {
	font-family: var( --sf-display, inherit );
	font-size: 20px;
	font-weight: 900;
	margin: 0;
	color: var( --sf-text );
}

/* ------------------------------------------------------------------ */
/* Buttons, inputs, links                                              */
/* ------------------------------------------------------------------ */

.sf-btn {
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	border: 0;
	border-radius: var( --sf-radius );
	padding: 14px 22px;
	min-height: 48px;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
	transition: transform 0.08s ease, opacity 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

a.sf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.sf-btn:active {
	transform: scale( 0.98 );
}

.sf-btn--primary {
	background: var( --sf-primary-fill );
	color: var( --sf-on-primary );
}

.sf-btn--primary:hover {
	box-shadow: 0 6px 20px rgba( var( --sf-primary-rgb ), 0.28 );
}

.sf-btn--ghost {
	background: var( --sf-surface );
	color: var( --sf-primary-ink );
	border: 2px solid var( --sf-line );
}

.sf-btn--ghost:hover {
	border-color: var( --sf-primary );
}

.sf-ext {
	font-size: 13px;
	line-height: 1;
	opacity: 0.75;
}

.sf-btn--whatsapp {
	display: inline-block;
	background: var( --sf-whatsapp );
	color: var( --sf-whatsapp-ink );
	text-decoration: none;
	margin-top: 12px;
}

.sf-btn--block {
	display: block;
	width: 100%;
}

.sf-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	box-shadow: none;
}

.sf-btn--loading {
	position: relative;
	color: transparent !important;
}

.sf-btn--loading::after {
	content: '';
	position: absolute;
	inset: 0;
	margin: auto;
	width: 20px;
	height: 20px;
	border: 3px solid rgba( 0, 0, 0, 0.18 );
	border-top-color: currentColor;
	border-radius: 50%;
	animation: sf-spin 0.7s linear infinite;
}

.sf-btn--primary.sf-btn--loading::after {
	border-color: rgba( 255, 255, 255, 0.35 );
	border-top-color: var( --sf-on-primary );
}

/*
 * Navigation links were 15px text with 2px of padding: around 27px tall,
 * well under the 44px a thumb needs, and several of them sat side by side.
 */
.sf-link {
	background: none;
	border: 0;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	color: var( --sf-primary-ink );
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 8px 10px;
	text-decoration: underline;
	text-underline-offset: 4px;
	border-radius: 8px;
	transition: background-color 0.15s ease;
}

.sf-link:hover {
	background: var( --sf-soft );
}

.sf-link:disabled {
	color: var( --sf-muted );
	text-decoration: none;
	cursor: default;
	background: none;
}

.sf-input {
	width: 100%;
	font-family: inherit;
	font-size: 18px;
	padding: 14px 16px;
	min-height: 52px;
	border: 2px solid var( --sf-line );
	border-radius: var( --sf-radius );
	background: var( --sf-surface );
	color: var( --sf-text );
	margin-bottom: 16px;
	transition: border-color 0.15s ease;
}

.sf-input:focus {
	border-color: var( --sf-primary );
}

.sf-input--email {
	text-align: left;
}

.sf-label {
	display: block;
	font-weight: 700;
	margin-bottom: 8px;
}

/* ------------------------------------------------------------------ */
/* Alerts                                                              */
/* ------------------------------------------------------------------ */

.sf-alert {
	border-radius: var( --sf-radius );
	padding: 12px 16px;
	margin: 12px 0;
	font-size: 15px;
}

.sf-alert--error {
	background: var( --sf-danger-bg );
	color: var( --sf-danger );
}

.sf-alert--success {
	background: var( --sf-success-bg );
	color: var( --sf-success );
}

/* ------------------------------------------------------------------ */
/* Auth screens                                                        */
/* ------------------------------------------------------------------ */

.sf-auth {
	background: var( --sf-surface );
	border: 1px solid var( --sf-line );
	border-radius: calc( var( --sf-radius ) * 1.6 );
	box-shadow: 0 10px 34px rgba( 0, 0, 0, 0.06 );
	padding: 40px 24px;
	margin-top: 8px;
	text-align: center;
}

.sf-auth-title {
	font-family: var( --sf-display, inherit );
	font-size: 30px;
	font-weight: 900;
	margin: 0 0 8px;
	color: var( --sf-text );
	line-height: 1.35;
}

.sf-auth-sub {
	color: var( --sf-muted );
	margin: 0 0 20px;
}

/* On its own line, so an address is not broken mid-word by the sentence. */
.sf-auth-dest {
	display: block;
	margin-top: 4px;
	font-weight: 700;
	color: var( --sf-text );
	unicode-bidi: isolate;
	overflow-wrap: anywhere;
}

.sf-auth-note {
	margin: 14px 0 0;
	font-size: 13px;
	color: var( --sf-muted );
}

.sf-auth-form {
	max-width: 360px;
	margin: 0 auto;
	text-align: right;
}

/* OTP boxes */

.sf-otp-row {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin: 20px 0 24px;
}

.sf-otp-box {
	width: 56px;
	height: 64px;
	font-family: inherit;
	font-size: 28px;
	font-weight: 700;
	text-align: center;
	border: 2px solid var( --sf-line );
	border-radius: var( --sf-radius );
	background: var( --sf-surface );
	color: var( --sf-text );
}

.sf-otp-box:focus {
	border-color: var( --sf-primary );
}

.sf-otp-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 12px;
	margin-top: 12px;
}

.sf-auth .sf-btn--block {
	max-width: 360px;
	margin: 0 auto;
}

/* ------------------------------------------------------------------ */
/* Home                                                                */
/* ------------------------------------------------------------------ */

.sf-home-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 20px;
}

.sf-hello {
	margin: 0;
	color: var( --sf-primary-ink );
	font-weight: 700;
}

.sf-client-name {
	font-family: var( --sf-display, inherit );
	margin: 0;
	font-size: 30px;
	font-weight: 900;
	line-height: 1.3;
}

.sf-client-company {
	margin: 2px 0 0;
	color: var( --sf-muted );
	font-size: 15px;
}

/* Stands in for the tablist when the client has only one kind of document. */
.sf-list-title {
	font-family: var( --sf-display, inherit );
	font-size: 22px;
	font-weight: 900;
	margin: 0 0 14px;
	padding-bottom: 10px;
	border-bottom: 2px solid var( --sf-line );
	color: var( --sf-text );
}

.sf-tabs {
	display: flex;
	gap: 8px;
	margin-bottom: 14px;
	border-bottom: 2px solid var( --sf-line );
}

.sf-tab {
	background: none;
	border: 0;
	font-family: inherit;
	font-size: 17px;
	font-weight: 700;
	color: var( --sf-muted );
	padding: 12px 14px;
	min-height: 48px;
	cursor: pointer;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.sf-tab:hover {
	color: var( --sf-text );
}

.sf-tab[aria-selected="true"] {
	color: var( --sf-text );
	border-bottom-color: var( --sf-primary );
}

.sf-tab-count {
	display: inline-block;
	background: var( --sf-bg );
	color: var( --sf-primary-ink );
	border-radius: 20px;
	font-size: 13px;
	padding: 0 8px;
	margin-inline-start: 4px;
}

/* Filters */

.sf-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-bottom: 16px;
}

.sf-search {
	flex: 1 1 200px;
	min-width: 0;
	margin-bottom: 0;
	font-size: 15px;
	padding: 10px 14px;
	min-height: 44px;
}

.sf-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.sf-chip {
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	border: 1px solid var( --sf-line );
	background: var( --sf-surface );
	color: var( --sf-muted );
	border-radius: 20px;
	padding: 10px 16px;
	min-height: 44px;
	min-width: 44px;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sf-chip:hover {
	border-color: var( --sf-primary );
}

.sf-chip[aria-pressed="true"] {
	/* The fill token, not the raw brand colour: the label colour is derived
	   against the fill, so pairing it with anything else can fail contrast. */
	background: var( --sf-primary-fill );
	border-color: var( --sf-primary-fill );
	color: var( --sf-on-primary );
}

.sf-doc-list {
	display: grid;
	gap: 14px;
}

.sf-card {
	background: var( --sf-surface );
	border: 1px solid var( --sf-line );
	border-radius: var( --sf-radius );
	padding: 18px;
}

.sf-doc-card {
	display: block;
	width: 100%;
	text-align: right;
	font-family: inherit;
	color: inherit;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.sf-doc-card:hover {
	border-color: var( --sf-primary );
	box-shadow: 0 6px 22px rgba( var( --sf-primary-rgb ), 0.12 );
	transform: translateY( -1px );
}

.sf-doc-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	margin-bottom: 6px;
}

.sf-doc-number {
	font-weight: 700;
	color: var( --sf-primary-ink );
}

.sf-doc-title {
	display: block;
	font-size: 19px;
	font-weight: 900;
	color: var( --sf-text );
	margin-bottom: 8px;
}

.sf-doc-meta {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	color: var( --sf-muted );
	font-size: 14px;
}

.sf-doc-amount {
	font-weight: 700;
	color: var( --sf-text );
	white-space: nowrap;
}

/*
 * A quote about to run out used to look exactly like a fresh one: the API
 * sends valid_until and the card ignored it.
 */
.sf-doc-expiry {
	display: block;
	margin-top: 10px;
	font-size: 13px;
	font-weight: 700;
	color: var( --sf-warn );
}

.sf-doc-expiry--gone {
	color: var( --sf-danger );
}

.sf-empty {
	text-align: center;
	color: var( --sf-muted );
	background: var( --sf-surface );
	border: 1px dashed var( --sf-line );
	border-radius: var( --sf-radius );
	padding: 44px 20px;
}

.sf-empty-title {
	display: block;
	font-size: 17px;
	font-weight: 900;
	color: var( --sf-text );
	margin-bottom: 6px;
}

/* Status badges */

.sf-badge {
	display: inline-block;
	font-size: 13px;
	font-weight: 700;
	border-radius: 20px;
	padding: 3px 12px;
	white-space: nowrap;
	background: var( --sf-neutral-bg );
	color: var( --sf-neutral );
}

.sf-badge--sent { background: var( --sf-info-bg ); color: var( --sf-info ); }
.sf-badge--viewed { background: var( --sf-warn-bg ); color: var( --sf-warn ); }
.sf-badge--approved,
.sf-badge--paid { background: var( --sf-success-bg ); color: var( --sf-success ); }
.sf-badge--declined,
.sf-badge--unpaid { background: var( --sf-danger-bg ); color: var( --sf-danger ); }
.sf-badge--partially_paid { background: var( --sf-warn-bg ); color: var( --sf-warn ); }

/* ------------------------------------------------------------------ */
/* Document view                                                       */
/* ------------------------------------------------------------------ */

.sf-doc-head {
	margin-bottom: 10px;
}

.sf-back {
	margin-bottom: 6px;
}

.sf-doc-head-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
}

.sf-doc-kicker {
	margin: 0;
	color: var( --sf-primary-ink );
	font-weight: 700;
}

.sf-doc-big-title {
	font-family: var( --sf-display, inherit );
	margin: 2px 0 6px;
	font-size: 28px;
	font-weight: 900;
	line-height: 1.35;
}

.sf-doc-dates {
	color: var( --sf-muted );
	font-size: 14px;
	margin: 4px 0 0;
}

.sf-doc-dates span + span::before {
	content: '،\00a0';
}

/*
 * A reference inside a sentence, not an action: it keeps the line's size and
 * rhythm instead of becoming a 44px control in the middle of a paragraph.
 */
.sf-doc-dates .sf-link--inline {
	display: inline;
	min-height: 0;
	font-size: inherit;
	font-weight: 700;
	vertical-align: baseline;
	/* Padding widens the tap area; the matching negative margin keeps the
	   sentence sitting exactly where it did. */
	padding: 5px 3px;
	margin: -5px -3px;
}

.sf-doc-dates .sf-ext {
	margin-inline-start: 3px;
}

.sf-section {
	margin-top: 28px;
}

.sf-section-title {
	font-size: 20px;
	font-weight: 900;
	color: var( --sf-primary-ink );
	margin: 0 0 12px;
}

/*
 * Three columns cannot fit a 320px screen, and the table had overflow:hidden
 * with nothing to scroll, so the columns simply crushed each other.
 */
.sf-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-radius: var( --sf-radius );
	border: 1px solid var( --sf-line );
	background: var( --sf-surface );
}

.sf-items-table {
	width: 100%;
	min-width: 320px;
	border-collapse: collapse;
	background: var( --sf-surface );
}

.sf-items-table th {
	text-align: right;
	font-size: 13px;
	color: var( --sf-primary-ink );
	border-bottom: 2px solid var( --sf-primary );
	padding: 12px 14px;
	white-space: nowrap;
}

.sf-items-table td {
	border-bottom: 1px solid var( --sf-line );
	padding: 14px;
	vertical-align: top;
}

.sf-item-desc {
	color: var( --sf-muted );
	font-size: 14px;
	font-weight: 400;
	margin-top: 4px;
	white-space: pre-line;
}

.sf-item-days {
	white-space: nowrap;
	color: var( --sf-muted );
	font-size: 14px;
}

.sf-item-cost {
	white-space: nowrap;
	font-weight: 700;
}

.sf-items-table tfoot td {
	border-bottom: 0;
	font-weight: 900;
	font-size: 17px;
}

.sf-total-cell {
	color: var( --sf-primary-ink );
}

.sf-amount-text {
	background: var( --sf-bg );
	border-radius: var( --sf-radius );
	padding: 12px 16px;
	font-size: 15px;
	margin-top: 12px;
}

.sf-pay-box,
.sf-bank-box {
	background: var( --sf-surface );
	border: 1px solid var( --sf-line );
	border-radius: var( --sf-radius );
	padding: 8px 16px;
}

.sf-pay-row,
.sf-bank-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var( --sf-soft );
}

.sf-pay-row:last-child,
.sf-bank-row:last-child {
	border-bottom: 0;
}

/* The label may wrap over several lines; the amount beside it may not. */
.sf-pay-row strong {
	white-space: nowrap;
}

.sf-bank-value {
	font-weight: 700;
	text-align: left;
	word-break: break-all;
}

.sf-bank-box .sf-btn {
	margin: 10px 0 2px;
}

.sf-bank-more {
	margin: 0 0 4px;
	text-align: center;
	font-size: 14px;
}

.sf-term {
	background: var( --sf-surface );
	border: 1px solid var( --sf-line );
	border-radius: var( --sf-radius );
	margin-bottom: 10px;
	padding: 4px 16px;
}

.sf-term-title {
	font-weight: 700;
	cursor: pointer;
	padding: 12px 0;
	color: var( --sf-text );
	list-style-position: inside;
}

.sf-term-body {
	padding: 0 0 14px;
	color: var( --sf-muted );
	line-height: 1.9;
}

/* The free-form parts of a proposal */

.sf-sec-body {
	margin: 0 0 12px;
	line-height: 1.95;
}

.sf-sec-list {
	margin: 0;
	padding-inline-start: 22px;
}

.sf-sec-list li {
	margin-bottom: 10px;
	line-height: 1.85;
}

.sf-sec-list li::marker {
	color: var( --sf-primary-ink );
	font-weight: 700;
}

.sf-sec-lead {
	display: block;
	font-weight: 900;
	color: var( --sf-text );
}

/* Sending the transfer receipt back */

.sf-receipt-box {
	background: var( --sf-surface );
	border: 1px solid var( --sf-line );
	border-radius: var( --sf-radius );
	padding: 16px;
}

.sf-receipt-hint {
	margin: 0 0 14px;
	font-size: 14px;
	color: var( --sf-muted );
}

.sf-receipt-list {
	list-style: none;
	margin: 0 0 14px;
	padding: 0;
	border-top: 1px solid var( --sf-line );
}

.sf-receipt-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var( --sf-line );
}

.sf-receipt-meta {
	font-size: 14px;
	color: var( --sf-muted );
}

/*
 * The real input stays in the page and keyboard-reachable - hidden by
 * clipping, not by display:none, which would take it out of the tab order.
 * Only its appearance is ours, because the native control prints its own
 * "Choose File" in the browser's language rather than the page's.
 */
.sf-file-native {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: 0;
	overflow: hidden;
	clip: rect( 0 0 0 0 );
	clip-path: inset( 50% );
	white-space: nowrap;
	border: 0;
}

.sf-file-drop {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: 56px;
	padding: 12px 14px;
	margin-bottom: 12px;
	border: 2px dashed var( --sf-line );
	border-radius: var( --sf-radius );
	background: var( --sf-soft );
	cursor: pointer;
	transition: border-color 0.15s ease;
}

.sf-file-drop:hover {
	border-color: var( --sf-primary );
}

/* The ring belongs on what you can see, not on the clipped input. */
.sf-file-native:focus-visible + .sf-file-drop {
	outline: 3px solid var( --sf-primary );
	outline-offset: 2px;
}

.sf-file-cta {
	flex: none;
	font-size: 14px;
	font-weight: 700;
	color: var( --sf-primary-ink );
	background: var( --sf-surface );
	border: 1px solid var( --sf-line );
	border-radius: 10px;
	padding: 8px 14px;
}

.sf-file-name {
	min-width: 0;
	font-size: 14px;
	color: var( --sf-muted );
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sf-receipt-form .sf-input {
	font-size: 15px;
	min-height: 46px;
	padding: 11px 14px;
}

.sf-receipt-limits {
	margin: 10px 0 0;
	font-size: 13px;
	color: var( --sf-muted );
	text-align: center;
}

.sf-receipt-msg:empty {
	display: none;
}

/* PDF preview */

.sf-preview {
	margin-top: 18px;
	border: 1px solid var( --sf-line );
	border-radius: var( --sf-radius );
	overflow: hidden;
	background: var( --sf-soft );
}

.sf-preview iframe {
	display: block;
	width: 100%;
	height: 76vh;
	min-height: 460px;
	border: 0;
}

.sf-doc-actions {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 140px, 1fr ) );
	gap: 10px;
	margin-top: 28px;
}

/* The action that matters, and anything that is prose, take a whole row. */
.sf-doc-actions .sf-btn--primary,
.sf-doc-actions .sf-btn--whatsapp,
.sf-doc-actions .sf-expired-note,
.sf-doc-actions .sf-doc-msg {
	grid-column: 1 / -1;
}

.sf-doc-actions .sf-doc-msg:empty {
	display: none;
}

/*
 * Printing from a phone is not a thing anyone does, and a third button left
 * a lone half-width tile on its own row. Opening the file covers it, and
 * the action returns on a screen where printing makes sense.
 */
.sf-print-btn {
	display: none;
}

.sf-expired-note {
	color: var( --sf-danger );
	font-size: 14px;
}

/* What happens after an approval */

.sf-done {
	background: var( --sf-surface );
	border: 1px solid var( --sf-line );
	border-radius: calc( var( --sf-radius ) * 1.4 );
	box-shadow: 0 10px 34px rgba( 0, 0, 0, 0.06 );
	padding: 32px 24px;
	text-align: center;
	margin-bottom: 26px;
}

.sf-done-mark {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin: 0 auto 14px;
	border-radius: 50%;
	background: var( --sf-success-bg );
	color: var( --sf-success );
	font-size: 28px;
	font-weight: 900;
	line-height: 1;
}

.sf-done-title {
	font-family: var( --sf-display, inherit );
	font-size: 24px;
	font-weight: 900;
	margin: 0 0 8px;
}

.sf-done-text {
	margin: 0 0 18px;
	color: var( --sf-muted );
}

.sf-done-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}

/* Approve modal */

.sf-modal {
	position: fixed;
	inset: 0;
	background: rgba( 20, 20, 20, 0.62 );
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	z-index: 99999;
	animation: sf-fade 0.18s ease;
}

.sf-modal[hidden] {
	display: none;
}

.sf-modal-card {
	background: var( --sf-surface );
	border-radius: calc( var( --sf-radius ) * 1.4 );
	box-shadow: 0 24px 60px rgba( 0, 0, 0, 0.28 );
	padding: 28px 24px;
	max-width: 420px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	animation: sf-rise 0.2s ease;
}

.sf-modal-title {
	margin: 0 0 12px;
	font-size: 20px;
	font-weight: 900;
}

.sf-modal-recap {
	background: var( --sf-bg );
	border-radius: var( --sf-radius );
	padding: 12px 14px;
	margin-bottom: 16px;
	font-size: 15px;
}

.sf-modal-recap strong {
	font-weight: 900;
}

.sf-check {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	cursor: pointer;
	margin-bottom: 16px;
}

.sf-check input {
	width: 22px;
	height: 22px;
	flex: none;
	margin-top: 3px;
	accent-color: var( --sf-primary );
}

.sf-modal-actions {
	display: flex;
	gap: 10px;
}

/* ------------------------------------------------------------------ */
/* Skeletons & spinner                                                 */
/* ------------------------------------------------------------------ */

.sf-portal-boot {
	display: flex;
	justify-content: center;
	padding: 60px 0;
}

.sf-spinner {
	width: 34px;
	height: 34px;
	border: 4px solid var( --sf-line );
	border-top-color: var( --sf-primary );
	border-radius: 50%;
	display: inline-block;
	animation: sf-spin 0.7s linear infinite;
}

@keyframes sf-spin {
	to { transform: rotate( 360deg ); }
}

@keyframes sf-fade {
	from { opacity: 0; }
}

@keyframes sf-rise {
	from { opacity: 0; transform: translateY( 10px ); }
}

.sf-skeleton {
	pointer-events: none;
}

.sf-skel-line {
	height: 14px;
	border-radius: 7px;
	background: linear-gradient( 90deg, var( --sf-line ) 25%, var( --sf-soft ) 50%, var( --sf-line ) 75% );
	background-size: 200% 100%;
	animation: sf-shimmer 1.2s infinite;
	margin: 10px 0;
	width: 60%;
}

.sf-skel-line--wide { width: 90%; }
.sf-skel-line--short { width: 35%; }

@keyframes sf-shimmer {
	to { background-position: -200% 0; }
}

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */

.sf-portal-footer {
	margin-top: 40px;
	padding-top: 20px;
	border-top: 1px solid var( --sf-line );
	color: var( --sf-muted );
	font-size: 13px;
	text-align: center;
	white-space: pre-line;
}

/* ------------------------------------------------------------------ */
/* Larger screens                                                      */
/* ------------------------------------------------------------------ */

@media ( min-width: 640px ) {
	.sf-portal {
		padding: 40px 24px 80px;
	}

	.sf-auth {
		padding: 56px 40px;
	}

	.sf-doc-big-title {
		font-size: 34px;
	}

	.sf-client-name {
		font-size: 36px;
	}

	.sf-brand-logo {
		max-width: 200px;
		max-height: 60px;
	}

	.sf-print-btn {
		display: block;
	}
}

/*
 * A document is a two-column read once there is room: the paperwork on one
 * side, the money and the next step staying in view on the other. Below this
 * the aside simply follows the content, as it always did.
 */
@media ( min-width: 1040px ) {
	.sf-portal {
		max-width: 1080px;
	}

	.sf-doc-body {
		display: grid;
		grid-template-columns: minmax( 0, 1fr ) 330px;
		gap: 32px;
		align-items: start;
	}

	.sf-doc-aside {
		position: sticky;
		top: 24px;
		display: grid;
		gap: 16px;
	}

	.sf-doc-aside .sf-section {
		margin-top: 0;
	}

	.sf-doc-actions {
		margin-top: 0;
		grid-template-columns: 1fr;
	}

	.sf-doc-list {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}

	.sf-preview iframe {
		height: 82vh;
	}
}

/* ------------------------------------------------------------------ */
/* Reduced motion                                                      */
/* ------------------------------------------------------------------ */

@media ( prefers-reduced-motion: reduce ) {
	.sf-portal *,
	.sf-portal *::before,
	.sf-portal *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}

	.sf-spinner,
	.sf-btn--loading::after {
		animation: none !important;
		border-top-color: currentColor;
	}
}

/* ------------------------------------------------------------------ */
/* Print                                                               */
/* ------------------------------------------------------------------ */

@media print {
	.sf-doc-actions,
	.sf-back,
	.sf-modal,
	.sf-portal-footer,
	.sf-preview,
	.sf-filters,
	.sf-print-btn {
		display: none !important;
	}

	.sf-portal {
		max-width: none;
		padding: 0;
	}

	.sf-portal::before {
		display: none;
	}

	.sf-doc-body {
		display: block;
	}

	.sf-card,
	.sf-items-table,
	.sf-table-wrap,
	.sf-pay-box,
	.sf-bank-box,
	.sf-term {
		border-color: var( --sf-line );
	}

	.sf-table-wrap {
		overflow: visible;
	}

	.sf-term {
		break-inside: avoid;
	}

	.sf-term:not([open]) .sf-term-body {
		display: block;
	}
}
