/**
 * Φόρμα αιτήματος προσφοράς service.
 *
 * Flat: συμπαγή χρώματα, λεπτές γραμμές, μηδέν σκιές και gradients.
 * Ίδια παλέτα με τις σελίδες υπηρεσίας: #1276c4 brand, #e2e8f0 γραμμές.
 */

.tf-service-modal {
	--tf-brand: #1276c4;
	--tf-brand-dark: #0f5f9e;
	--tf-ink: #222222;
	--tf-body: #5f6b7a;
	--tf-line: #d9e0e8;
	--tf-line-soft: #eef2f6;
	--tf-ok: #17693f;

	position: fixed;
	inset: 0;
	display: none;
	justify-content: center;
	align-items: flex-start;
	background: rgba(15, 23, 42, 0.55);
	z-index: 99999;
	padding: 24px 16px;
	overflow-y: auto;
}

.tf-service-modal-content {
	width: 100%;
	max-width: 620px;
	margin: auto;
	background: #ffffff;
	border: 1px solid var(--tf-line);
	border-radius: 4px;
	padding: 0;
}

/* Κεφαλίδα ----------------------------------------------------------- */

.tf-service-modal-head {
	position: relative;
	padding: 22px 56px 18px 24px;
	border-bottom: 1px solid var(--tf-line-soft);
}

.tf-service-modal-content h2 {
	margin: 0 0 6px;
	font-size: 1.25rem;
	line-height: 1.3;
	font-weight: 700;
	text-align: left;
	color: var(--tf-ink);
}

.tf-service-modal-sub {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.5;
	color: var(--tf-body);
}

.tf-service-modal-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 1px solid var(--tf-line);
	border-radius: 3px;
	background: #ffffff;
	color: var(--tf-body);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.tf-service-modal-close:hover {
	border-color: var(--tf-ink);
	color: var(--tf-ink);
}

/* Πεδία -------------------------------------------------------------- */

.tf-service-modal-content form {
	padding: 20px 24px 24px;
}

.tf-service-field-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px 16px;
	margin-bottom: 14px;
}

.tf-service-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.tf-service-field--full {
	grid-column: 1 / -1;
}

/* Τα πεδία εκτός του grid (διεύθυνση, σχόλια) χρειάζονται δικό τους κενό. */
.tf-service-modal-content form > .tf-service-field {
	margin-bottom: 14px;
}

.tf-service-field label {
	/* Block ώστε η στοίχιση να κρατάει και όταν το jQuery slideDown
	   αλλάζει το display του wrapper από flex σε block. */
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--tf-ink);
}

.tf-service-modal-content input[type="text"],
.tf-service-modal-content input[type="email"],
.tf-service-modal-content input[type="tel"],
.tf-service-modal-content textarea {
	width: 100%;
	margin: 0;
	border: 1px solid var(--tf-line);
	border-radius: 3px;
	padding: 11px 12px;
	font-size: 14px;
	color: var(--tf-ink);
	background: #ffffff;
	box-sizing: border-box;
}

.tf-service-modal-content textarea {
	resize: vertical;
	min-height: 96px;
}

.tf-service-modal-content input:focus,
.tf-service-modal-content textarea:focus {
	outline: 1px solid var(--tf-brand);
	outline-offset: -2px;
	border-color: var(--tf-brand);
}

/* Διακόπτης αποστολής ------------------------------------------------
   Στοιχίζεται με τα υπόλοιπα πεδία: ίδιο border και ίδιο εσωτερικό padding,
   ώστε ο διακόπτης να ξεκινά ακριβώς εκεί που ξεκινά το κείμενο των input.
   Πριν ακουμπούσε στην άκρη του container και έμοιαζε μετατοπισμένος. */

.tf-service-toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 14px;
	padding: 11px 12px;
	border: 1px solid var(--tf-line);
	border-radius: 3px;
	cursor: pointer;
	user-select: none;
}

.tf-service-toggle:hover {
	border-color: #b9c5d2;
}

/* Ο κρυφός checkbox δεν πρέπει να πιάνει ΚΑΘΟΛΟΥ χώρο μέσα στο flex row.
   Αρκετά θέματα δίνουν width/height/margin σε input[type=checkbox] με ίδια
   specificity· τότε ο checkbox μπαίνει στη ροή και σπρώχνει τον διακόπτη δεξιά,
   ξεστοιχίζοντάς τον από τα υπόλοιπα πεδία. Ανεβάζουμε specificity και
   κλειδώνουμε τις ιδιότητες που επηρεάζουν τη διάταξη. */
.tf-service-toggle input[type="checkbox"] {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	flex: 0 0 auto;
	opacity: 0;
	appearance: none;
	-webkit-appearance: none;
	clip-path: inset(50%);
	overflow: hidden;
}

.tf-service-toggle-track {
	flex: 0 0 auto;
	position: relative;
	width: 38px;
	height: 20px;
	border-radius: 999px;
	background: #c9d2dc;
}

.tf-service-toggle-thumb {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #ffffff;
}

.tf-service-toggle input:checked + .tf-service-toggle-track {
	background: var(--tf-brand);
}

.tf-service-toggle input:checked + .tf-service-toggle-track .tf-service-toggle-thumb {
	left: 20px;
}

.tf-service-toggle input:focus-visible + .tf-service-toggle-track {
	outline: 2px solid var(--tf-brand);
	outline-offset: 2px;
}

.tf-service-toggle-label {
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--tf-ink);
}

/* Οφέλη και σημείωση -------------------------------------------------- */

