/* ===== RESERVATION SYSTEM ===== */
.reservation-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    align-items: start;
}

/* Calendar */
.calendar-container {
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.cal-month {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--gray-800);
}

.cal-nav {
    width: 40px;
    height: 40px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

@media (hover: hover) {
    .cal-nav:hover {
        background: var(--gray-50);
        border-color: var(--primary-light);
        color: var(--primary);
    }
}

.cal-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.calendar-legend {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
    font-size: 0.8rem;
    color: var(--gray-500);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.available {
    background: #4caf50;
}

.legend-dot.booked {
    background: #ef5350;
}

.legend-dot.selected {
    background: var(--primary);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cal-day-header {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    padding: var(--space-sm);
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: default;
    transition: color var(--transition), transform var(--transition);
    position: relative;
    isolation: isolate;
    color: var(--gray-600);
}

.cal-day::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(243, 247, 250, 0.95));
    border: 1px solid rgba(84, 110, 122, 0.08);
    transition: background-color var(--transition), border-color var(--transition), inset var(--transition), border-radius var(--transition);
    z-index: -1;
}

.cal-day-label {
    position: relative;
    z-index: 1;
}

.cal-day.empty {
    background: transparent;
}

.cal-day.empty::before {
    display: none;
}

.cal-day.past {
    color: var(--gray-300);
}

.cal-day.available {
    color: #2e7d32;
    cursor: pointer;
    font-weight: 600;
}

.cal-day.available::before {
    background: rgba(76, 175, 80, 0.12);
    border-color: rgba(76, 175, 80, 0.16);
}

/* Pointer-only: on touch screens :hover sticks after a tap, leaving the
   calendar cell stuck on the darker green hover state until you tap away. */
@media (hover: hover) {
    .cal-day.available:hover {
        transform: translateY(-1px);
    }

    .cal-day.available:hover::before {
        background: rgba(76, 175, 80, 0.2);
        border-color: rgba(76, 175, 80, 0.24);
    }
}

.cal-day.booked {
    color: #c62828;
}

.cal-day.booked::before {
    background: rgba(239, 83, 80, 0.1);
    border-color: rgba(239, 83, 80, 0.14);
}

.cal-day.has-term.term-continue-prev::before {
    left: -1px;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}

.cal-day.has-term.term-continue-next::before {
    right: -1px;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
}

.cal-day.selected {
    color: var(--white) !important;
    transform: translateY(-1px);
    font-weight: 700;
}

.cal-day.selected::before {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(26, 82, 118, 0.3);
}

.cal-day.today {
    font-weight: 700;
}

.cal-day.today:not(.selected)::after {
    content: '';
    position: absolute;
    bottom: 7px;
    left: 50%;
    width: 6px;
    height: 6px;
    margin-left: -3px;
    border-radius: 50%;
    background: var(--accent);
    z-index: 1;
}

/* Available Terms List */
.available-terms {
    margin-top: var(--space-lg);
    border-top: 1px solid var(--gray-100);
    padding-top: 0;
    max-height: 360px;
    overflow-y: auto;
    background: var(--white);
    scroll-padding-top: 84px;
    overscroll-behavior: contain;
}

.terms-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    position: sticky;
    top: 0;
    background: var(--white);
    padding: var(--space-lg) 0 var(--space-sm);
    border-bottom: 1px solid var(--gray-100);
    box-shadow: 0 10px 18px -18px rgba(26, 82, 118, 0.45);
    z-index: 2;
}

.terms-header h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 0;
}

.terms-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--gray-500);
    cursor: pointer;
    user-select: none;
    transition: color var(--transition), transform 0.2s ease;
}

.terms-filter:hover {
    color: var(--primary);
}

.terms-filter input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.terms-filter:hover input[type="checkbox"],
.terms-filter input[type="checkbox"]:focus-visible {
    transform: scale(1.08);
    box-shadow: 0 0 0 4px rgba(41, 128, 185, 0.12);
}

.term-month-group + .term-month-group {
    margin-top: var(--space-lg);
}

.term-month-title {
    margin: 0 0 var(--space-sm);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gray-500);
}

