@import url('https://fonts.googleapis.com/css2?family=Caveat+Brush&family=Roboto:ital,wght@0,100..900;1,100..900&family=Sansation:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    font-size: 1.2rem;
    font-family: "Sansation", sans-serif;
    font-weight: 400;
    color: #555555;
    background-color: #FBC299;
    font-style: normal;
    scroll-behavior: smooth;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    background: 
        url("../images/boys.png") no-repeat left center,
        url("../images/girls.png") no-repeat right center;
    background-size: 15vw auto;
    background-attachment: fixed; /* keep them fixed on scroll */
}

.inactive-input {
    background-color: #eee;
    cursor: not-allowed;
}

#alerts-tool {
    display: none;
}

#alerts-pad {
    position: fixed;
    width: 100vw;
    height: 100vh;
    background-color: #000000;
    opacity: 0;
    z-index: 9500;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#alerts-pad.show {
    opacity: 0.2;
    pointer-events: auto; /* clickable */
}

#alerts-pad.hide {
    opacity: 0;
    pointer-events: none;
}

.alerts-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 50vw;
    background-color: #FEED89;
    color: #ff0000;
    font-weight: 900;
    z-index: 9999;
    border: 3px outset #ff7777;
    border-radius: 10px;
    padding: 35px;
    opacity: 1;
    transition: none;
}

@keyframes popup-in {
    0% {
        transform: translate(-50%, 100%) scale(0.3);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes popup-out {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, 100%) scale(0.3);
        opacity: 0;
    }
}

.alerts-container.show {
    animation: popup-in 0.3s ease forwards;
}

.alerts-container.hide {
    animation: popup-out 0.3s ease forwards;
}

.lang-container {
    position: fixed;
    top: 0%;
    right: 0%;
    margin: 10px 10px 0 0;
    z-index: 9000;
}

.lang-img {
    width: 40px;
    height: auto;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lang-img:hover {
    transform: scale(1.08);
    -webkit-transform: scale(1.08);
}

.lang-img:active {
    transform: scale(0.95);
    -webkit-transform: scale(0.95);
}

#close-alert {
    position: absolute;
    text-align: center;
    width: 29px;
    top: 0;
    right: 0;
    height: auto;
    padding: 2px;
    margin: 5px;
    color: #ff7777;
    border: 2px solid #ff7777;
    border-radius: 10%;
    font-size: .8rem;
}

#close-alert:hover {
    color: #ffffff;
    border: 2px solid #ffffff;
    background-color: #ff7777;
}

.alerts {
    color: red;
}

input, textarea {
    padding: 5px 10px;
    font-size: 1rem;
    font-family: "Sansation", sans-serif;
    font-weight: 400;
    color: #4F4AEF;
    border-radius: 5px;
    border-style: inset;
}

input {
    height: 40px;
    color: #4F4AEF;
}

textarea {
    resize: none;
    overflow-y: auto;
    overflow-x: hidden;
    white-space: pre-wrap;
    color: #4F4AEF;
}

.para-header {
    margin-bottom: 5px;
}

.page-title {
    font-weight: 900;
    background: linear-gradient(90deg, #531E14, #531E14, #ffffff, #531E14, #531E14);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; /* for WebKit */
    background-clip: text;
    color: transparent; /* fallback */
    animation: gradient-move 5s linear infinite;
}


.title {
    padding-top: 20px;
    font-weight: 900;
    background: linear-gradient(90deg, #531E14, #531E14, #531E14, #ffffff, #531E14);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; /* for WebKit */
    background-clip: text;
    color: transparent; /* fallback */
    animation: gradient-move 5s linear infinite;
}

@keyframes gradient-move {
    0%   { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.error {
    color: red;
    font-size: 0.9em;
    margin-top: 4px;
}

.form-line {
    width: 100%;
    display: flex;
    margin: 20px 0;
    padding: 5px 0;
}

.form-line > * {
    width: 50%;
}

.form-label {
    font-weight: 900;
}

/* RADIO-BLOCK -> to place radio buttons in one line */
#id_gender {
    display: flex;           /* lays out the options in a row */
    gap: 1rem;               /* space between boy/girl */
    flex-wrap: wrap;         /* wrap on small screens */
}

#id_gender > div {
    display: flex;           /* each option container */
    align-items: center;
}

#id_gender label {
    display: flex;           /* keep radio + emoji nicely aligned */
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}

#id_gender input[type="radio"] {
    margin: 0;
}
/* END OF RADIO-BLOCK */

input[type="radio"],
#id_parent_type label,
#no-2nd-guardian-label,
#no-second-guardian,
#id_parent1_type label,
#id_photos_consent label,
#id_tc_accept label,
#id_parent1_type label {
    cursor: pointer;
}

.form-control {
    cursor: pointer;
}

button {
    width: 130px;
    padding: 0.5rem;
    font-family: "Sansation", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #eeeccc;
    border-radius: 5px;
    border-style: outset;
    background-color: #DA7C30;
    cursor: pointer;
}

