/* ==========================================================
   Travel House | Kiirpäring
   Komponendipõhised stiilid. Globaalseid vorme ei muudeta.
   ========================================================== */

.th-qi-form {
    --qi-ink: var(--th-color-primary, #143642);
    --qi-accent: var(--th-color-accent, #da723a);
    --qi-border: #dce5e9;
    --qi-muted: #81949d;
    --qi-radius: 12px;
    width: 100%;
    max-width: 980px;
    color: var(--qi-ink);
}
.th-qi-form *, .th-qi-form *::before, .th-qi-form *::after { box-sizing: border-box; }
.th-qi-form .hidden, .th-qi-thanks.hidden { display: none !important; }
.th-qi-form .form-section { display: block; margin-bottom: 26px; font-size: 20px; font-weight: 600; }
.th-qi-form .form-input-block { margin-bottom: 22px; min-width: 0; }
.th-qi-form .th-qi-label { display: block; margin: 0 0 9px; font-size: 14px; font-weight: 650; line-height: 1.5; }
.th-qi-form .th-qi-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.th-qi-form .th-qi-row > * { min-width: 0; }
.th-qi-form .th-qi-row.flex-start, .th-qi-form .th-qi-row.row--left { justify-content: flex-start; align-items: center; }
.th-qi-form .width-90px { width: 100px; flex: 0 0 100px; }
.th-qi-form .width-150px { width: 150px; }
.th-qi-form .width-200px { width: 200px; }
.th-qi-form .center { display: flex; align-items: center; justify-content: center; }
.th-qi-form .gap-1 { gap: 18px; }

/* Väljad */
.th-qi-form input:not([type="checkbox"]):not([type="radio"]),
.th-qi-form select,
.th-qi-form textarea {
    width: 100%;
    min-height: 54px;
    padding: 13px 17px;
    border: 1px solid rgba(20, 54, 66, .18);
    border-radius: var(--qi-radius);
    background: #fff;
    color: var(--qi-ink);
    font: inherit;
    box-shadow: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.th-qi-form input:focus,
.th-qi-form select:focus,
.th-qi-form textarea:focus {
    outline: none;
    border-color: var(--qi-ink);
    box-shadow: 0 0 0 3px rgba(20, 54, 66, .08);
}
.th-qi-form input::placeholder, .th-qi-form textarea::placeholder { color: rgba(20, 54, 66, .5); opacity: 1; }
.th-qi-form textarea { min-height: 142px; resize: vertical; line-height: 1.55; }
.th-qi-form input[type="checkbox"], .th-qi-form input[type="radio"] { width: auto; min-height: 0; accent-color: var(--qi-accent); }
.th-qi-form .checkbox-label { display: flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; }
.th-qi-form .icon-field { position: relative; display: flex; align-items: center; width: 100%; }
.th-qi-form .icon-field > i { position: absolute; left: 16px; z-index: 1; color: #6c858d; pointer-events: none; }
.th-qi-form .icon-field:has(> i) > input,
.th-qi-form .icon-field:has(> i) > select { padding-left: 46px; }
.th-qi-form .icon-field:has(> i) > input[type="tel"] { padding-left: 85px; }
.th-qi-form .next-form-section-btn { min-height: 52px; border-radius: 12px; text-transform: none; letter-spacing: 0; }
.th-qi-form .next-label { color: var(--qi-accent); font-weight: 600; }
.th-qi-form .baseline, .th-qi-form .smaller-text { display: block; margin-top: 7px; color: var(--qi-muted); font-size: 12px; line-height: 1.55; }
.th-qi-form .baseline { text-align: center; }
.th-qi-form .error-message { display: block; margin-top: 6px; color: #c43b4a; font-size: 13px; }
.th-qi-form .th-qi-notice { margin-top: 12px; color: #a04444; font-size: 14px; }
.th-qi-form #submitBtn:disabled { opacity: .5; cursor: not-allowed; }

/* Hotelli automaattäide */
.th-qi-form #hotel-block { position: relative; }
.th-qi-form .hotelOptions {
    position: absolute;
    top: 100%; left: 0; right: 0;
    z-index: 30;
    max-height: 260px;
    overflow: auto;
    border: 1px solid var(--qi-border);
    border-radius: var(--qi-radius);
    background: #fff;
    box-shadow: 0 12px 30px rgba(20, 54, 66, .1);
}
.th-qi-form .hotelOptions:empty { display: none; }
.th-qi-form .hotelOptions p { margin: 0; padding: 13px 18px; cursor: pointer; }
.th-qi-form .hotelOptions p:hover { background: #fcf0ea; }

/* Reisisoovid ja esimene samm */
.th-qi-form .th-qi-intro { margin-bottom: 30px; }
.th-qi-form .th-qi-intro h2 { margin: 0 0 8px; font-size: clamp(26px, 3vw, 36px); line-height: 1.2; text-align:center; }
.th-qi-form .th-qi-intro p, .th-qi-form .th-qi-muted { margin: 0; color: var(--qi-muted); text-align:center; }
.th-qi-form .th-qi-search-type { border: 0; padding: 0; }
.th-qi-form .th-qi-choice-group { display: flex; flex-wrap: wrap; gap: 12px; }
.th-qi-form .th-qi-choice { position: relative; cursor: pointer; }
.th-qi-form .th-qi-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.th-qi-form .th-qi-choice span { display: block; padding: 14px 20px; border: 1px solid #d5e0e5; border-radius: 13px; font-weight: 600; }
.th-qi-form .th-qi-choice input:checked + span { border-color: #e67536; background: #fcf0ea; color: #dc7138; }
.th-qi-form .th-qi-choice input:focus-visible + span { outline: 3px solid #e67536; outline-offset: 3px; }
.th-qi-form .th-qi-trip-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 16px; }
.th-qi-form .th-qi-trip-grid > div { min-width: 0; }
.th-qi-form .th-qi-travellers { padding-top: 25px; border-top: 1px solid #e2e9ec; }
.th-qi-form .th-qi-travellers h3 { margin: 0 0 4px; font-size: 23px; text-align:center; }
.th-qi-form .th-qi-person-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0; border-bottom: 1px solid #e2e9ec; }
.th-qi-form .th-qi-person-row strong { display: block; font-size: 17px; }
.th-qi-form .th-qi-person-row small { display: block; margin-top: 4px; color: var(--qi-muted); }
.th-qi-form .th-qi-counter { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.th-qi-form .th-qi-counter button { display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 1px solid #d5e0e5; border-radius: 12px; background: #fff; color: var(--qi-ink); font-size: 24px; cursor: pointer; }
.th-qi-form .th-qi-counter button:disabled { opacity: .35; cursor: not-allowed; }
.th-qi-form .th-qi-counter output { width: 24px; text-align: center; font-size: 19px; font-weight: 700; }
.th-qi-form .th-qi-native-values { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip-path: inset(50%) !important; pointer-events: none !important; }
.th-qi-form .agesInnerContainer { display: flex; flex-wrap: wrap; gap: 14px; }
.th-qi-form .agesInnerContainer select { width: 95px; }
.th-qi-form .th-qi-ages { display: flex; flex-wrap: wrap; gap: 14px; padding: 15px; border-radius: 12px; background: #f5f8f9; }
.th-qi-form .th-qi-ages > div { flex: 1 1 120px; }
.th-qi-form .th-qi-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 26px; flex-direction: column; }
.th-qi-form .th-qi-actions .button { padding: 17px 24px; }

/* Teine samm: soovid ja kontaktandmed */
.th-qi-form #second-part { width: 100%; }
.th-qi-form #second-part > .th-qi-row:not(.row--left) { gap: 24px; margin-bottom: 26px; }
.th-qi-form #second-part > .th-qi-row:not(.row--left) > div { flex: 1 1 0; }
.th-qi-form #second-part .radio-inline,
.th-qi-form #second-part .radio-inline, .th-qi-form #second-part .catering-options {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 5px 16px;
    margin: 10px 0 0;
    flex-direction: column;
}
.th-qi-form #second-part .radio-inline label,
.th-qi-form #second-part .catering-options label { display: inline-flex; align-items: center; gap: 7px; margin: 0; line-height: 1.5; cursor: pointer; }
.th-qi-form #second-part .radio-inline input[type="radio"],
.th-qi-form #second-part .catering-options input[type="radio"] { margin: 0; flex-shrink: 0; }
.th-qi-form #second-part > .th-qi-label { margin-top: 22px; }
.th-qi-form #second-part > .th-qi-label:first-of-type { margin-top: 0; }
.th-qi-form #second-part > div:not(.th-qi-row) { min-width: 0; }
.th-qi-form #second-part > div:not(.th-qi-row) + div:not(.th-qi-row) { margin-top: 16px; }
.th-qi-form #second-part .width-200px { width: 100%; max-width: 100%; }
.th-qi-form #second-part .form-input-block { margin-bottom: 0; }
.th-qi-form #second-part .smaller-text {
    margin: 8px 0 20px;
}
.th-qi-form #second-part .terms-text { margin: 22px 0 16px; font-size: 13px; line-height: 1.65; }
.th-qi-form .terms { color: var(--qi-accent); }

/* Läbipaistev tagasi-nupp: toetab nii vana kui uut HTML-i */
.th-qi-form #second-part .row--left:first-child { margin: 0 0 28px; }
.th-qi-form #second-part .row--left:first-child .next-form-section-btn,
.th-qi-form .th-qi-back {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 0;
    margin: 0;
    padding: 5px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--qi-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    transition: color .2s ease;
}
.th-qi-form #second-part .row--left:first-child .next-form-section-btn::before { content: '←'; font-size: 19px; font-weight: 400; line-height: 1; }
.th-qi-form .th-qi-back span { font-size: 20px; font-weight: 400; transition: transform .2s ease; }
.th-qi-form #second-part .row--left:first-child .next-form-section-btn:hover,
.th-qi-form .th-qi-back:hover { border: 0; background: transparent; box-shadow: none; color: var(--qi-accent); }
.th-qi-form .th-qi-back:hover span { transform: translateX(-4px); }
.th-qi-form #second-part .row--left:first-child .next-form-section-btn:focus-visible,
.th-qi-form .th-qi-back:focus-visible { outline: 2px solid var(--qi-accent); outline-offset: 4px; }

/* Kalender: Flatpickr, Travel House'i põhiotsingu stiilis */
.th-qi-form #start-date { cursor: pointer; padding-right: 44px; background: #fff; }
.th-qi-form .th-qi-trip-grid > div:first-child { position: relative; }
.th-qi-form .th-qi-trip-grid > div:first-child::after {
    content: '';
    position: absolute;
    right: 18px; top: 48px;
    width: 18px; height: 18px;
    color: var(--qi-ink);
    background: currentColor;
    opacity: .8;
    pointer-events: none;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='5' width='18' height='16' rx='2' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M7 2v6M17 2v6M3 10h18' stroke='black' stroke-width='2' fill='none'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='5' width='18' height='16' rx='2' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M7 2v6M17 2v6M3 10h18' stroke='black' stroke-width='2' fill='none'/%3E%3C/svg%3E") center/contain no-repeat;
}
.flatpickr-calendar.th-qi-calendar {
    width: 340px;
    padding: 20px 22px 22px;
    border: 0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 36px rgba(20, 54, 66, .13);
    font-family: inherit;
    overflow: visible;
}
.flatpickr-calendar.th-qi-calendar::before,
.flatpickr-calendar.th-qi-calendar::after { display: none; }
.th-qi-calendar .flatpickr-months { position: relative; align-items: center; height: 44px; margin-bottom: 20px; }
.th-qi-calendar .flatpickr-months .flatpickr-month { height: 44px; color: #143642; fill: #143642; }
.th-qi-calendar .flatpickr-current-month { display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; top: 0; left: 0; padding: 0 34px; pointer-events: none; }
.th-qi-calendar .flatpickr-current-month .cur-month,
.th-qi-calendar .flatpickr-current-month .numInputWrapper { display: none !important; }
.th-qi-calendar .th-qi-month-label { display: block; color: #143642; font-size: 16px; font-weight: 700; white-space: nowrap; line-height: 44px; }
.th-qi-calendar .flatpickr-months .flatpickr-prev-month,
.th-qi-calendar .flatpickr-months .flatpickr-next-month {
    display: flex; align-items: center; justify-content: center;
    top: 8px; z-index: 2;
    width: 30px; height: 30px; padding: 5px;
    color: #143642; fill: none;
    cursor: pointer;
}
.th-qi-calendar .flatpickr-months .flatpickr-prev-month { left: 0; }
.th-qi-calendar .flatpickr-months .flatpickr-next-month { right: 0; }
.th-qi-calendar .flatpickr-months .flatpickr-prev-month svg,
.th-qi-calendar .flatpickr-months .flatpickr-next-month svg { display: block; width: 16px; height: 16px; }
.th-qi-calendar .flatpickr-months .flatpickr-prev-month:hover,
.th-qi-calendar .flatpickr-months .flatpickr-next-month:hover { color: #e67536; fill: none; }
.th-qi-calendar .flatpickr-weekdays { width: 296px; min-width: 296px; max-width: 296px; height: 34px; margin-bottom: 8px; }
.th-qi-calendar span.flatpickr-weekday { color: #82949c; font-size: 11px; font-weight: 700; }
.th-qi-calendar .flatpickr-innerContainer,
.th-qi-calendar .flatpickr-rContainer,
.th-qi-calendar .dayContainer { width: 296px; min-width: 296px; max-width: 296px; }
.th-qi-calendar .dayContainer { padding: 0; }
.th-qi-calendar .flatpickr-day {
    position: relative;
    max-width: 42px; height: 44px; line-height: 44px;
    border: 0 !important; border-radius: 0;
    background: transparent;
    color: #143642;
    font-size: 13px; font-weight: 400;
}
.th-qi-calendar .flatpickr-day:hover:not(.flatpickr-disabled) { border-radius: 8px; background: #f5f8f9; color: #143642; }
.th-qi-calendar .flatpickr-day.today,
.th-qi-calendar .flatpickr-day.selected,
.th-qi-calendar .flatpickr-day.selected:hover { background: transparent; color: #143642; font-weight: 750; }
.th-qi-calendar .flatpickr-day.today::after,
.th-qi-calendar .flatpickr-day.selected::after {
    content: '';
    position: absolute;
    bottom: 4px; left: 50%; transform: translateX(-50%);
    width: 3px; height: 3px;
    border-radius: 50%; background: #e67536;
}
.th-qi-calendar .flatpickr-day.flatpickr-disabled,
.th-qi-calendar .flatpickr-day.prevMonthDay,
.th-qi-calendar .flatpickr-day.nextMonthDay { color: #cbd5d9; }

/* Teavitused ja kinnituse aken */
.th-qi-thanks { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0, 0, 0, .5); }
.th-qi-thanks .thank-you-card { width: min(100%, 480px); padding: 28px; border-radius: 18px; background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .15); }
.th-qi-thanks .thank-you-header h2 { margin: 0 0 14px; }
.th-qi-thanks .back-link a { color: var(--th-color-accent, #da723a); }
.th-qi-form .loader { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-bottom-color: transparent; border-radius: 50%; animation: th-qi-spin 1s linear infinite; }
@keyframes th-qi-spin { to { transform: rotate(360deg); } }

/* Väiksemad ekraanid */
@media (max-width: 680px) {
    .th-qi-form .th-qi-row { flex-wrap: wrap; gap: 14px; }
    .th-qi-form .th-qi-row > div:not(.width-90px) { flex: 1 1 200px; }
    .th-qi-form .width-90px { flex: 1 1 90px; }
    .th-qi-form .width-150px { width: auto; }
    .th-qi-form .th-qi-row.form-input-block > strong { width: 100%; }
    .th-qi-form .th-qi-row > .checkbox-label { flex: 0 1 auto; }
    .th-qi-form .th-qi-trip-grid { grid-template-columns: 1fr; }
    .th-qi-form .th-qi-choice { flex: 1; }
    .th-qi-form .th-qi-choice span { text-align: center; }
    .th-qi-form #second-part > .th-qi-row:not(.row--left) > div { flex: 1 1 100%; }
    .th-qi-form .th-qi-person-row { gap: 12px; }
    .th-qi-form .th-qi-counter { gap: 10px; }
}
@media (max-width: 380px) {
    .flatpickr-calendar.th-qi-calendar { width: 300px; padding: 14px 12px; }
    .th-qi-calendar .flatpickr-innerContainer,
    .th-qi-calendar .flatpickr-rContainer,
    .th-qi-calendar .dayContainer,
    .th-qi-calendar .flatpickr-weekdays { width: 276px; min-width: 276px; max-width: 276px; }
    .th-qi-calendar .flatpickr-day { max-width: 39.42px; }
}


/* --------------------------------------------------
   ÜLDPÄRINGU NUPP

   Kiirpäringu vormi all: "Täida üldpäring" ja selle
   kõrval nupp, mis avab Typeformi hüpikaknas.

   Nupp on sama .button .button-accent, mis mujal
   saidil - kuju tuleb v360-core'ist, siin on ainult
   paigutus ja teksti suurus.

   Flex koos wrap'iga, sest kitsal ekraanil ei mahu
   tekst ja nupp kõrvuti - siis lähevad nad üksteise
   alla, mitte ei suru nuppu kokku.
-------------------------------------------------- */

.th-qi-general {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 16px;

	margin-top: 32px;

	font-size: 20px;
	line-height: 1.4;
}
