/* Crownstone hinnapäringu vorm – tumedal taustal loetav (valge tekst, tumedad elemendid) */

.crownstone-quote-form-wrapper {
	position: relative;
}

.crownstone-quote-form {
	max-width: 960px;
	margin: 0 auto 3em;
	font-family: inherit;
	font-size: inherit;
	line-height: 1.6;
	color: #e8e8e8;
	background: #1a1a1a;
	padding: 2rem;
	border-radius: 8px;
	box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.crownstone-quote-form h1 {
	font-family: inherit;
	font-size: clamp(1.5rem, 4vw, 2rem);
	font-weight: 500;
	margin: 0 0 1.75rem;
	color: #fff;
	letter-spacing: -0.02em;
}

.crownstone-quote-form h2 {
	font-family: inherit;
	font-size: 1.05rem;
	font-weight: 600;
	margin: 2.25rem 0 1rem;
	padding-bottom: 0.6rem;
	border-bottom: 2px solid #c9a962;
	color: #fff;
	letter-spacing: 0.02em;
}

.crownstone-quote-form .form-section {
	margin-bottom: 1.5rem;
}

.crownstone-quote-form .form-row {
	margin-bottom: 1rem;
}

.crownstone-quote-form .taustakivi-plaat-fields,
.crownstone-quote-form .tasapind-detail-fields {
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;
}
.crownstone-quote-form .taustakivi-plaat-fields > label,
.crownstone-quote-form .tasapind-detail-fields > label { flex: 0 0 auto; }
.crownstone-quote-form .taustakivi-plaat-fields > input,
.crownstone-quote-form .tasapind-detail-fields > input { flex: 1 1 100px; max-width: 120px; }

.crownstone-quote-form label {
	display: block;
	margin-bottom: 0.4em;
	font-weight: 500;
	color: #e0e0e0;
}

/* Kivi tüübi tabid */
.crownstone-quote-form .kivi-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1rem;
	position: relative;
}

.crownstone-quote-form .kivi-tab {
	position: relative;
	display: inline-block;
	padding: 0.6rem 1.2rem;
	background: #2c2c2c;
	border: 2px solid #404040;
	border-radius: 4px;
	cursor: pointer;
	font-weight: 500;
	color: #c0c0c0;
	transition: all 0.2s;
	touch-action: manipulation;
}

.crownstone-quote-form .kivi-tab:hover {
	background: #383838;
	border-color: #505050;
	color: #e0e0e0;
}

.crownstone-quote-form .kivi-tab.active,
.crownstone-quote-form .kivi-tab:has(input:checked) {
	background: #c9a962;
	border-color: #c9a962;
	color: #1a1a1a;
}

/* Kivi input – labeli peal, klõps jõuab otse inputile */
.crownstone-quote-form .kivi-input-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	opacity: 0;
	cursor: pointer;
	border: 0;
}

/* Kivi muster – pildigrid (FMP-stiil) */
.crownstone-quote-form .pattern-grid {
	position: relative;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	gap: 0.75rem;
	margin-top: 0.5rem;
	max-height: 320px;
	overflow-y: auto;
	padding: 0.25rem;
}

.crownstone-quote-form .pattern-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 0.5rem;
	background: #2c2c2c;
	border: 2px solid #404040;
	border-radius: 6px;
	cursor: pointer;
	text-align: center;
	transition: all 0.2s ease;
	touch-action: manipulation;
}

.crownstone-quote-form .pattern-card:hover {
	border-color: #c9a962;
	background: #353535;
	box-shadow: 0 2px 8px rgba(201, 169, 98, 0.2);
}

.crownstone-quote-form .pattern-card.selected,
.crownstone-quote-form .pattern-card:has(input:checked) {
	border-color: #c9a962;
	background: #3a3528;
	box-shadow: 0 0 0 2px rgba(201, 169, 98, 0.4);
}

.crownstone-quote-form .pattern-input-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	opacity: 0;
	cursor: pointer;
	border: 0;
}

.crownstone-quote-form .pattern-card .pattern-img {
	width: 100%;
	aspect-ratio: 1;
	border-radius: 4px;
	overflow: hidden;
	background: #1a1a1a;
	margin-bottom: 0.4rem;
}

.crownstone-quote-form .pattern-card .pattern-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.crownstone-quote-form .pattern-card .pattern-img.no-img,
.crownstone-quote-form .pattern-card .pattern-placeholder {
	background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
	display: flex !important;
	align-items: center;
	justify-content: center;
	font-size: 1.25rem;
	font-weight: 600;
	color: #b8b8b8;
}

.crownstone-quote-form .pattern-card .pattern-img.no-img img {
	display: none !important;
}

