/* =============================================================================
   EAK vormid – kujundus teema värvidega (lilla, türkiis, kollane)
   Kõik reeglid on .eak-form sees, et teema üldised input/select stiilid ei segaks.
   ========================================================================== */

.eak-form {
	--eak-purple: #6b3fb9;
	--eak-purple-dark: #55309a;
	--eak-purple-soft: #f3eefb;
	--eak-teal: #00a09a;
	--eak-teal-soft: #e3f5f4;
	--eak-yellow: #f3b633;
	--eak-red: #d0021b;
	--eak-red-soft: #fff1f3;
	--eak-ink: #2a2338;
	--eak-muted: #6e6680;
	--eak-line: #e6e0f0;
	--eak-field: #f1e8ff;
	--eak-radius: 14px;
	--eak-shadow: .625rem .625rem 3.125rem .3125rem rgba(0,0,0,.05);

	position: relative;
	clear: both;
	max-width: 980px;
	margin: 0 auto 5em;
	color: var(--eak-ink);
	text-align: left;
	font-size: 16px;
	line-height: 1.5;
	counter-reset: eak-step;
}
.eak-form *,
.eak-form *::before,
.eak-form *::after { box-sizing: border-box; }

/* ---------------------------------------------------------------------------
   Kaardid (plokid)
   ------------------------------------------------------------------------ */
.eak-form .eak-card {
	position: relative;
	margin: 0 0 1.75em;
	padding: 2em 1.25em 1.75em;
	background: #fff;
	box-shadow: var(--eak-shadow);
	overflow: visible;
}
.eak-form .eak-card::before {
	content: "";
	position: absolute;
	top: -1px; left: 0; right: 0;
	height: 5px;
	background: var(--eak-purple);
}
@media (min-width: 769px) {
	.eak-form .eak-card { padding: 2.75em 3em 2.5em; }
}

.eak-form .eak-card__head {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 1.75em;
}
.eak-form .eak-card--titled { counter-increment: eak-step; }
.eak-form .eak-card__num {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px; height: 42px;
	border-radius: 50%;
	background: var(--eak-purple);
	color: #fff;
	font-family: "museo-sans", sans-serif;
	font-weight: 700;
	font-size: 18px;
}
.eak-form .eak-card__num::before { content: counter(eak-step); }
.eak-form .eak-card__title {
	margin: 0;
	padding: 0;
	font-family: "museo-sans", sans-serif;
	font-size: 1.5em;
	font-weight: 700;
	line-height: 1.2;
	color: var(--eak-ink);
	border: 0;
}

/* ---------------------------------------------------------------------------
   Ruudustik
   ------------------------------------------------------------------------ */
.eak-form .eak-grid {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 1.4em 1.5em;
}
.eak-form .eak-col--12,
.eak-form .eak-col--6,
.eak-form .eak-col--4 { grid-column: span 12; }
@media (min-width: 769px) {
	.eak-form .eak-col--6,
	.eak-form .eak-col--4 { grid-column: span 6; }
}
@media (min-width: 1025px) {
	.eak-form .eak-col--4 { grid-column: span 4; }
}

/* ---------------------------------------------------------------------------
   Sildid, abitekst, vead
   ------------------------------------------------------------------------ */
.eak-form .eak-field { position: relative; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 0;}
.eak-form .eak-label {
	display: block;
	float: none;
	width: auto;
	margin: 0 0 8px;
	padding: 0;
	font-family: "museo-sans", sans-serif;
	font-size: .95em;
	font-weight: 600;
	color: var(--eak-ink);
	text-align: left;
}
.eak-form .eak-req { color: var(--eak-purple); font-weight: 700; }
.eak-form .eak-help { margin: 6px 0 0; font-size: .85em; color: var(--eak-muted); }
.eak-form .eak-error {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 8px 0 0;
	font-size: .85em;
	font-weight: 600;
	color: var(--eak-red);
}
.eak-form .eak-error::before {
	content: "!";
	flex: 0 0 auto;
	display: inline-flex; align-items: center; justify-content: center;
	width: 18px; height: 18px;
	border-radius: 50%;
	background: var(--eak-red);
	color: #fff;
	font-size: 12px;
	line-height: 1;
}
.eak-form .eak-error:empty { display: none; }

