/* Refundly customer portal. Tokens follow the "Refundly Charcoal & Cream" design direction. */

.rf {
	--rf-bg: #F8F5ED;
	--rf-surface: #FFFFFF;
	--rf-ink: #292B2F;
	--rf-muted: #73767A;
	--rf-line: #D8D6D0;
	--rf-subtle: #EFEBE1;
	--rf-success: #3E6A4F;
	--rf-success-bg: #E4EDE5;
	--rf-warning: #8A6420;
	--rf-warning-bg: #F4EAD4;
	--rf-danger: #9B3B32;
	--rf-danger-bg: #F5E1DD;
	--rf-info: #4F5963;
	--rf-info-bg: #E6E8EA;
	--rf-radius-input: 14px;
	--rf-radius-card: 20px;
	--rf-font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	box-sizing: border-box;
	max-width: 760px;
	margin: 0 auto;
	padding: 40px 0 64px;
	color: var(--rf-ink);
	font-family: var(--rf-font);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}
.rf *, .rf *::before, .rf *::after { box-sizing: inherit; }
.rf a { color: var(--rf-ink); text-underline-offset: 3px; }
.rf-num, .rf-title--id { font-variant-numeric: tabular-nums; }
.rf-muted { color: var(--rf-muted); font-size: 14px; }

/* Header */
.rf-head { margin: 0 0 28px; }
.rf-head--row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.rf-head__status { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.rf-title {
	margin: 0 0 10px;
	font-family: var(--rf-font);
	font-size: clamp(30px, 5vw, 44px);
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -0.025em;
	color: var(--rf-ink);
}
.rf-title--id { margin: 0; }
.rf-kicker { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--rf-muted); }
.rf-lead { margin: 0; max-width: 60ch; font-size: 18px; color: var(--rf-muted); }

/* Cards */
.rf-card {
	background: var(--rf-surface);
	border: 1px solid var(--rf-line);
	border-radius: var(--rf-radius-card);
	padding: 32px;
	margin: 0 0 20px;
}
.rf-card__title { margin: 0 0 16px; font-size: 20px; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; color: var(--rf-ink); }

/* Progress */
.rf-progress { display: flex; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.rf-progress__item {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 0 0;
	border-top: 3px solid var(--rf-line);
	color: var(--rf-muted);
	font-size: 14px;
	font-weight: 600;
}
.rf-progress__item.is-active, .rf-progress__item.is-done { border-top-color: var(--rf-ink); color: var(--rf-ink); }
.rf-progress__dot {
	display: inline-grid; place-items: center;
	width: 26px; height: 26px; flex: none;
	border-radius: 999px;
	border: 1.5px solid currentColor;
	font-size: 13px; font-weight: 700;
}
.rf-progress__item.is-active .rf-progress__dot, .rf-progress__item.is-done .rf-progress__dot { background: var(--rf-ink); border-color: var(--rf-ink); color: var(--rf-bg); }
.rf:not(.rf-js) .rf-progress { display: none; }

/* Steps */
.rf-step + .rf-step { margin-top: 36px; padding-top: 36px; border-top: 1px solid var(--rf-line); }
.rf-js .rf-step { display: none; margin: 0; padding: 0; border: 0; }
.rf-js .rf-step.is-active { display: block; animation: rf-in .2s ease-out; }
@keyframes rf-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rf-js .rf-step.is-active { animation: none; } }
.rf-step__title { margin: 0 0 6px; font-size: 22px; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; color: var(--rf-ink); }
.rf-step__hint { margin: 0 0 24px; color: var(--rf-muted); }
.rf-optional { margin-left: 6px; padding: 2px 10px; border-radius: 999px; background: var(--rf-subtle); font-size: 12px; font-weight: 600; color: var(--rf-muted); vertical-align: middle; }