.term-month-list {
    display: grid;
    gap: 0.6rem;
}

.term-bar {
    width: 100%;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--gray-150, rgba(84, 110, 122, 0.12));
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(243, 247, 250, 0.98));
    color: var(--gray-700);
    font: inherit;
    text-align: left;
    box-shadow: 0 1px 2px rgba(13, 27, 42, 0.04);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition), background-color var(--transition);
}

.term-bar.available {
    cursor: pointer;
    border-color: rgba(76, 175, 80, 0.18);
    background: linear-gradient(180deg, rgba(246, 251, 246, 0.98), rgba(239, 248, 240, 0.98));
}

/* Only apply the lift on devices with a real pointer — on touch screens
   :hover sticks after a tap and looked like the row stayed highlighted. */
@media (hover: hover) {
    .term-bar.available:hover {
        transform: translateY(-1px);
        border-color: rgba(76, 175, 80, 0.28);
        box-shadow: 0 10px 20px rgba(46, 125, 50, 0.08);
    }
}

.term-bar.booked,
.term-bar.blocked {
    cursor: default;
    border-color: rgba(239, 83, 80, 0.14);
    background: linear-gradient(180deg, rgba(254, 246, 246, 0.98), rgba(253, 241, 241, 0.98));
}

.term-bar.blocked {
    border-color: rgba(84, 110, 122, 0.14);
    background: linear-gradient(180deg, rgba(246, 248, 250, 0.98), rgba(241, 244, 247, 0.98));
}

.term-bar.selected {
    border-color: var(--primary);
    background: linear-gradient(180deg, rgba(233, 242, 249, 0.98), rgba(225, 237, 247, 0.98));
    box-shadow: 0 12px 24px rgba(26, 82, 118, 0.12);
}

.term-bar:disabled {
    opacity: 1;
}

.term-bar-badge {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    background: rgba(84, 110, 122, 0.12);
    color: var(--gray-500);
}

.term-bar.available .term-bar-badge {
    background: rgba(76, 175, 80, 0.16);
    color: #2e7d32;
}

.term-bar.booked .term-bar-badge,
.term-bar.blocked .term-bar-badge {
    background: rgba(239, 83, 80, 0.14);
    color: #c62828;
}

.term-bar.blocked .term-bar-badge {
    background: rgba(84, 110, 122, 0.12);
    color: var(--gray-500);
}

.term-bar.selected .term-bar-badge {
    background: rgba(26, 82, 118, 0.14);
    color: var(--primary);
}

.term-bar-main {
    min-width: 0;
    display: grid;
    gap: 0.18rem;
}

.term-bar-date {
    font-weight: 700;
    color: var(--gray-800);
    font-size: 0.96rem;
}

.term-bar-meta {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.term-bar-side {
    display: grid;
    justify-items: end;
    gap: 0.18rem;
    text-align: right;
}

.term-bar-price {
    font-weight: 800;
    color: var(--primary);
    font-size: 0.98rem;
}

.term-bar-status {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--gray-500);
}

.term-bar.available .term-bar-status {
    color: #2e7d32;
}

.term-bar.booked .term-bar-status {
    color: #c62828;
}

.term-bar.blocked .term-bar-status {
    color: var(--gray-500);
}

/* Reservation Form */
.reservation-form-container {
    position: sticky;
    top: 100px;
}

.reservation-form {
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
}

.form-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--space-lg);
}

.form-selected-date {
    background: var(--gray-50);
    border: 2px dashed var(--gray-200);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-lg);
    text-align: center;
    transition: all var(--transition);
}

.form-selected-date.has-date {
    background: rgba(26, 82, 118, 0.05);
    border-color: var(--primary-light);
    border-style: solid;
}

.form-selected-date p {
    font-size: 0.9rem;
    color: var(--gray-400);
}

.form-selected-date .date-display {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--primary);
}

.form-selected-date .price-display {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-top: 4px;
}

.form-group {
    margin-bottom: var(--space-md);
    transition: transform var(--transition);
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: var(--space-xs);
    transition: color var(--transition), transform var(--transition);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray-700);
    box-shadow: 0 1px 2px rgba(13, 27, 42, 0.04);
    transform: translateY(0);
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition), transform var(--transition);
}

