/**
 * Storefront — Testimonial Form widget.
 *
 * Nilai ditranskrip dari `dsgn_testimonialForm.html` versi v2 (bagian
 * CSS di akhir file menimpa v1 — itu yang berlaku, bukan v1). Warna
 * brand dari CSS variable HALAMAN dengan fallback (sama pola dengan
 * widget testimoni lain di plugin ini).
 *
 * Reset pakai `.stfr-tf *` (bukan daftar `.stfr-tf h2, .stfr-tf div,
 * ...`) — pelajaran dari widget lain: selector class+tag spesifisitas
 * lebih tinggi dari selector 1-class komponen, jadi reset-nya bakal
 * menang terlepas urutan di file.
 */

/* Wrapper `.elementor-element`/`.elementor-widget-container` di luar
   `.stfr-tf` dibuat Elementor sendiri (bukan markup plugin ini — grep
   ke seluruh CSS plugin memastikan tidak ada baris manapun yang
   menyentuh class itu). Kalau Popup/Container Elementor memaksa tinggi
   ke wrapper itu dari luar (min-height/flex/apa pun), baris ini
   menimpanya KHUSUS untuk wrapper widget INI SAJA (ditarget lewat
   class tipe-widget otomatis `.elementor-widget-stfr_testimonial_form`,
   bukan class Elementor generik) — supaya tingginya selalu mengikuti
   konten asli, tidak pernah ada sisa ruang kosong di bawah form. */
.elementor-widget-stfr_testimonial_form,
.elementor-widget-stfr_testimonial_form > .elementor-widget-container {
	height: auto !important;
	min-height: 0 !important;
}

