/**
 * The review form (board SevaReviewForm 01–05): in the dialog (ms-dialog, components.css) or as the
 * page section #write-review. The five labelled stars, the fields, the error summary and field errors,
 * the thank-you. Tokens only.
 */
.ms-rf {
	color: var(--text-body);
}

/* #write-review sits in the product page's #reviews, under its section bar, which is stuck when a jump
   lands (the review ask's link, a submit's return): it clears the bar as the page's sections do
   (product.css, .ms-product__sections > [id]). The header is :root's scroll-padding-top (header.css);
   a margin that counted the header again put the form 90px under the bar at 1470px (10 Nov 2026). */
.ms-rf--page {
	max-width: 560px;
	margin-top: var(--space-32);
	padding: var(--space-20);
	border: 1px solid var(--border-subtle);
	border-radius: var(--radius-xl);
	background-color: var(--surface-raised);
	scroll-margin-top: calc(var(--target-min) + var(--space-24));
}

.ms-rf--page:focus:not(:focus-visible) {
	outline: none;
}

@media (min-width: 768px) {
	.ms-rf--page {
		padding: var(--space-24);
	}
}

.ms-rf__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--space-12);
}

.ms-rf__title {
	margin: 0;
	font-family: var(--type-h4-family);
	font-size: var(--type-h4-size);
	font-weight: var(--type-h4-weight);
	line-height: var(--type-h4-lh);
	color: var(--text-primary);
}

.ms-rf__for {
	margin: var(--space-4) 0 0;
	font-size: var(--type-caption-size);
	line-height: var(--type-caption-lh);
	color: var(--text-secondary);
}

.ms-rf__x {
	flex: none;
}

/* ---------- Error summary (the tithi form's pattern) ---------- */
.ms-rf__errors {
	margin-top: var(--space-16);
}

.ms-rf__errors .ms-notice__title,
.ms-rf__errors .ms-notice__body {
	margin: 0;
}

.ms-rf__errors .ms-notice__body {
	padding-left: 1.1em;
}

.ms-rf__errors .ms-notice__body a {
	display: inline-block;
	padding-block: 12px;
	margin-block: -12px;
	color: inherit;
}

/* ---------- The form ---------- */
.ms-rf__form {
	display: flex;
	flex-direction: column;
	gap: var(--space-16);
	margin-top: var(--space-16);
}

.ms-rf__label {
	display: block;
	margin: 0 0 var(--space-6);
	padding: 0;
	font-size: var(--type-label-size);
	font-weight: var(--type-label-weight);
	line-height: var(--type-label-lh);
	color: var(--text-primary);
}

.ms-rf__field {
	display: flex;
	flex-direction: column;
	gap: var(--space-6);
	min-width: 0;
}

.ms-rf__field .ms-rf__label {
	margin: 0;
}

.ms-rf__textarea {
	min-height: 120px;
	height: auto;
	padding-block: var(--space-12);
	line-height: var(--type-body-sm-lh);
	resize: vertical;
}

.ms-rf .ms-input[aria-invalid="true"] {
	border-color: var(--status-danger-border);
	box-shadow: 0 0 0 1px var(--status-danger-border);
}

.ms-rf__help,
.ms-rf__privacy {
	margin: 0;
	font-size: var(--type-caption-size);
	line-height: var(--type-caption-lh);
	color: var(--text-secondary);
}

/* The error line's type, colour and icon are the shared field family's (components.css). */
.ms-rf__error {
	margin: var(--space-8) 0 0;
}

.ms-rf__field .ms-rf__error {
	margin: 0;
}

/* ---------- The rating: five labelled stars, filled up to the chosen one ---------- */
.ms-rf__rating {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.ms-rf__stars {
	position: relative;
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: var(--space-4);
}

.ms-rf__star-input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.ms-rf__star {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-2);
	min-height: 56px;
	padding: var(--space-6) var(--space-4);
	border-radius: var(--radius-md);
	cursor: pointer;
	text-align: center;
	transition: background-color var(--duration-sm) var(--easing-out);
}

.ms-rf__star-glyph {
	font-size: var(--icon-md);
	line-height: 1;
	color: var(--border-control);
	transition: color var(--duration-sm) var(--easing-out);
}

.ms-rf__star-text {
	font-size: var(--type-caption-size);
	line-height: var(--type-caption-lh);
	color: var(--text-body);
}

.ms-rf__star:has(~ .ms-rf__star-input:checked) .ms-rf__star-glyph,
.ms-rf__star-input:checked + .ms-rf__star .ms-rf__star-glyph {
	color: var(--text-accent);
}

.ms-rf__star-input:checked + .ms-rf__star {
	background-color: var(--surface-soft);
}

.ms-rf__star-input:checked + .ms-rf__star .ms-rf__star-text {
	font-weight: 600;
	color: var(--text-primary);
}

.ms-rf__star-input:focus-visible + .ms-rf__star {
	outline: var(--focus-width) solid var(--focus-ring);
	outline-offset: 2px;
}

@media (hover: hover) {
	.ms-rf__stars:hover .ms-rf__star .ms-rf__star-glyph {
		color: var(--border-control);
	}

	.ms-rf__stars .ms-rf__star:hover .ms-rf__star-glyph,
	.ms-rf__stars .ms-rf__star:has(~ .ms-rf__star:hover) .ms-rf__star-glyph {
		color: var(--text-accent);
	}
}

/* ---------- Actions ---------- */
.ms-rf__actions {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-8);
	margin-top: var(--space-4);
	padding-top: var(--space-16);
	border-top: 1px solid var(--border-subtle);
}

.ms-rf__actions--row {
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: flex-start;
	margin-top: var(--space-16);
	padding-top: 0;
	border-top: 0;
}

/* In the dialog on phones the primary goes last, nearest the thumb (the overlay family's phone foot, board
   15 [15]): Cancel above Submit review. */
@media (max-width: 767px) {
	.ms-rf--dialog .ms-rf__actions:not(.ms-rf__actions--row) > .ms-btn--primary {
		order: 2;
	}

	.ms-rf--dialog .ms-rf__actions:not(.ms-rf__actions--row) > :not(.ms-btn--primary) {
		order: 1;
	}
}

button.ms-rf__cancel,
.ms-rf__cancel {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 var(--space-12);
	border: 0;
	background: none;
	font: inherit;
	cursor: pointer;
}

.ms-rf__text {
	margin: var(--space-12) 0 0;
}

.ms-rf__aside {
	margin: 0;
	font-size: var(--type-body-sm-size);
	line-height: var(--type-body-sm-lh);
}

.ms-rf__aside .ms-link {
	display: inline-block;
	padding-block: 12px;
	margin-block: -12px;
}

.ms-rf__google {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-8);
	margin-top: var(--space-16);
	padding: var(--space-16);
	border-radius: var(--radius-lg);
	background-color: var(--surface-soft);
}

.ms-rf__google-title {
	margin: 0;
	font-weight: 600;
	color: var(--text-primary);
}

.ms-rf__google .ms-rf__text {
	margin: 0;
}

/* ---------- "Write a review" under the reviews ---------- */
/* "Write a review" on its own closing row with its line (D-118(5), ledger 4a); side by side from 768. */
.ms-rf-entry {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-12);
	margin: var(--space-32) 0 0;
	padding-top: var(--space-24);
	border-top: 1px solid var(--border-subtle);
}

.ms-rf-entry__line {
	margin: 0;
	font-size: var(--type-body-sm-size);
	line-height: var(--type-body-sm-lh);
	color: var(--text-body);
}

@media (min-width: 768px) {
	.ms-rf-entry {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
}