/* Fields */
.rf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.rf-field { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.rf-field label, .rf-field legend { display: block; margin: 0 0 8px; padding: 0; font-size: 15px; font-weight: 700; color: var(--rf-ink); }
.rf-field__hint { margin: 6px 0 0; font-size: 14px; color: var(--rf-muted); }
.rf-field legend + .rf-field__hint { margin: -4px 0 12px; }
.rf input[type="text"], .rf input[type="email"], .rf input[type="date"], .rf input[type="number"], .rf select, .rf textarea {
	display: block;
	width: 100%;
	min-height: 50px;
	margin: 0;
	padding: 12px 16px;
	background: var(--rf-surface);
	border: 1px solid var(--rf-line);
	border-radius: var(--rf-radius-input);
	box-shadow: none;
	color: var(--rf-ink);
	font: inherit;
	font-size: 16px;
	line-height: 1.4;
	transition: border-color .15s, box-shadow .15s;
}
.rf textarea { min-height: 130px; resize: vertical; }
.rf input::placeholder, .rf textarea::placeholder { color: #8C8F93; }
.rf input:focus, .rf select:focus, .rf textarea:focus { outline: none; border-color: var(--rf-ink); box-shadow: 0 0 0 3px rgba(41, 43, 47, .14); }
.rf .is-invalid input, .rf .is-invalid select, .rf .is-invalid textarea, .rf input.is-invalid { border-color: var(--rf-danger); }
.rf-error { margin: 6px 0 0; font-size: 14px; font-weight: 600; color: var(--rf-danger); }
.rf-error:empty { display: none; }

.rf-money { position: relative; }
.rf-money__symbol { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--rf-muted); font-weight: 600; pointer-events: none; }
.rf .rf-money input { padding-left: 34px; font-variant-numeric: tabular-nums; }
.rf .rf-money input[readonly] { background: var(--rf-bg); }

/* Radio cards */
.rf-choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rf-choice { position: relative; display: block; cursor: pointer; margin: 0 !important; }
.rf-choice input { position: absolute; opacity: 0; pointer-events: none; }
.rf-choice__body {
	display: flex; flex-direction: column; gap: 2px;
	height: 100%;
	padding: 14px 16px 14px 46px;
	border: 1px solid var(--rf-line);
	border-radius: var(--rf-radius-input);
	background: var(--rf-surface);
	font-weight: 400;
	transition: border-color .15s, background .15s;
}
.rf-choice__body::before {
	content: ""; position: absolute; left: 16px; top: 17px;
	width: 18px; height: 18px; border-radius: 999px;
	border: 1.5px solid var(--rf-muted); background: var(--rf-surface);
}
.rf-choice__body strong { font-size: 15px; color: var(--rf-ink); }
.rf-choice__body span { font-size: 14px; color: var(--rf-muted); }
.rf-choice input:checked + .rf-choice__body { border-color: var(--rf-ink); background: var(--rf-bg); }
.rf-choice input:checked + .rf-choice__body::before { border: 5px solid var(--rf-ink); }
.rf-choice input:focus-visible + .rf-choice__body { box-shadow: 0 0 0 3px rgba(41, 43, 47, .18); }

/* Order summary + items */
.rf-order-summary {
	display: flex; flex-wrap: wrap; gap: 8px 24px;
	margin: 0 0 20px; padding: 16px 18px;
	border-radius: var(--rf-radius-input);
	background: var(--rf-success-bg);
	color: var(--rf-success);
	font-size: 14px;
}
.rf-order-summary strong { color: var(--rf-ink); }
.rf-items { display: grid; gap: 8px; }
.rf-item {
	display: flex !important; align-items: center; gap: 12px;
	margin: 0 !important; padding: 12px 16px;
	border: 1px solid var(--rf-line); border-radius: var(--rf-radius-input);
	font-weight: 500 !important; cursor: pointer;
}
.rf-item:has(input:checked) { border-color: var(--rf-ink); background: var(--rf-bg); }
.rf-item input { width: 18px; height: 18px; accent-color: var(--rf-ink); flex: none; }
.rf-item__name { flex: 1; }
.rf-item__meta { color: var(--rf-muted); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rf-note { margin: 0 0 16px; padding: 14px 16px; border-radius: var(--rf-radius-input); background: var(--rf-subtle); font-size: 14px; color: var(--rf-ink); }

/* Upload */
.rf-drop {
	position: relative;
	display: flex; flex-direction: column; align-items: center; gap: 4px;
	padding: 36px 20px;
	border: 1.5px dashed var(--rf-line);
	border-radius: var(--rf-radius-card);
	background: var(--rf-bg);
	text-align: center; cursor: pointer;
	transition: border-color .15s, background .15s;
}
.rf-drop:hover, .rf-drop.is-over { border-color: var(--rf-ink); }
.rf-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.rf:not(.rf-js) .rf-drop input[type="file"] { position: static; opacity: 1; margin-top: 12px; }
.rf-drop__icon { color: var(--rf-ink); margin-bottom: 6px; }
.rf-drop__title { font-weight: 700; }
.rf-drop__meta { font-size: 14px; color: var(--rf-muted); }
.rf-filelist { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.rf-filelist li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--rf-line); border-radius: var(--rf-radius-input); font-size: 14px; }
.rf-filelist__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rf-filelist__size { color: var(--rf-muted); }
.rf-filelist button { padding: 4px 10px; border: 0; border-radius: 999px; background: var(--rf-subtle); color: var(--rf-ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }

/* Review */
.rf-review { display: grid; grid-template-columns: minmax(140px, 1fr) 2fr; margin: 0 0 24px; border-top: 1px solid var(--rf-line); }
.rf-review dt, .rf-review dd { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--rf-line); }
.rf-review dt { color: var(--rf-muted); font-size: 14px; }
.rf-review dd { font-weight: 600; overflow-wrap: anywhere; white-space: pre-line; }

.rf-check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.rf-check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--rf-ink); }