.form-group input:not([type="checkbox"]),
.form-group select {
    min-height: 52px;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--gray-300);
    background: #fbfcfe;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.phone-field-shell {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    align-items: stretch;
    min-height: 52px;
    max-width: 360px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,247,249,0.94));
    box-shadow: 0 1px 2px rgba(13, 27, 42, 0.04);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition), transform var(--transition);
}

.phone-field-group {
    position: relative;
    z-index: 1;
}

.phone-field-group:focus-within {
    z-index: 40;
}

/* When the country dropdown is open, lift the whole field above the form
   fields below it. :focus-within alone is unreliable on touch (a tap may not
   keep focus on the trigger), so drive it from the open state too. */
.phone-field-group.country-open {
    z-index: 50;
}

.phone-field-shell:hover {
    border-color: var(--gray-300);
    background: linear-gradient(180deg, rgba(255,255,255,1), rgba(248,251,253,0.98));
}

.phone-field-group:focus-within .phone-field-shell {
    border-color: var(--primary-light);
    box-shadow: 0 12px 28px rgba(26, 82, 118, 0.08), 0 0 0 4px rgba(41, 128, 185, 0.14);
    transform: translateY(-1px);
    background: var(--white);
}

.phone-country-wrap {
    position: relative;
    border-right: 1px solid rgba(84, 110, 122, 0.12);
    background: linear-gradient(180deg, rgba(245,247,249,0.98), rgba(235, 241, 246, 0.92));
}