.stfr-tf {
	--stfr-tf-p: var( --p, #2D5A4D );
	--stfr-tf-p-d: var( --p-d, #1D3B32 );
	--stfr-tf-p-l: var( --p-l, #3E7A68 );
	--stfr-tf-a: var( --a, #D4B038 );
	--stfr-tf-a-d: var( --a-d, #A9872B );
	--stfr-tf-n9: var( --n9, #1A1F1D );
	--stfr-tf-n7: var( --n7, #4A5550 );
	--stfr-tf-n5: var( --n5, #8A9490 );
	--stfr-tf-n2: var( --n2, #D8DEDB );
	--stfr-tf-n1: var( --n1, #F4F6F5 );
	--stfr-tf-sage: var( --sage, #EAF0EC );
	--stfr-tf-err: #B3402F;
	--stfr-tf-max-w: 680px;

	width: min( var( --stfr-tf-max-w ), 100% );
	margin-inline: auto;
	padding: 0;
	font-family: 'Inter Tight', system-ui, sans-serif;
	font-weight: 400;
	color: var( --stfr-tf-n9 );
	line-height: 1.6;
}

.stfr-tf * {
	box-sizing: border-box;
}

.stfr-tf button,
.stfr-tf input,
.stfr-tf select,
.stfr-tf textarea {
	font: inherit;
	color: inherit;
}

.stfr-tf svg {
	display: block;
}

/* Dua skala jarak dikunci di sini (variable), dipakai konsisten di
   seluruh form: `--stfr-tf-gap-tight` = dalam SATU field (label ->
   input), `--stfr-tf-gap-loose` = ANTAR field (proximity law — harus
   terasa jelas lebih renggang daripada yang di dalam satu field). */
.stfr-tf {
	--stfr-tf-gap-tight: 8px;
	--stfr-tf-gap-loose: 20px;
}

.stfr-tf__form {
	margin-top: 18px;
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: var( --stfr-tf-gap-loose ) 18px;
	align-items: start;
}

/* Responsif terhadap lebar PEMBUNGKUSNYA sendiri (container query), bukan
   cuma lebar viewport — supaya tetap 1 kolom yang benar kalau widget ini
   ditaruh di kolom sempit (sidebar, dsb), bukan hanya saat layar HP. */
.stfr-tf {
	container-type: inline-size;
	container-name: stfr-tf;
}

@container stfr-tf ( max-width: 520px ) {
	.stfr-tf__form {
		grid-template-columns: 1fr;
	}
}

.stfr-tf__field {
	display: grid;
	gap: var( --stfr-tf-gap-tight );
	min-width: 0;
	align-content: start;
}

.stfr-tf__field--wide {
	grid-column: 1 / -1;
}

.stfr-tf__lr {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 2px 10px;
	min-height: 20px;
}

.stfr-tf__lr label,
.stfr-tf__lr .stfr-tf__lbl {
	/* `.stfr-tf` (root) pakai line-height:1.6 buat body text — di baris
	   label yang pendek ini bikin kotaknya lebih tinggi dari teksnya
	   sendiri, menambah jarak visual ke input di bawahnya walau CSS
	   `gap` antar field sudah rapat. Dikunci 1.2 di sini saja. */
	line-height: 1.2;
	font-size: 14px;
	font-weight: 500;
}

.stfr-tf__req {
	color: var( --stfr-tf-err );
	margin-left: 2px;
}

.stfr-tf__opt {
	font-weight: 400;
	color: var( --stfr-tf-n5 );
	font-size: 13px;
	margin-left: 4px;
}

.stfr-tf__pv,
.stfr-tf__rt,
.stfr-tf__hint {
	font-size: 13px;
	white-space: nowrap;
}

/* Hint di field Produk BISA berisi kalimat panjang (mis. "Semua produk
   yang kamu beli sudah diulas.") — beda dari counter "0/600" di field
   Ulasanmu yang SELALU pendek dan harus tetap sejajar di kanan label
   (inline, lihat rule di atas). Cuma hint field Produk yang perlu turun
   ke baris sendiri di bawah label — kalau `.stfr-tf__hint` digeneralisir
   turun baris semua, counter "0/600" ikut rusak. `margin-top` dikunci
   kecil (0) karena `.stfr-tf__lr` sudah punya row-gap sendiri (lihat
   di atas) yang menjadi jarak label->hint — tidak perlu dobel. */
.stfr-tf__field[data-field="product"] .stfr-tf__hint {
	flex-basis: 100%;
	white-space: normal;
}

.stfr-tf__pv,
.stfr-tf__hint {
	color: var( --stfr-tf-n5 );
}

.stfr-tf__rt {
	color: var( --stfr-tf-a-d );
	font-weight: 500;
	min-width: 0;
}

.stfr-tf__hint:empty {
	display: none;
}

.stfr-tf__input {
	width: 100%;
	border: 1px solid var( --stfr-tf-n2 ) !important;
	border-radius: 12px !important;
	background: #fff !important;
	padding: 10px 14px !important;
	font-size: 16px;
	transition: border-color .2s, box-shadow .2s;
	appearance: none;
	-webkit-appearance: none;
}

.stfr-tf__input::placeholder {
	color: var( --stfr-tf-n5 );
}

.stfr-tf__input:hover {
	border-color: #b9c4bf !important;
}

.stfr-tf__input:focus {
	outline: 0 !important;
	box-shadow: none !important;
	border-color: var( --stfr-tf-p ) !important;
}

.stfr-tf__input:disabled {
	background: var( --stfr-tf-n1 ) !important;
	color: var( --stfr-tf-n5 ) !important;
	cursor: not-allowed;
}

textarea.stfr-tf__input {
	min-height: 84px;
	line-height: 1.5;
	resize: vertical;
}

.stfr-tf__sel {
	position: relative;
}

.stfr-tf__sel::after {
	content: '';
	position: absolute;
	right: 18px;
	top: 50%;
	width: 8px;
	height: 8px;
	border-right: 2px solid var( --stfr-tf-n7 );
	border-bottom: 2px solid var( --stfr-tf-n7 );
	transform: translateY( -70% ) rotate( 45deg );
	pointer-events: none;
}

.stfr-tf__sel select {
	padding-right: 44px !important;
	cursor: pointer;
}

.stfr-tf__sel select:disabled {
	cursor: not-allowed;
}

.stfr-tf__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---- Chip bintang ---- */

.stfr-tf__stars {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: nowrap;
}

.stfr-tf__star {
	position: relative;
	width: 40px;
	height: 40px;
	border: 1px solid var( --stfr-tf-n2 ) !important;
	border-radius: 12px !important;
	background: #fff !important;
	cursor: pointer;
	display: grid;
	place-items: center;
	color: var( --stfr-tf-n2 );
	transition: color .18s, background .18s, border-color .18s, transform .18s;
}

.stfr-tf__star svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
	transition: transform .18s;
}

.stfr-tf__star input {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
	margin: 0 !important;
}

.stfr-tf__star:hover svg {
	transform: scale( 1.12 );
}

.stfr-tf__star.is-lit {
	color: var( --stfr-tf-a ) !important;
	border-color: rgba( 212, 176, 56, .55 ) !important;
	background: #FFFBEA !important;
}

.stfr-tf__star:has( input:focus-visible ) {
	outline: 2px solid var( --stfr-tf-p );
	outline-offset: 2px;
}

.stfr-tf__star.is-pop svg {
	animation: stfr-tf-pop .3s;
}

@keyframes stfr-tf-pop {
	50% {
		transform: scale( 1.28 );
	}
}

/* ---- Error ---- */

.stfr-tf__err {
	display: none;
	font-size: 12.5px;
	color: var( --stfr-tf-err );
}

.stfr-tf__field.is-bad .stfr-tf__err {
	display: block;
}

.stfr-tf__field.is-bad .stfr-tf__input {
	border-color: var( --stfr-tf-err ) !important;
}

.stfr-tf__field.is-bad .stfr-tf__star {
	border-color: rgba( 179, 64, 47, .5 ) !important;
}

/* ---- Notice ---- */

.stfr-tf__notice {
	margin-top: 14px;
	display: flex;
	gap: 12px;
	align-items: flex-start;
	border-radius: 14px;
	padding: 10px 14px;
	font-size: 13.5px;
	line-height: 1.5;
}

.stfr-tf__notice svg {
	flex: none;
	width: 20px;
	height: 20px;
	margin-top: 1px;
}

.stfr-tf__notice--info {
	background: var( --stfr-tf-sage );
	color: var( --stfr-tf-p-d );
}

.stfr-tf__notice--warn {
	background: #FBF3D4;
	color: #6f5817;
}

.stfr-tf__notice a {
	color: inherit;
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---- Tombol & footer ---- */

/* Dua class (`.stfr-tf .stfr-tf__btn`) — BUKAN `!important` — pola sama
   dengan tombol "Muat lebih banyak" Testimonial Grid: cukup spesifik untuk
   menang dari reset tema/kit Elementor umum (`.elementor-kit-xx button`),
   tapi tetap kalah dari selector kontrol Style tombol ini sendiri
   (`{{WRAPPER}} .stfr-tf__btn:not(.stfr-tf__btn--ghost)`). */
.stfr-tf .stfr-tf__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	border: 0;
	background: var( --stfr-tf-p );
	color: #fff;
	padding: 12px 26px;
	border-radius: 99px;
	font-weight: 500;
	cursor: pointer;
	transition: .2s;
	justify-self: start;
}

.stfr-tf .stfr-tf__btn:hover:not( :disabled ) {
	background: var( --stfr-tf-p-d );
}

.stfr-tf .stfr-tf__btn:disabled {
	background: var( --stfr-tf-n2 );
	color: var( --stfr-tf-n5 );
	cursor: not-allowed;
}

.stfr-tf .stfr-tf__btn--ghost {
	background: transparent;
	color: var( --stfr-tf-p );
	border: 1px solid var( --stfr-tf-p );
}

.stfr-tf .stfr-tf__btn--ghost:hover {
	background: var( --stfr-tf-p );
	color: #fff;
}

.stfr-tf__foot {
	grid-column: 1 / -1;
	display: flex;
	gap: 16px;
	align-items: center;
	flex-wrap: wrap;
	margin-top: 2px;
}

.stfr-tf__foot small {
	color: var( --stfr-tf-n5 );
	font-size: 13px;
}

.stfr-tf__spin {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2px solid rgba( 255, 255, 255, .4 );
	border-top-color: #fff;
	animation: stfr-tf-spin .7s linear infinite;
}

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

/* ---- Layar sukses ---- */

.stfr-tf__ok {
	text-align: center;
	padding: 12px 0;
}

.stfr-tf__ok-icon {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var( --stfr-tf-sage );
	color: var( --stfr-tf-p );
	display: grid;
	place-items: center;
	margin: 0 auto 18px;
}

.stfr-tf__ok-icon svg {
	width: 30px;
	height: 30px;
}

.stfr-tf__ok h2 {
	margin-bottom: 8px;
	font-family: 'Gilda Display', serif;
	font-weight: 400;
	font-size: 26px;
	color: var( --stfr-tf-p-d );
}

.stfr-tf__ok p {
	color: var( --stfr-tf-n7 );
	max-width: 44ch;
	margin: 0 auto 22px;
}

.stfr-tf__ok:focus-visible {
	outline: none;
}

[hidden] {
	display: none !important;
}

@media ( prefers-reduced-motion: reduce ) {
	.stfr-tf *,
	.stfr-tf *::before,
	.stfr-tf *::after {
		animation: none !important;
		transition: none !important;
	}
}

@media ( max-width: 560px ) {
	.stfr-tf {
		padding: 16px 16px 14px;
	}

	.stfr-tf__form {
		grid-template-columns: 1fr;
		gap: var( --stfr-tf-gap-loose ) 18px;
		margin-top: 12px;
	}

	.stfr-tf__star {
		width: 44px;
		height: 44px;
	}

	.stfr-tf__stars {
		justify-content: space-between;
		flex-wrap: wrap;
	}

	.stfr-tf__field[data-field="rating"] .stfr-tf__rt {
		flex-basis: 100%;
		margin: 2px 0 0;
	}
}