button:disabled {
    background-color: #ccc;
    color: #666;
    border-style: solid;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-hidden {
    visibility: hidden;
}

#same-addr-container {
    cursor: pointer;
    font-size: .7rem ;
    font-weight: 200;
}

.form-container {
    /* keep your width + horizontal centering */
    width: 100vw;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;      /* prevent page scroll; only middle will scroll */
    align-items: center;  /* don't center the column horizontally */
}

/* Header pinned at the top (already there, just reaffirm) */
.top-div {
    flex: 0 0 auto;
    margin: auto;
    text-align: center;
    width: 100%;
    background-color: #E6B18C;
    border-bottom: 4px outset #EDB791;
    padding: 1.5rem 0.8rem 0.8rem 0.8rem;
}

/* The visible form-part occupies the space between header and footer */
.form-part {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;         /* critical so the inner scroller can size correctly */
    width: 100%;
}

/* Only the middle area scrolls */
.form-content {
    flex: 1 1 auto;
    min-height: 0;         /* critical in flexbox for proper overflow */
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 20%;
    box-sizing: border-box;
    width: 100%;
}

/* Footer pinned to the bottom of the viewport */
.btns-container {
    flex: 0 0 auto;
    width: 100%;
    display: flex;
    justify-content: space-around;
    gap: 5rem;             /* fix '5 rem' typo */
    padding: 1.5rem;
    background-color: #E6B18C;
    border-top: 4px outset #EDB791;
}

/* Show/hide pages without breaking flex layout */
.form-part-shown { 
    display: flex;         /* was 'initial' which cancels the flex container */
}
.form-part-hidden { 
    display: none; 
}

.form-container input[type="text"],
.form-container input[type="email"],
.form-container input[type="number"],
.form-container textarea {
    width: 50%;
    box-sizing: border-box;
}

#id_mobile_number,
#id_work_number,
#id_mobile1_number,
#id_work1_number,
#id_urgent_phone,
#id_pickup_phone {
    width: 100%;
}

#id_allergies_etc {
    width: 100%;
}

.form-container input[type="tel"] {
    width: 100%;
    box-sizing: border-box;
}

.iti {
    width: 100%;
}

#no-allergies-form-line {
    margin-bottom: 0;
}

#no-allergies-label input,
#no-2nd-guardian-label input,
#same-address,
#id_photos_consent_0,
#id_photos_consent_1,
#id_tc_accept_0,
#id_tc_accept_1 {
    height: 15px;
    margin: 0 5px 0 0;
}

#allergies-form-line {
    margin-top: 0;
}

#no-allergies-label {
    cursor: pointer;
}

#type-choices-form-line {
    margin-bottom: 0;
}

#other-type-form-line {
    margin-top: 0;
}

#id_parent_type div label input {
    height: 15px;
    margin: 0 10px 0 0;
}

#id_parent1_type div label input {
    height: 15px;
    margin: 0 10px 0 0;
}

#no-2nd-guardian-label {
    width: 100%;
}

.table-container {
    width: 100%;
    text-align: center;
    padding: 15px 0;
}

#booking-table {
    margin: auto;
    border: 3px solid #555555;
    border-collapse: collapse;
}

#booking-table th,
#booking-table td {
    border: 1px solid #555555;
    padding: 0 10px;
    text-align: center;
}

/* 1) Vertically center Day and Cost headers */
#booking-table th[rowspan] {
    vertical-align: middle;
}

/* 2) Fix equal width for Reservation columns */
#booking-table th:nth-child(2),
#booking-table td:nth-child(2),
#booking-table th:nth-child(3),
#booking-table td:nth-child(3),
#booking-table th:nth-child(4),
#booking-table td:nth-child(4),
#booking-table th:nth-child(5),
#booking-table td:nth-child(5) {
    width: 80px;
}

/* 3) Align sumss (last column) to the right */
#booking-table tr td:last-child {
    text-align: right;
}

#booking-table tr:nth-last-child(3) td:last-child,
#booking-table tr:nth-last-child(2) td:last-child,
#booking-table tr:nth-last-child(1) td:last-child {
    font-weight: 900;
}

.total-cost,
.discount,
.final-cost {
    font-weight: 900;
}

.short-day-cost {
    display: none;
}

.cost-amount {
    color: #ffffff;
    font-weight: 900;
}

@keyframes text-flash {
    0% {
        transform: scale(1);
        -webkit-transform: scale(1);
        filter: blur(0);
        -webkit-filter: blur(0);
        opacity: 1;
    }
    40% {
        transform: scale(1.1);
        -webkit-transform: scale(1.1);
        filter: blur(2px);
        -webkit-filter: blur(2px);
        opacity: 0.5;
    }
    60% {
        transform: scale(1.1);
        -webkit-transform: scale(1.1);
        filter: blur(2px);
        -webkit-filter: blur(2px);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        -webkit-transform: scale(1);
        filter: blur(0);
        -webkit-filter: blur(0);
        opacity: 1;
    }
}