.phone-country-trigger,
.phone-number-input {
    min-height: 52px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.phone-country-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.75rem 0.4rem;
    font-weight: 600;
    color: var(--primary-dark);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.phone-number-input {
    width: 100%;
    padding: 0.75rem 0.85rem;
    letter-spacing: 0.02em;
}

.phone-country-trigger:hover,
.phone-number-input:hover,
.phone-country-trigger:focus,
.phone-number-input:focus {
    background: transparent;
    box-shadow: none;
    transform: none;
}

.phone-country-trigger:focus-visible {
    outline: none;
}

.phone-country-flag,
.phone-country-option-flag {
    flex-shrink: 0;
    position: relative;
    width: 18px;
    height: 14px;
    display: inline-block;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(13, 27, 42, 0.08);
    background: #dfe8ee;
}

.phone-country-flag.is-cz,
.phone-country-option-flag.is-cz {
    background: linear-gradient(180deg, #ffffff 0 50%, #d7141a 50% 100%);
}

.phone-country-flag.is-cz::before,
.phone-country-option-flag.is-cz::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 56%;
    background: #11457e;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.phone-country-flag.is-sk,
.phone-country-option-flag.is-sk {
    background: linear-gradient(180deg, #ffffff 0 33.33%, #0b4ea2 33.33% 66.66%, #ee1c25 66.66% 100%);
}

.phone-country-flag.is-sk::before,
.phone-country-option-flag.is-sk::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 7px;
    height: 9px;
    border-radius: 2px 2px 3px 3px;
    clip-path: polygon(8% 0, 92% 0, 92% 72%, 50% 100%, 8% 72%);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.92);
    background:
        radial-gradient(circle at 28% 92%, #0b4ea2 0 42%, transparent 43%),
        radial-gradient(circle at 50% 88%, #0b4ea2 0 44%, transparent 45%),
        radial-gradient(circle at 72% 92%, #0b4ea2 0 42%, transparent 43%),
        linear-gradient(90deg, transparent 0 32%, #ffffff 32% 43%, transparent 43% 57%, #ffffff 57% 68%, transparent 68% 100%),
        linear-gradient(180deg, transparent 0 16%, #ffffff 16% 28%, transparent 28% 40%, #ffffff 40% 52%, transparent 52% 100%),
        #ee1c25;
}

.phone-country-flag.is-de,
.phone-country-option-flag.is-de {
    background: linear-gradient(180deg, #111111 0 33.33%, #dd0000 33.33% 66.66%, #ffce00 66.66% 100%);
}

.phone-country-flag.is-at,
.phone-country-option-flag.is-at {
    background: linear-gradient(180deg, #ed2939 0 33.33%, #ffffff 33.33% 66.66%, #ed2939 66.66% 100%);
}

.phone-country-flag.is-pl,
.phone-country-option-flag.is-pl {
    background: linear-gradient(180deg, #ffffff 0 50%, #dc143c 50% 100%);
}

.phone-country-option.selected .phone-country-option-meta {
    color: var(--primary);
}

.phone-country-code {
    flex: 0 0 auto;
    white-space: nowrap;
}

.phone-country-chevron {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: transform var(--transition), color var(--transition);
}

.phone-country-chevron svg {
    width: 12px;
    height: 8px;
    display: block;
}

.phone-field-group:focus-within .phone-country-chevron,
.phone-country-trigger:hover .phone-country-chevron {
    color: var(--primary);
}

.phone-country-chevron.open {
    transform: rotate(180deg);
}

.phone-country-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: min(100%, 320px);
    z-index: 30;
    padding: 0.45rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 18px;
    box-shadow: 0 24px 48px rgba(13, 27, 42, 0.16);
}

.phone-country-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 0.9rem;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--gray-700);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition), transform 0.2s ease;
}

.phone-country-option:hover,
.phone-country-option:focus-visible {
    outline: none;
    background: rgba(26, 82, 118, 0.08);
    color: var(--primary-dark);
}

.phone-country-option.selected {
    background: linear-gradient(135deg, rgba(26, 82, 118, 0.12), rgba(41, 128, 185, 0.08));
    color: var(--primary-dark);
}

.phone-country-option-main {
    min-width: 0;
    flex: 1;
    display: grid;
    gap: 2px;
}

.phone-country-option-name {
    font-weight: 600;
}

.phone-country-option-meta {
    font-size: 0.82rem;
    color: var(--gray-400);
}

.phone-country-check {
    flex-shrink: 0;
    color: var(--primary);
    font-weight: 700;
}

.custom-select-group {
    position: relative;
    z-index: 1;
}

.custom-select-group:focus-within {
    z-index: 40;
}

/* Lift the open select above the fields below it. :focus-within is unreliable
   on touch (a tap may not keep focus), so drive it from the open state too. */
.custom-select-group.select-open {
    z-index: 50;
}

.custom-select-trigger {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,247,249,0.94));
    color: var(--gray-700);
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(13, 27, 42, 0.04);
    transform: translateY(0);
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition), transform var(--transition);
}

.custom-select-trigger:hover {
    border-color: var(--gray-300);
    background: linear-gradient(180deg, rgba(255,255,255,1), rgba(248,251,253,0.98));
}

.custom-select-trigger:focus-visible,
.custom-select-trigger.is-open {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 12px 28px rgba(26, 82, 118, 0.08), 0 0 0 4px rgba(41, 128, 185, 0.14);
    transform: translateY(-1px);
}

.custom-select-value {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-value.placeholder {
    color: var(--gray-400);
}

.custom-select-chevron {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: transform var(--transition), color var(--transition);
}

.custom-select-chevron svg {
    width: 14px;
    height: 9px;
    display: block;
}

.custom-select-trigger:hover .custom-select-chevron,
.custom-select-trigger:focus-visible .custom-select-chevron,
.custom-select-trigger.is-open .custom-select-chevron {
    color: var(--primary);
}

.custom-select-chevron.open {
    transform: rotate(180deg);
}

.custom-select-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 30;
    padding: 0.45rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 18px;
    box-shadow: 0 24px 48px rgba(13, 27, 42, 0.16);
}

.custom-select-options {
    display: grid;
    gap: 4px;
    max-height: 260px;
    overflow-y: auto;
}

.custom-select-option {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.85rem 0.95rem;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--gray-700);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition), transform 0.2s ease;
}

.custom-select-option:hover,
.custom-select-option:focus-visible {
    outline: none;
    background: rgba(26, 82, 118, 0.08);
    color: var(--primary-dark);
}

.custom-select-option.selected {
    background: linear-gradient(135deg, rgba(26, 82, 118, 0.12), rgba(41, 128, 185, 0.08));
    color: var(--primary-dark);
    font-weight: 600;
}