/* Buttons + actions */
.rf-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; }
.rf-actions--center { justify-content: center; flex-wrap: wrap; }
.rf-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 50px; padding: 12px 28px;
	border: 1.5px solid var(--rf-ink); border-radius: 999px;
	font: inherit; font-size: 16px; font-weight: 700; line-height: 1.2;
	text-decoration: none !important; white-space: nowrap; cursor: pointer;
	transition: transform .1s, background .15s, color .15s;
}
.rf-btn:active { transform: translateY(1px); }
.rf-btn:focus-visible { outline: 3px solid rgba(41, 43, 47, .3); outline-offset: 2px; }
.rf-btn--primary { background: var(--rf-ink); color: var(--rf-bg) !important; }
.rf-btn--primary:hover { background: #1D1F22; }
.rf-btn--ghost { background: transparent; color: var(--rf-ink) !important; }
.rf-btn--ghost:hover { background: var(--rf-subtle); }
.rf-btn[disabled], .rf-btn.is-loading { opacity: .6; cursor: progress; }
.rf:not(.rf-js) .rf-js-only { display: none !important; }

/* Alerts */
.rf-alert { margin: 0 0 20px; padding: 14px 18px; border-radius: var(--rf-radius-input); font-size: 15px; font-weight: 600; }
.rf-alert--danger { background: var(--rf-danger-bg); color: var(--rf-danger); }
.rf-alert--success { background: var(--rf-success-bg); color: var(--rf-success); }
.rf-alert[hidden] { display: none; }

/* Badges */
.rf-badge { display: inline-flex; align-items: center; padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.rf-badge--neutral { background: var(--rf-subtle); color: var(--rf-ink); }
.rf-badge--info { background: var(--rf-info-bg); color: var(--rf-info); }
.rf-badge--warning { background: var(--rf-warning-bg); color: var(--rf-warning); }
.rf-badge--success { background: var(--rf-success-bg); color: var(--rf-success); }
.rf-badge--danger { background: var(--rf-danger-bg); color: var(--rf-danger); }

/* Timeline */
.rf-timeline { display: flex; margin: 0; padding: 0; list-style: none; }
.rf-timeline__step { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 0 4px; }
.rf-timeline__step::before {
	content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 2px;
	background: var(--rf-line);
}
.rf-timeline__step:first-child::before { display: none; }
.rf-timeline__step.is-done::before, .rf-timeline__step.is-current::before, .rf-timeline__step.is-stopped::before { background: var(--rf-ink); }
.rf-timeline__dot {
	position: relative; z-index: 1;
	display: grid; place-items: center;
	width: 32px; height: 32px; border-radius: 999px;
	border: 2px solid var(--rf-line); background: var(--rf-surface); color: var(--rf-bg);
}
.rf-timeline__step.is-done .rf-timeline__dot { background: var(--rf-ink); border-color: var(--rf-ink); }
.rf-timeline__step.is-current .rf-timeline__dot { border-color: var(--rf-ink); box-shadow: 0 0 0 5px rgba(41, 43, 47, .12); }
.rf-timeline__step.is-current .rf-timeline__dot::after { content: ""; width: 12px; height: 12px; border-radius: 999px; background: var(--rf-ink); }
.rf-timeline__step.is-stopped .rf-timeline__dot { background: var(--rf-danger); border-color: var(--rf-danger); }
.rf-timeline__label { font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--rf-muted); }
.rf-timeline__step.is-done .rf-timeline__label, .rf-timeline__step.is-current .rf-timeline__label { color: var(--rf-ink); }
.rf-timeline__step.is-stopped .rf-timeline__label { color: var(--rf-danger); }
.rf-timeline__time { font-size: 13px; color: var(--rf-muted); min-height: 1.3em; }

/* Callouts + messages */
.rf-callout--warning { border-color: #E2CFA6; background: #FFFCF4; }
.rf-message { margin: 0 0 20px; padding: 16px 18px; border: 0; border-radius: var(--rf-radius-input); background: var(--rf-bg); font-size: 16px; font-style: normal; color: var(--rf-ink); }
.rf-callout .rf-form .rf-actions { margin-top: 8px; }

/* Details */
.rf-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 32px; margin: 0; }
.rf-details > div { padding: 12px 0; border-bottom: 1px solid var(--rf-line); }
.rf-details__wide { grid-column: 1 / -1; }
.rf-details dt { font-size: 13px; color: var(--rf-muted); }
.rf-details dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }

/* Activity */
.rf-activity { margin: 0; padding: 0; list-style: none; }
.rf-activity__item { position: relative; padding: 0 0 18px 24px; }
.rf-activity__item::before { content: ""; position: absolute; left: 4px; top: 8px; width: 8px; height: 8px; border-radius: 999px; background: var(--rf-ink); }
.rf-activity__item::after { content: ""; position: absolute; left: 7px; top: 20px; bottom: 0; width: 2px; background: var(--rf-line); }
.rf-activity__item:last-child::after { display: none; }
.rf-activity__item time { font-size: 13px; color: var(--rf-muted); }
.rf-activity__item p { margin: 2px 0 0; white-space: normal; }

/* Confirmation */
.rf-confirm__card { padding: 48px 32px; text-align: center; }
.rf-confirm__icon { display: inline-grid; place-items: center; width: 64px; height: 64px; margin: 0 0 20px; border-radius: 999px; background: var(--rf-ink); color: var(--rf-bg); }
.rf-confirm .rf-lead { margin: 0 auto; }
.rf-confirm__id { display: inline-flex; flex-direction: column; gap: 2px; margin: 28px 0 20px; padding: 18px 36px; border: 1px dashed var(--rf-muted); border-radius: var(--rf-radius-input); background: var(--rf-bg); }
.rf-confirm__id-label { font-size: 13px; font-weight: 600; color: var(--rf-muted); }
.rf-confirm__id-value { font-size: 34px; font-weight: 800; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.rf-confirm__text { max-width: 48ch; margin: 0 auto; color: var(--rf-muted); }

.rf-footnote { margin: 8px 0 0; text-align: center; font-size: 14px; color: var(--rf-muted); }
.rf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Mobile */
@media (max-width: 720px) {
	.rf-timeline { flex-direction: column; gap: 0; }
	.rf-timeline__step { flex-direction: row; align-items: center; gap: 14px; padding: 0 0 22px; text-align: left; }
	.rf-timeline__step::before { top: auto; bottom: 100%; right: auto; left: 15px; width: 2px; height: 22px; }
	.rf-timeline__label { flex: 1; }
}
@media (max-width: 640px) {
	.rf { padding: 24px 0 48px; }
	.rf-card { padding: 22px 18px; border-radius: 16px; }
	.rf-grid, .rf-choice-row, .rf-details { grid-template-columns: 1fr; }
	.rf-progress__label { display: none; }
	.rf-progress__item { justify-content: center; }
	.rf-review { grid-template-columns: 1fr; }
	.rf-review dt { padding-bottom: 0; border-bottom: 0; }
	.rf-review dd { padding-top: 2px; }
	.rf-actions { flex-direction: column-reverse; align-items: stretch; }
	.rf-actions > span:empty { display: none; }
	.rf-btn { width: 100%; }
	.rf-head__status { align-items: flex-start; }
	.rf-confirm__card { padding: 36px 20px; }
	.rf-confirm__id { padding: 16px 24px; }
	.rf-confirm__id-value { font-size: 28px; }
}