.flash-animate {
    display: inline-block;         /* so transform works nicely */
    animation: text-flash 0.4s ease;
    -webkit-animation: text-flash 0.4s ease;
}

.summary-table,
.summary-book-table {
    margin: auto;
    border: 3px solid #555555;
    border-radius: 5px;
    border-collapse: separate;
    width: 100%;
}

.summary-table th,
.summary-table td,
.summary-book-table th,
.summary-book-table td {
    border: 1px solid #555555;
    padding: 5px 10px;
}

.summary-header {
    display: flex;
    justify-content: center;   /* centers text */
    align-items: center;
    position: relative;
}

.summary-header-text {
    text-align: center;
}

.summary-header-icon {
    position: absolute;
    right: 0.5rem;   /* adjust spacing */
    height: 20px;    /* control size */
    width: auto;
    cursor: pointer;
}

.hint {
    font-size: 0.8rem;
    text-align: center;
    padding-bottom: 10px;
}

.hint img {
    cursor: default;
    width: 15px;
}

.summary-table td:first-child,
.summary-table th:first-child {
    width: 35%;
}

.summary-table td:nth-child(2),
.summary-table th:nth-child(2) {
    width: 65%;
}

.summary-book-table td,
.summary-book-table th {
    width: 15%;
    text-align: center;
}

.summary-book-table td:last-child,
.summary-book-table th:last-child {
    width: 20%;
}

#sum-reserv-tall {
    display: none;
}

.result-content {
    margin: auto;
    display: flex;
    flex-direction: column;
    width: fit-content;
}

.res-header {
    /* margin: auto; */
    padding: 25px 0 20px 0;
}

.res-text {
    /* margin: auto; */
    padding: 10px 0;
}

.summary-section-header {
    color: #FBC299;
    background-color: #531E14;
}

#lottie-loading {
    display: none;
    position: fixed;
    top: 0%;
    left: 0%;
    width: 100vw;
    height: 100vh;
    z-index: 9000;
    justify-content: center;
    align-items: center;
}


/* ---------- RESPONSIVE DESIGN ---------- */

/* Smartphones portrait (up to 600px) */
@media (max-width: 600px) {
    :root {
        font-size: 1rem; /* slightly smaller base font */
    }

    body {
        background: none;
    }

    .alerts-container {
        width: 80vw;
    }

    .form-content {
        padding: 1rem 5%; /* reduce side padding */
    }

    .form-line {
        flex-direction: column; /* stack label + input vertically */
        align-items: flex-start;
    }
    .form-line > * {
        width: 100% !important; /* full width on mobile */
    }

    .form-container input[type="text"],
    .form-container input[type="email"],
    .form-container input[type="number"],
    .form-container input[type="tel"],
    .form-container textarea {
        width: 100% !important;
    }

    .btns-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    .btns-container button {
        width: 100%; /* full-width buttons */
    }

    /* Tables: allow horizontal scroll */
    .table-container,
    .summary-table,
    .summary-book-table {
        overflow-x: auto;
        display: block;
    }

    #booking-table {
        margin: auto;
    }
        
    #booking-table th:nth-child(0),
    #booking-table td:nth-child(0) {
        width: 28%;
    }
    #booking-table th:nth-child(1),
    #booking-table td:nth-child(1),
    #booking-table th:nth-child(2),
    #booking-table td:nth-child(2),
    #booking-table th:nth-child(3),
    #booking-table td:nth-child(3),
    #booking-table th:nth-child(4),
    #booking-table td:nth-child(4) {
        width: 18%;
    }
    .summary-header-icon {
        right: 2px;
    }
    .summary-header {
        padding: 0 27px;
    }
    #sum-reserv-wide {
        display: none;
    }
    #sum-reserv-tall {
        display: table;
    }

    .lang-container {
        margin: 5px;
    }
    .lang-img {
        width: 25px;
    }
}

/* Smartphones landscape (~600–900px) */
@media (min-width: 601px) and (max-width: 900px) {
    body {
        background: none;
    }
    
    .alerts-container {
        width: 65vw;
    }
    
    .form-content {
        padding: 1rem 5%;
    }

    .form-line {
        flex-direction: column;
    }
    .form-line > * {
        width: 100% !important;
    }

    .btns-container {
        gap: 2rem;
    }
    .btns-container button {
        flex: 1;
    }

    .table-container,
    .summary-table,
    .summary-book-table {
        overflow-x: auto;
        display: block;
    }
    table {
        min-width: 700px;
    }
    #sum-reserv-wide {
        display: none;
    }
    #sum-reserv-tall {
        display: table;
    }
}

/* Tablets (portrait & landscape, 901px–1100px) */
@media (min-width: 901px) and (max-width: 1100px) {
    .alerts-container {
        width: 60vw;
    }
    .form-content {
        padding: 1rem 15%;
    }
    .btns-container {
        gap: 2rem;
    }
    #sum-reserv-wide {
        display: none;
    }
    #sum-reserv-tall {
        display: table;
    }
}