.custom-select-check {
    flex-shrink: 0;
    color: var(--primary);
    font-weight: 700;
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.85rem;
    background-image:
        linear-gradient(180deg, rgba(255,255,255,0.96), rgba(245,247,249,0.92)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1 1.5L7 7.5L13 1.5' stroke='%23546E7A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat;
    background-position: 0 0, right 1rem center;
    background-size: auto, 14px 9px;
}

.form-group:focus-within {
    transform: translateY(-1px);
}

.form-group:focus-within label {
    color: var(--primary);
    transform: translateX(2px);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    background-color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(26, 82, 118, 0.08), 0 0 0 4px rgba(41, 128, 185, 0.14);
}

.form-group select:focus {
    background-image:
        linear-gradient(180deg, rgba(255,255,255,1), rgba(248,251,253,1)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1 1.5L7 7.5L13 1.5' stroke='%231A5276' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray-300);
}

/* Validation — red border when field has error */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: #ef5350;
    box-shadow: 0 0 0 3px rgba(239, 83, 80, 0.12);
}

.form-group.has-error .phone-field-shell {
    border-color: #ef5350;
    box-shadow: 0 0 0 3px rgba(239, 83, 80, 0.12);
}

.form-group.has-error .custom-select-trigger {
    border-color: #ef5350;
    box-shadow: 0 0 0 3px rgba(239, 83, 80, 0.12);
}

/* Inline error messages */
.field-error {
    font-size: 0.78rem;
    color: #d32f2f;
    margin-top: 4px;
    line-height: 1.3;
}

.form-error-banner {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: var(--space-md);
    font-size: 0.85rem;
    color: #991b1b;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

/* E-mail and phone stack instead of sharing a row — the phone field needs a
   stable width so the 9-digit number never gets squeezed on desktop. */
.contact-form-row {
    grid-template-columns: 1fr;
}

@media (max-width: 560px) {
    .phone-country-panel {
        width: 100%;
    }
}

@media (max-width: 920px) {
    .contact-form-row {
        grid-template-columns: 1fr;
    }
}

.form-checkbox {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-start;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.form-checkbox:hover input[type="checkbox"],
.form-checkbox input[type="checkbox"]:focus-visible {
    transform: scale(1.08);
    box-shadow: 0 0 0 4px rgba(41, 128, 185, 0.12);
}

.form-checkbox label {
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 400;
    cursor: pointer;
    transition: color var(--transition);
}

.form-checkbox:hover label,
.form-checkbox:focus-within label {
    color: var(--gray-700);
}

.reservation-form [type="submit"],
.voucher-form [type="submit"] {
    margin-top: var(--space-md);
}

.reservation-form [type="submit"]:disabled,
.voucher-form [type="submit"]:disabled {
    opacity: 0.6;
    cursor: wait;
}

.form-note {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: var(--space-md);
    line-height: 1.5;
}

/* Confirmation Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-3xl);
    max-width: 480px;
    width: 90%;
    text-align: center;
    transform: translateY(20px);
    transition: transform var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: var(--space-lg);
}

.modal h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--space-md);
}

.modal p {
    font-size: 0.95rem;
    color: var(--gray-500);
    line-height: 1.6;
    margin-bottom: var(--space-lg);
}

.modal .btn {
    min-width: 200px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .calendar-legend {
        flex-wrap: wrap;
    }

    .terms-header {
        gap: var(--space-sm);
        padding-top: var(--space-md);
    }

    .custom-select-panel {
        top: calc(100% + 8px);
        border-radius: 16px;
        box-shadow: 0 18px 36px rgba(13, 27, 42, 0.14);
    }
}

@media (prefers-reduced-motion: reduce) {
    .terms-filter,
    .terms-filter input[type="checkbox"],
    .form-group,
    .form-group label,
    .form-group input,
    .form-group select,
    .form-group textarea,
    .custom-select-trigger,
    .custom-select-chevron,
    .custom-select-option,
    .form-checkbox input[type="checkbox"],
    .form-checkbox label {
        transition: none !important;
        transform: none !important;
    }
}