.tf-service-highlights {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 20px;
	margin: 0 0 14px;
}

.tf-service-highlights span {
	display: inline-flex;
	align-items: center;
	font-weight: 600;
	font-size: 13px;
	color: var(--tf-body);
}

.tf-service-highlights span::before {
	content: "";
	width: 5px;
	height: 5px;
	margin-right: 8px;
	border-radius: 50%;
	background: var(--tf-brand);
}

.tf-service-note {
	margin: 30px 0 18px;
	padding: 12px 14px;
	border: 1px solid var(--tf-line-soft);
	border-left: 3px solid var(--tf-brand);
	border-radius: 0 3px 3px 0;
	background: #f7fafd;
	color: var(--tf-body);
	font-size: 13px;
	line-height: 1.55;
}

/* Ενέργειες ----------------------------------------------------------- */

.tf-service-modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding-top: 18px;
	border-top: 1px solid var(--tf-line-soft);
}

.tf-service-modal-actions button,
.tf-service-status button {
	border-radius: 3px;
	padding: 12px 22px;
	cursor: pointer;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.2;
}

/* Τα θέματα συχνά δίνουν στα button σταθερό ύψος ή line-height σε px, οπότε το
   κείμενο βγαίνει εκτός κέντρου. Ανεβάζουμε specificity και επαναφέρουμε τη
   στοίχιση, αφήνοντας το ύψος να προκύψει από το padding. */
.tf-service-modal-content .tf-service-modal-actions button,
.tf-service-modal-content .tf-service-status button {
	line-height: 1.2 !important;
	height: auto !important;
	min-height: 0;
	text-transform: none;
	letter-spacing: normal;
	vertical-align: middle;
}

.tf-service-submit {
	border: 1px solid var(--tf-brand);
	background: var(--tf-brand);
	color: #ffffff;
}

.tf-service-submit:hover {
	background: var(--tf-brand-dark);
	border-color: var(--tf-brand-dark);
}

.tf-service-submit[disabled] {
	opacity: 0.6;
	cursor: default;
}

.closeServiceRequest {
	border: 1px solid var(--tf-line);
	background: #ffffff;
	color: var(--tf-ink);
}

.closeServiceRequest:hover {
	border-color: var(--tf-ink);
}

/* Toast --------------------------------------------------------------- */

#serviceRequestToast {
	position: fixed;
	right: 20px;
	bottom: 20px;
	display: none;
	z-index: 100000;
	padding: 12px 16px;
	border-radius: 3px;
	background: #17693f;
	color: #fff;
	font-size: 0.9rem;
	font-weight: 600;
}

#serviceRequestToast.show {
	display: block;
}

#serviceRequestToast.error {
	background: #b3322f;
}

/* Responsive ---------------------------------------------------------- */

@media (max-width: 640px) {
	.tf-service-modal {
		padding: 12px;
	}

	.tf-service-modal-head {
		padding: 18px 52px 14px 18px;
	}

	.tf-service-modal-content form {
		padding: 16px 18px 18px;
	}

	.tf-service-field-grid {
		grid-template-columns: 1fr;
	}

	.tf-service-modal-actions {
		flex-direction: column-reverse;
	}

	.tf-service-modal-actions button {
		width: 100%;
	}
}

/* Καταστάσεις αποστολής ----------------------------------------------
   Το μήνυμα επιτυχίας εμφανίζεται μέσα στη φόρμα και όχι ως toast στη γωνία:
   ο χρήστης κοιτάει τη φόρμα τη στιγμή που πατάει αποστολή, εκεί περιμένει
   και την απάντηση. */

.tf-service-status {
	padding: 44px 24px 40px;
	text-align: center;
}

.tf-service-status[hidden] {
	display: none;
}

.tf-service-spinner {
	display: block;
	width: 28px;
	height: 28px;
	margin: 0 auto 16px;
	border: 2px solid var(--tf-line);
	border-top-color: var(--tf-brand);
	border-radius: 50%;
}

@media (prefers-reduced-motion: no-preference) {
	.tf-service-spinner {
		animation: tf-service-spin 700ms linear infinite;
	}
}

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

.tf-service-status__mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin-bottom: 18px;
	border: 1px solid var(--tf-ok);
	border-radius: 50%;
	color: var(--tf-ok);
}

.tf-service-status__mark svg {
	width: 24px;
	height: 24px;
	display: block;
}

.tf-service-status__title {
	margin: 0 0 10px;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--tf-ink);
}

.tf-service-status__text {
	margin: 0;
	color: var(--tf-body);
	font-size: 0.95rem;
	line-height: 1.65;
}

/* Το κουμπί φέρει ΚΑΙ .tf-service-submit ΚΑΙ .closeServiceRequest. Με ίδια
   specificity υπερισχύει το δεύτερο, που ορίζεται αργότερα, και το κουμπί
   έβγαινε δευτερεύον αντί για κύριο. Το ξεκαθαρίζουμε εδώ. */
#tfServiceSuccess .tf-service-submit {
	margin-top: 26px;
	min-width: 170px;
	border: 1px solid var(--tf-brand);
	background: var(--tf-brand);
	color: #ffffff;
}

#tfServiceSuccess .tf-service-submit:hover {
	background: var(--tf-brand-dark);
	border-color: var(--tf-brand-dark);
}

@media (max-width: 640px) {
	.tf-service-status {
		padding: 34px 18px 30px;
	}

	#tfServiceSuccess .tf-service-submit {
		width: 100%;
	}
}