/* ---------------------------------------------------------------------------
   Väljad
   ------------------------------------------------------------------------ */
.eak-form .eak-input {
	display: block;
	width: 100%;
	max-width: none;
	height: 54px;
	margin: 0;
	padding: 0 18px;
	border: 2px solid transparent;
	background-color: var(--eak-field);
	color: var(--eak-ink);
	font: inherit;
	font-size: 1em;
	line-height: 1.3;
	outline: none;
	appearance: none;
	-webkit-appearance: none;
	transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
	border-radius: 0;
}
.eak-form .eak-input::placeholder { color: #a39cb3; opacity: 1; }
.eak-form .eak-input:hover { background-color: #f3f0fa; }
.eak-form .eak-input:focus,
.eak-form .eak-input:focus-visible {
	background-color: #fff;
	border-color: var(--eak-teal);
	box-shadow: 0 0 0 4px rgba(0, 160, 154, .16);
}
.eak-form .eak-input--area { height: auto; min-height: 130px; padding: 14px 18px; resize: vertical; }
.eak-form .eak-input--select {
	padding-right: 48px;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%236b3fb9' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	background-size: 20px 20px;
}
.eak-form .eak-input--select option:disabled { color: #b8b2c4; }
.eak-form input[type="number"].eak-input { -moz-appearance: textfield; }

.eak-form .is-invalid .eak-input {
	border-color: var(--eak-red);
	background-color: var(--eak-red-soft);
	box-shadow: none;
}

/* ---------------------------------------------------------------------------
   Kalender
   ------------------------------------------------------------------------ */
.eak-form .eak-dp { position: relative; }
.eak-form .eak-dp__trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	text-align: left;
	cursor: pointer;
}
.eak-form .eak-dp__trigger.is-placeholder .eak-dp__value { color: #8f879f; }
.eak-form .eak-dp__value { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.eak-form .eak-dp__icon { display: inline-flex; color: var(--eak-purple); flex: 0 0 auto; }
.eak-form .eak-dp.is-open .eak-dp__trigger { background-color: #fff; border-color: var(--eak-teal); }

.eak-form .eak-dp__pop {
	position: absolute;
	z-index: 60;
	top: calc(100% + 10px);
	left: 0;
	width: 340px;
	max-width: calc(100vw - 2em);
	padding: 16px;
	background: #fff;
	border: 1px solid var(--eak-line);
	border-radius: 20px;
	box-shadow: 0 30px 70px -20px rgba(42, 35, 56, .35);
}
.eak-form .eak-dp.is-up .eak-dp__pop { top: auto; bottom: calc(100% + 10px); }
.eak-form .eak-dp__pop[hidden] { display: none; }

.eak-form .eak-dp__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 10px;
}
.eak-form .eak-dp__title {
	font-family: "museo-sans", sans-serif;
	font-weight: 700;
	font-size: 1.05em;
	color: var(--eak-ink);
}
.eak-form .eak-dp__nav {
	position: relative;
	width: 38px; height: 38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--eak-purple-soft);
	color: var(--eak-purple);
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
}
.eak-form .eak-dp__nav::before {
	content: "";
	position: absolute;
	top: 50%; left: 50%;
	width: 9px; height: 9px;
	border-left: 2.5px solid currentColor;
	border-bottom: 2.5px solid currentColor;
	transform: translate(-35%, -50%) rotate(45deg);
}
.eak-form .eak-dp__nav--next::before { transform: translate(-65%, -50%) rotate(-135deg); }
.eak-form .eak-dp__nav:hover:not(:disabled) { background: var(--eak-purple); color: #fff; }
.eak-form .eak-dp__nav:focus-visible { outline: 3px solid var(--eak-teal); outline-offset: 2px; }
.eak-form .eak-dp__nav:disabled { opacity: .35; cursor: default; }

.eak-form .eak-dp__grid { width: 100%; margin: 0; border: 0; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.eak-form .eak-dp__grid th,
.eak-form .eak-dp__grid td { padding: 0; border: 0; background: none; text-align: center; }
.eak-form .eak-dp__grid th {
	padding-bottom: 6px;
	font-size: .75em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--eak-muted);
}
.eak-form .eak-dp__day {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1 / 1;
	max-height: 42px;
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: var(--eak-ink);
	font: inherit;
	font-size: .95em;
	font-weight: 600;
	cursor: pointer;
	transition: background-color .12s ease, color .12s ease;
}
.eak-form .eak-dp__day:hover { background: var(--eak-teal-soft); color: var(--eak-ink); }
.eak-form .eak-dp__day:focus-visible { outline: 3px solid var(--eak-teal); outline-offset: 1px; }
.eak-form .eak-dp__day.is-outside { color: #b8b2c4; font-weight: 400; }
.eak-form .eak-dp__day.is-today { box-shadow: inset 0 0 0 2px var(--eak-yellow); }
.eak-form .eak-dp__day.is-disabled {
	color: #cbc6d5;
	font-weight: 400;
	text-decoration: line-through;
	text-decoration-color: rgba(203, 198, 213, .8);
	cursor: not-allowed;
	background: transparent;
}
.eak-form .eak-dp__day.is-selected,
.eak-form .eak-dp__day.is-selected:hover {
	background: var(--eak-purple);
	color: #fff;
	text-decoration: none;
	box-shadow: 0 6px 16px -6px rgba(107, 63, 185, .7);
}

/* Brauseri enda kuupäevaväli (ilma JS-ita) */
.eak-form .eak-dp:not(.is-enhanced) .eak-date { padding-right: 12px; }

/* ---------------------------------------------------------------------------
   Valikud – nupud (raadio + märkeruudud)
   ------------------------------------------------------------------------ */
.eak-form fieldset.eak-field { min-inline-size: 0; }
.eak-form fieldset.eak-field > legend { float: left; width: 100%; }
.eak-form .eak-pills { clear: both; display: flex; flex-wrap: wrap; gap: 10px; }
.eak-form .eak-pill { position: relative; display: inline-flex; margin: 0; padding: 0; cursor: pointer; float: none; width: auto; }
.eak-form .eak-pill__input {
	position: absolute;
	opacity: 0;
	width: 1px; height: 1px;
	margin: 0; padding: 0; border: 0;
	pointer-events: none;
}
.eak-form .eak-pill__text {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 46px;
	padding: 10px 18px;
	border: 2px solid var(--eak-line);
	border-radius: 999px;
	background: #fff;
	color: var(--eak-ink);
	font-weight: 600;
	font-size: .95em;
	line-height: 1.25;
	transition: border-color .15s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.eak-form .eak-pills--multi .eak-pill__text::before {
	content: "";
	flex: 0 0 auto;
	width: 18px; height: 18px;
	border: 2px solid #c9c1d9;
	border-radius: 6px;
	background: #fff center / 12px no-repeat;
}
.eak-form .eak-pill:hover .eak-pill__text { border-color: var(--eak-teal); }
.eak-form .eak-pill__input:focus-visible + .eak-pill__text { box-shadow: 0 0 0 4px rgba(0, 160, 154, .25); border-color: var(--eak-teal); }
.eak-form .eak-pill__input:checked + .eak-pill__text {
	background: var(--eak-purple);
	border-color: var(--eak-purple);
	color: #fff;
	box-shadow: 0 8px 18px -10px rgba(107, 63, 185, .8);
}
.eak-form .eak-pills--multi .eak-pill__input:checked + .eak-pill__text::before {
	border-color: #fff;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%236b3fb9' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.eak-form .eak-pill.is-disabled { cursor: not-allowed; }
.eak-form .eak-pill.is-disabled .eak-pill__text {
	border-style: dashed;
	background: #faf9fc;
	color: #b8b2c4;
	text-decoration: line-through;
	box-shadow: none;
}
.eak-form .is-invalid .eak-pill__text { border-color: var(--eak-red); }

/* ---------------------------------------------------------------------------
   Nõusolek
   ------------------------------------------------------------------------ */
.eak-form .eak-consent { display: flex; align-items: flex-start; gap: 12px; margin: 0; cursor: pointer; float: none; width: auto; }
.eak-form .eak-consent__input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.eak-form .eak-consent__box {
	flex: 0 0 auto;
	width: 26px; height: 26px;
	margin-top: -1px;
	border: 2px solid #c9c1d9;
	border-radius: 8px;
	background: #fff center / 16px no-repeat;
	transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.eak-form .eak-consent:hover .eak-consent__box { border-color: var(--eak-teal); }
.eak-form .eak-consent__input:focus-visible + .eak-consent__box { box-shadow: 0 0 0 4px rgba(0, 160, 154, .25); border-color: var(--eak-teal); }
.eak-form .eak-consent__input:checked + .eak-consent__box {
	border-color: var(--eak-purple);
	background-color: var(--eak-purple);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.eak-form .is-invalid .eak-consent__box { border-color: var(--eak-red); background-color: var(--eak-red-soft); }
.eak-form .eak-consent__text a { color: var(--eak-purple); text-decoration: underline; }

/* ---------------------------------------------------------------------------
   Infotekst
   ------------------------------------------------------------------------ */
.eak-form .eak-info {
	padding: 1em 1.25em;
	border-left: 4px solid var(--eak-yellow);
	border-radius: 0 var(--eak-radius) var(--eak-radius) 0;
	background: #fdf7e8;
}
.eak-form .eak-info__title { margin: 0 0 .25em; font-weight: 700; }
.eak-form .eak-info p { margin: 0 0 .5em; }
.eak-form .eak-info p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------------------
   Saatmine
   ------------------------------------------------------------------------ */
.eak-form .eak-form__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1em 2em;
	padding: .5em .25em 0;
}
.eak-form .eak-form__note { margin: 0; font-size: .9em; color: var(--eak-muted); }
.eak-form .eak-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 58px;
	margin: 0 0 0 auto;
	padding: 0 2.25em;
	border: 0;
	border-radius: 999px;
	background: var(--eak-purple);
	color: #fff;
	font-family: "museo-sans", sans-serif;
	font-size: 1.05em;
	font-weight: 700;
	letter-spacing: .01em;
	cursor: pointer;
	box-shadow: 0 16px 32px -14px rgba(107, 63, 185, .85);
	transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.eak-form .eak-btn svg { transition: transform .2s ease; }
.eak-form .eak-btn:hover { background: var(--eak-purple-dark); transform: translateY(-1px); }
.eak-form .eak-btn:hover svg { transform: translateX(4px); }
.eak-form .eak-btn:focus-visible { outline: 3px solid var(--eak-teal); outline-offset: 3px; }
.eak-form .eak-btn:disabled { cursor: wait; opacity: .85; transform: none; }
.eak-form.is-sending .eak-btn svg { display: none; }
.eak-form.is-sending .eak-btn::after {
	content: "";
	width: 18px; height: 18px;
	border: 2.5px solid rgba(255, 255, 255, .45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: eak-spin .7s linear infinite;
}
@keyframes eak-spin { to { transform: rotate(360deg); } }
@media (max-width: 600px) {
	.eak-form .eak-btn { width: 100%; }
}

.eak-form .eak-form__notice:empty { display: none; }
.eak-form .eak-form__notice {
	margin: 1.25em 0 0;
	padding: 1em 1.25em;
	border-left: 4px solid var(--eak-red);
	border-radius: 0 var(--eak-radius) var(--eak-radius) 0;
	background: var(--eak-red-soft);
	color: var(--eak-red);
	font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Tänuteade
   ------------------------------------------------------------------------ */
.eak-form .eak-success {
	position: relative;
	padding: 3em 1.5em;
	background: linear-gradient(135deg, var(--eak-purple) 0%, #5a35a3 55%, #46308f 100%);
	color: #fff;
	text-align: center;
	outline: none;
	overflow: hidden;
}

.eak-form .eak-success__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 50px; height: 50px;
	margin-bottom: 1em;
	border-radius: 50%;
	background: var(--eak-yellow);
	color: #fff;
	animation: eak-pop .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.eak-form .eak-success__msg { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; font-size: 1.15em; line-height: 1.55; }
.eak-form .eak-success__msg p { margin: 0 0 .5em; color: #fff; }
.eak-form .eak-success__msg p:last-child { margin-bottom: 0; }
.eak-form .eak-success a { color: #fff; }
@keyframes eak-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------------------------------------------------------------------------
   Muu
   ------------------------------------------------------------------------ */
.eak-form .eak-form__preview {
	margin: 0 0 1.5em;
	padding: .9em 1.25em;
	border: 2px dashed var(--eak-yellow);
	border-radius: var(--eak-radius);
	background: #fff8e6;
	font-weight: 600;
}

.eak-form .eak-hp {
	position: absolute !important;
	left: -10000px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

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