.crownstone-quote-form .pattern-card .pattern-name {
	font-size: 0.7rem;
	font-weight: 500;
	color: #e0e0e0;
	line-height: 1.2;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Pildipõhised valikud (servad, valamu, pliit) – FMP detailne teema */
.crownstone-quote-form .img-options {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-top: 0.75rem;
}

.crownstone-quote-form .img-option {
	position: relative;
	flex: 1;
	min-width: 130px;
	max-width: 180px;
	padding: 1.1rem;
	background: #2c2c2c;
	border: 2px solid #404040;
	border-radius: 8px;
	cursor: pointer;
	text-align: center;
	transition: all 0.25s ease;
	touch-action: manipulation;
}

.crownstone-quote-form .img-option:hover {
	border-color: #c9a962;
	background: #353535;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(201, 169, 98, 0.2);
}

.crownstone-quote-form .img-option.selected,
.crownstone-quote-form .img-option:has(input:checked) {
	border-color: #c9a962;
	background: #3a3528;
	box-shadow: 0 0 0 2px rgba(201, 169, 98, 0.4);
}

.crownstone-quote-form .img-option input {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	opacity: 0;
	cursor: pointer;
	border: 0;
}

.crownstone-quote-form .img-option .img-wrap {
	height: 70px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 0.6rem;
}

.crownstone-quote-form .img-option .img-wrap img {
	max-width: 90px;
	max-height: 55px;
	object-fit: contain;
}

.crownstone-quote-form .img-option span {
	display: block;
	font-size: 0.88rem;
	font-weight: 500;
	color: #e0e0e0;
}

/* Input väljad – tumedal taustal */
.crownstone-quote-form select,
.crownstone-quote-form input[type="number"],
.crownstone-quote-form input[type="text"],
.crownstone-quote-form input[type="email"],
.crownstone-quote-form input[type="tel"],
.crownstone-quote-form textarea {
	width: 100%;
	max-width: 400px;
	padding: 0.6rem 0.8rem;
	border: 1px solid #404040;
	border-radius: 4px;
	font-family: inherit;
	font-size: 0.95rem;
	color: #e8e8e8;
	background: #2c2c2c;
}

.crownstone-quote-form select option {
	background: #2c2c2c;
	color: #e8e8e8;
}

.crownstone-quote-form select:focus,
.crownstone-quote-form input:focus,
.crownstone-quote-form textarea:focus {
	outline: none;
	border-color: #c9a962;
	box-shadow: 0 0 0 2px rgba(201, 169, 98, 0.2);
}

/* Jah/Ei valikud */
.crownstone-quote-form .yesno-options {
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;
}

.crownstone-quote-form .yesno-option {
	position: relative;
	padding: 0.5rem 1rem;
	background: #2c2c2c;
	border: 2px solid #404040;
	border-radius: 4px;
	cursor: pointer;
	font-weight: 500;
	color: #c0c0c0;
	transition: all 0.2s;
	touch-action: manipulation;
}

.crownstone-quote-form .yesno-option:hover {
	border-color: #505050;
	color: #e0e0e0;
}

.crownstone-quote-form .yesno-option.selected,
.crownstone-quote-form .yesno-option:has(input:checked) {
	background: #c9a962;
	border-color: #c9a962;
	color: #1a1a1a;
}

.crownstone-quote-form .yesno-option input {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	opacity: 0;
	cursor: pointer;
	border: 0;
}

/* Teenused JAH/EI SOOVI – FMP stiil */
.crownstone-quote-form .teenused-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 1.25rem;
}

.crownstone-quote-form .teenus-item {
	background: #2c2c2c;
	padding: 1.25rem;
	border-radius: 8px;
	border: 1px solid #404040;
}

.crownstone-quote-form .teenus-item h3 {
	font-size: 0.95rem;
	font-weight: 600;
	margin: 0 0 0.75rem;
	color: #fff;
}

.crownstone-quote-form .teenus-item .yesno-options {
	margin-top: 0;
}

/* Num-control +/- */
.crownstone-quote-form .form-group { display: flex; gap: 1em; flex-wrap: wrap; align-items: center; }

.crownstone-quote-form .num-control {
	display: flex;
	align-items: center;
	gap: 0.3rem;
}

.crownstone-quote-form .num-control button {
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid #404040;
	background: #2c2c2c;
	border-radius: 4px;
	cursor: pointer;
	font-size: 1.2rem;
	line-height: 1;
	color: #e8e8e8;
	transition: background 0.2s;
	touch-action: manipulation;
}

.crownstone-quote-form .num-control button:hover {
	background: #383838;
	border-color: #c9a962;
}

.crownstone-quote-form .num-control input {
	width: 60px;
	text-align: center;
}

.crownstone-quote-form .quote-hidden { display: none !important; }

/* Submit nupp */
.crownstone-quote-form .submit-btn {
	padding: 1rem 2.5rem;
	background: #c9a962;
	color: #1a1a1a;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 1rem;
	font-weight: 600;
	margin-top: 1.5rem;
	transition: background 0.2s;
	touch-action: manipulation;
}

.crownstone-quote-form .submit-btn:hover {
	background: #d4b872;
}

/* Success/Error */
.crownstone-quote-form-wrapper:has(.crownstone-quote-success),
.crownstone-quote-form-wrapper:has(.crownstone-quote-error) {
	width: 100%;
	max-width: 960px;
	margin: 0 auto 3em;
	padding: 0 1rem;
	box-sizing: border-box;
}

.crownstone-quote-success,
.crownstone-quote-error {
	padding: 2rem 2.5rem;
	border-radius: 8px;
	text-align: center;
	max-width: 560px;
	margin: 2em auto;
	box-sizing: border-box;
	overflow: visible;
}

.crownstone-quote-success p,
.crownstone-quote-error p {
	margin: 0;
	font-size: 1.1rem;
	line-height: 1.6;
}

.crownstone-quote-success { background: #1a1a1a; color: #e8e8e8; border: 2px solid #c9a962; }
.crownstone-quote-error { background: #1a1a1a; color: #f0c0c0; border: 2px solid #c44; }
.crownstone-quote-error a { color: #c9a962; }

/* Responsive */
@media (max-width: 600px) {
	.crownstone-quote-form { padding: 1.25rem; }
	.crownstone-quote-form-wrapper:has(.crownstone-quote-success),
	.crownstone-quote-form-wrapper:has(.crownstone-quote-error) { padding: 0 1rem; }
	.crownstone-quote-success,
	.crownstone-quote-error { padding: 1.5rem 1.25rem; }
	.crownstone-quote-form .pattern-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 0.5rem; max-height: 280px; }
	.crownstone-quote-form .pattern-card .pattern-name { font-size: 0.65rem; }
	.crownstone-quote-form .img-options { flex-direction: column; }
	.crownstone-quote-form .img-option { max-width: none; }
}
