/* responsive.css - Responsive breakpoints: 1024px, 768px, 480px, 360px, landscape, touch */

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

/* ===== TABLET (up to 1024px) ===== */
@media (max-width: 1024px) {
    .header {
        width: min(97vw, 50rem);
    }

    .header__content-block {
        width: min(96vw, 41rem);
    }

    .layout-container {
        width: min(96vw, 41rem);
    }

    /* Calendar scaling for tablets */
    .calendar-scale-inner {
        width: 100% !important;
        max-width: min(100%, calc(100vw - 2rem));
    }

    .calendar-title .cal-month {
        font-size: clamp(3.2rem, 9vw, 5.3rem);
    }

    .calendar-title .cal-selected-day {
        font-size: clamp(1.1rem, 3.2vw, 1.45rem);
    }

    .calendar-nav-btn {
        width: clamp(2.8rem, 7vw, 3.5rem);
        height: clamp(2.8rem, 7vw, 3.5rem);
        font-size: clamp(1.2rem, 3.2vw, 1.55rem);
    }

    .slot-btn {
        height: clamp(4.5rem, 12vw, 6rem);
        padding: 0.8rem 1.2rem;
        font-size: clamp(0.95rem, 2.6vw, 1.1rem);
    }
}

/* ===== TABLET PORTRAIT & LARGE PHONES (up to 768px) ===== */
@media (max-width: 768px) {
    .header {
        width: 100%;
        padding: clamp(1rem, 3vw, 1.8rem) clamp(0.8rem, 2vw, 1.2rem) clamp(1.5rem, 3.5vw, 2.2rem);
    }

    .header__title {
        font-size: clamp(1.1rem, 4.5vw, 1.8rem);
        text-align: center;
    }

    .header__subtitle {
        font-size: clamp(1.6rem, 8.5vw, 3.6rem);
        margin-bottom: 1.4rem;
        text-align: center;
    }

    .header__description {
        width: 100%;
        padding: 0 clamp(0.5rem, 2vw, 1rem);
    }

    .header__description span {
        white-space: normal;
        text-wrap: balance;
    }

    .header__content-block {
        width: 100%;
        padding: 0 clamp(0.6rem, 2.5vw, 1.2rem);
        margin: 3rem auto 2rem;
    }

    .header__content-header {
        font-size: clamp(1.2rem, 4.5vw, 1.6rem);
        margin: 3rem 0 1.5rem;
        text-align: center;
    }

    .header__content-subheader {
        font-size: clamp(1rem, 3.2vw, 1.2rem);
        margin: 1.5rem 0 0.6rem;
        text-align: left;
    }


    .layout-container {
        width: 100%;
        padding: 0 clamp(0.6rem, 2.5vw, 1.2rem);
    }

    /* Calendar scaling for mobile */
    .calendar-scale-wrapper {
        width: 100%;
        overflow: visible;
    }

    .calendar-scale-inner {
        width: 100% !important;
        max-width: min(100%, calc(100vw - 2rem));
        transform: none !important;
        transform-origin: top left;
    }

    /* Calendar */
    .calendar-wrapper {
        padding: clamp(1.2rem, 4vw, 2rem);
        border-radius: 1.2rem;
        min-height: clamp(30rem, 70vh, 44rem);
    }

    .calendar-header {
        margin-bottom: 1.5rem;
        padding: 0 clamp(0.3rem, 2vw, 0.6rem);
    }

    .calendar-title {
        font-size: clamp(1.4rem, 4.5vw, 2rem);
    }

    .calendar-title .cal-month {
        font-size: clamp(2.6rem, 8vw, 4.2rem);
        text-align: center;
    }

    .calendar-title .cal-selected-day {
        font-size: clamp(0.95rem, 3vw, 1.25rem);
    }

    .calendar-grid {
        gap: 0.45rem;
        min-height: clamp(16rem, 35vh, 22rem);
    }

    .cal-day {
        font-size: clamp(0.85rem, 2.8vw, 1.1rem);
        border-radius: 0.5rem;
        -webkit-appearance: none;
        appearance: none;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        isolation: isolate;
    }

    .cal-day-name {
        font-size: clamp(0.7rem, 2.2vw, 0.85rem);
        margin-bottom: 0.6rem;
    }

    .slots-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .slot-btn {
        height: auto;
        min-height: 4rem;
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }

    /* Section titles */
    #calendarHeaderTitle,
    #servicesSectionTitle,
    #faqSectionTitle {
        font-size: clamp(1.8rem, 7vw, 2.8rem) !important;
    }

    .section-title {
        font-size: clamp(1.2rem, 4.5vw, 1.6rem);
        margin: 3.5rem 0 1.8rem;
        text-align: center;
    }

    /* FAQ */
    #faqSpoiler .faq__question {
        max-width: min(92%, 36rem);
        font-size: clamp(0.92rem, 2.6vw, 1.05rem);
        padding: 0.65rem 0.85rem 0.68rem;
    }

    #faqSpoiler .faq__answer,
    #faqSpoiler .faq__item.is-open .faq__answer {
        max-width: min(92%, 36rem);
        padding: 0.72rem 0.85rem 0.76rem;
        /* TODO-DELETE if stable after test: font-size: 1rem !important */
    }

    /* Footer */
    .footer {
        padding: 3.5rem 1rem 1rem;
    }

    .footer__contact-link {
        font-size: clamp(1.2rem, 4.5vw, 1.6rem);
    }

    .footer__official-meta {
        margin-top: 5rem;
        font-size: 0.75rem;
    }



    /* Book button */
    .book-btn-container {
        height: 9rem;
        margin: 1.8rem auto;
    }

    .book-btn-container--footer {
        min-height: 9rem;
    }

    .footer-book-btn {
        min-width: 12rem;
        font-size: 0.85rem;
        padding: 0.65rem 1.6rem;
    }

    /* Modal */
    .modal--active {
        padding-top: 2vh;
        padding-bottom: 2vh;
    }

    .modal__content {
        padding: 1.8rem 1.2rem;
        border-radius: 1.2rem;
        max-width: 100%;
    }

    .modal__close {
        top: 1rem;
        left: 1rem;
    }

    #bookingModal .modal__content {
        padding: 1.5rem 1rem 1.2rem;
    }

    /* Booking form inputs */
    #bookingModal .booking-row--deadline {
        grid-template-columns: max-content minmax(120px, 180px) max-content;
    }

    #bookingModal #deadlineInputMain {
        width: 100% !important;
        min-width: 120px !important;
        max-width: 180px !important;
    }



    /* Privacy note */
    .privacy-note {
        line-height: 1.5;
    }
}

/* ===== MOBILE PHONES (up to 480px) ===== */
@media (max-width: 480px) {
    html {
        font-size: 15px;
    }

    .header {
        padding: clamp(0.75rem, 2.8vw, 1.2rem) clamp(0.65rem, 2vw, 1rem) clamp(1.2rem, 3.5vw, 1.8rem);
    }

    .header__title {
        font-size: clamp(1rem, 4.2vw, 1.5rem);
        letter-spacing: 1.5px;
        text-align: center;
    }

    .header__subtitle {
        font-size: clamp(1.4rem, 8vw, 2.8rem);
        margin-bottom: 1.2rem;
        letter-spacing: -1px;
        text-align: center;
    }

    .header__description {
        font-size: 10.5pt;
        margin-bottom: 1.8rem;
        line-height: 1;
    }

    .header__description span {
        white-space: normal;
        text-wrap: balance;
        margin: 0.3rem 0 0;
    }

    .header__content-block {
        margin: 2.5rem auto 2rem;
    }

    .header__content-header {
        font-size: clamp(1.2rem, 4.5vw, 1.5rem);
        margin: 2.2rem 0 1.4rem;
        letter-spacing: 1.5px;
        text-align: center;
    }

    .header__content-subheader {
        font-size: clamp(1rem, 3.2vw, 1.2rem);
        text-align: left;
    }


    /* Calendar scaling for small mobile phones */
    .calendar-scale-wrapper {
        width: 100%;
        overflow: visible;
    }

    .calendar-scale-inner {
        width: 100% !important;
        max-width: min(100%, calc(100vw - 1.5rem));
        transform: none !important;
        transform-origin: top left;
    }

    /* Calendar */
    .calendar-wrapper {
        padding: clamp(0.95rem, 3.5vw, 1.5rem);
        border-radius: 1rem;
        min-height: clamp(28rem, 60vh, 38rem);
    }

    .calendar-header {
        margin-bottom: 1.2rem;
        padding: 0 clamp(0.2rem, 1.5vw, 0.4rem);
    }

    .calendar-title .cal-month {
        font-size: clamp(2rem, 7.5vw, 3.5rem);
        text-align: center;
    }

    .calendar-title .cal-selected-day {
        font-size: clamp(0.85rem, 2.8vw, 1.1rem);
    }

    .calendar-nav-btn {
        width: 3rem;
        height: 3rem;
        min-width: 44px;
        min-height: 44px;
        font-size: 1.2rem;
        border-radius: 0.6rem;
    }

    .calendar-grid {
        gap: 0.32rem;
    }

    .cal-day {
        font-size: clamp(0.78rem, 3vw, 0.95rem);
        border-radius: 0.4rem;
    }

    .cal-day-name {
        font-size: clamp(0.6rem, 2.2vw, 0.75rem);
        letter-spacing: 0.5px;
        margin-bottom: 0.45rem;
    }

    .slots-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .slot-btn {
        min-height: 4.5rem;
        padding: 0.85rem 1rem;
        font-size: 0.98rem;
        gap: 0.7rem;
        border-radius: 0.6rem;
    }

    .slots-nav {
        font-size: clamp(1rem, 3.5vw, 1.2rem);
    }

    /* Section titles */
    #calendarHeaderTitle,
    #servicesSectionTitle,
    #faqSectionTitle {
        font-size: clamp(1.5rem, 6.5vw, 2.2rem) !important;
        text-align: center;
    }

    .contact-form__outside-title {
        font-size: clamp(2rem, 8.5vw, 2.8rem);
        margin-bottom: 1.5rem;
        text-align: center;
    }

    /* FAQ */
    #faqSpoiler .faq__question {
        max-width: 96%;
        font-size: clamp(0.95rem, 3vw, 1.1rem);
        padding: 0.7rem 0.85rem 0.75rem;
        border-radius: 0.85rem 0.85rem 0.18rem 0.85rem;
    }

    #faqSpoiler .faq__answer,
    #faqSpoiler .faq__item.is-open .faq__answer {
        max-width: 94%;
        padding: 0.75rem 0.85rem 0.8rem;
        /* TODO-DELETE if stable after test: font-size: 0.98rem !important */
        /* TODO-DELETE if stable after test: line-height: 1.6 !important */
        border-radius: 0.85rem 0.85rem 0.85rem 0.18rem;
    }

    .map-container {
        height: clamp(14rem, 45vw, 22rem);
        border-radius: 0.6rem;
    }

    /* Footer */
    .footer {
        padding: 3.5rem 1.2rem 1.2rem;
    }

    .footer__container {
        margin-bottom: 2.5rem;
    }

    .footer__contact-link {
        font-size: clamp(1.1rem, 4.5vw, 1.5rem);
        margin: 1.8rem 0 0.6rem;
    }


    .footer__official-meta {
        margin-top: 4.5rem;
        font-size: 0.85rem;
    }


    /* Book button */
    .book-btn-container {
        height: 8rem;
        margin: 1.4rem auto;
    }

    .book-btn-container--footer {
        min-height: 7.5rem;
    }

    .footer-book-btn {
        min-width: 11rem;
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
        min-height: 44px;
    }

    #headerBookBtn {
        padding: 0.7rem 1.7rem;
        min-height: 3rem;
    }

    .book-btn-wrapper {
        margin-bottom: clamp(1rem, 4vw, 2rem);
    }

    /* Modal */
    .modal {
        padding: 0.3rem;
    }

    .modal--active {
        padding-top: 1vh;
        padding-bottom: 1vh;
    }

    .modal__content {
        padding: 1.5rem 0.95rem;
        border-radius: 1rem;
    }

    .modal__close {
        top: 0.8rem;
        left: 0.8rem;
        width: 2.2rem;
        height: 2.2rem;
        min-width: 44px;
        min-height: 44px;
        font-size: 1.25rem;
    }

    .modal__title {
        font-size: clamp(0.95rem, 3.5vw, 1.2rem);
    }

    #bookingModal .modal__content {
        padding: 1.2rem 0.75rem 1rem;
    }

    #bookingModal.booking-modal--flat.modal--active,
    #bookingModal.booking-modal--flat[data-state="form"].modal--active {
        padding-top: clamp(0.5rem, 2vh, 1.2rem) !important;
        padding-bottom: clamp(0.5rem, 2vh, 1.2rem) !important;
    }

    /* Booking form inputs */
    #bookingModal .contact-form__input,
    #bookingModal .contact-form__textarea,
    #bookingModal .custom-select__trigger {
        font-size: 1rem !important;
    }

    #bookingModal .booking-row--deadline {
        grid-template-columns: 1fr;
        justify-items: center;
        row-gap: 0.5rem;
    }

    #bookingModal #deadlineInputMain {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    #bookingModal .custom-select-wrapper--province {
        flex: 0 0 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    #bookingModal .booking-row--province-zip input[name="address_zip"] {
        flex: 0 0 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    #bookingModal .booking-row--province-zip {
        flex-direction: column !important;
        gap: 10px !important;
    }

    #bookingModal .booking-row--address-city {
        flex-direction: column !important;
        gap: 10px !important;
    }

    #bookingModal .booking-row--address-main {
        flex-direction: column !important;
        gap: 10px !important;
    }

    #bookingModal .booking-row--address-main input[name="address_unit"] {
        width: 100% !important;
    }



    /* File attach */
    .file-attach__btn--camera {
        width: 4.5rem;
        min-width: 4.5rem;
        height: 4.5rem;
        min-height: 4.5rem;
    }

    .camera-capture__panel {
        width: min(35rem, 98vw);
        padding: 0.7rem;
    }

    .camera-capture__actions {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    /* Privacy note */
    .privacy-note {
        line-height: 1.45;
        text-wrap: balance;
    }

    .footer__privacy-note-block .privacy-note {
        font-size: clamp(0.82rem, 2.4vw, 0.95rem);
    }

    .footer__privacy-note-block {
        padding: 0 0.5rem;
    }

    /* Post success screen */
    .post-success-screen__brand {
        font-size: clamp(1.4rem, 6vw, 3rem);
    }

    .post-success-screen__brand-sub {
        font-size: clamp(0.85rem, 3vw, 1.4rem);
    }

    .post-success-screen__phone {
        font-size: clamp(1.2rem, 5.5vw, 2.2rem);
    }

    /* Form calendar overlay */
    .form-calendar-overlay__panel {
        padding: clamp(0.25rem, 0.8vh, 0.45rem) clamp(0.2rem, 1.2vw, 0.5rem) clamp(0.3rem, 0.9vh, 0.5rem);
    }

    /* Quick slots */
    .form-quick-slots__item {
        padding: 0.62rem 0.7rem;
    }

    .form-quick-slots__item-date {
        font-size: 0.82rem;
    }

    .form-quick-slots__item-time {
        font-size: 0.9rem;
    }
}

/* ===== SMALL PHONES (up to 360px) ===== */
@media (max-width: 360px) {
    html {
        font-size: 15px;
    }

    .header__title {
        font-size: clamp(0.95rem, 4.2vw, 1.3rem);
        letter-spacing: 1px;
        text-align: center;
    }

    .header__subtitle {
        font-size: clamp(1.3rem, 8vw, 2.4rem);
        letter-spacing: -0.5px;
        text-align: center;
    }

    .header__description {
        font-size: 10.5pt;
    }


    /* Calendar scaling for very small phones */
    .calendar-scale-inner {
        width: 100% !important;
        max-width: min(100%, calc(100vw - 1rem));
        transform: none !important;
    }

    .calendar-wrapper {
        padding: 0.8rem;
        min-height: clamp(26rem, 50vh, 32rem);
    }

    .calendar-title .cal-month {
        font-size: clamp(1.8rem, 7.5vw, 3rem);
        text-align: center;
    }

    .calendar-nav-btn {
        width: 2.2rem;
        height: 2.2rem;
        font-size: 0.95rem;
    }

    .cal-day {
        font-size: 0.72rem;
    }

    .cal-day-name {
        font-size: 0.55rem;
    }

    #calendarHeaderTitle,
    #servicesSectionTitle,
    #faqSectionTitle {
        font-size: clamp(1.2rem, 6vw, 1.8rem) !important;
        text-align: center;
    }

    #faqSpoiler .faq__question {
        font-size: 0.9rem;
        padding: 0.6rem 0.75rem;
    }

    #faqSpoiler .faq__answer,
    #faqSpoiler .faq__item.is-open .faq__answer {
        /* TODO-DELETE if stable after test: font-size: 0.92rem !important */
        padding: 0.6rem 0.75rem;
    }

    .footer-book-btn {
        min-width: 9rem;
        padding: 0.65rem 1.3rem;
        font-size: 0.85rem;
        min-height: 44px;
    }

    .modal__content {
        padding: 1.2rem 0.75rem;
    }

    #bookingModal .modal__content {
        padding: 1.1rem 0.75rem 1rem;
    }

    .modal__close {
        width: 1.7rem;
        height: 1.7rem;
        top: 0.6rem;
        left: 0.6rem;
    }

    .privacy-note {
        font-size: clamp(0.65rem, 2vw, 0.8rem);
    }
}

/* ===== LANDSCAPE MOBILE (max-height 480px AND landscape) ===== */
@media (max-height: 480px) and (orientation: landscape) {
    .modal--active {
        padding-top: 0.5vh;
        padding-bottom: 0.5vh;
    }

    .modal__content {
        max-height: 96vh;
    }

    #bookingModal .modal__content {
        max-height: 96vh;
        max-height: 96dvh;
    }

    .book-btn-container {
        height: 6rem;
    }

    .book-btn-container--footer {
        min-height: 6rem;
    }
}

/* ===== TOUCH DEVICE IMPROVEMENTS ===== */
@media (hover: none) and (pointer: coarse) {

    .footer-book-btn,
    .contact-form__submit-button,
    .calendar-nav-btn,
    .slot-btn,
    .file-attach__btn,
    .custom-select__trigger,
    .custom-option {
        -webkit-tap-highlight-color: rgba(139, 111, 90, 0.15);
    }


    .custom-option {
        padding: 0.9rem 1.6rem;
    }

    .cal-day:hover:not(.cal-day--empty):not(.cal-day--disabled) {
        transform: none;
        box-shadow: none;
    }

    #faqSpoiler .faq__question:hover {
        border-color: var(--faq-bubble-border-strong);
        background: var(--faq-bubble-q-bg);
        box-shadow: var(--faq-bubble-shadow-strong);
    }

    #faqSpoiler .faq__answer:hover,
    #faqSpoiler .faq__item.is-open .faq__answer:hover {
        border-color: var(--faq-bubble-border-soft);
        background: var(--faq-bubble-a-bg);
        box-shadow: var(--faq-bubble-shadow-soft);
    }

    .slot-btn:hover {
        transform: none !important;
    }

}

/* Modal Specific Input Styles */
.modal .contact-form__input,
.modal .contact-form__textarea {
    text-align: left;
    /* Left align on all devices */
}

.modal .contact-form__input::placeholder,
.modal .contact-form__textarea::placeholder {
    font-size: 0.8rem;
    opacity: 0.7;
    text-align: left;
}

/* File Attachment Styles */
.file-attach {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 0.3rem;
    width: 100%;
}

.file-attach__controls {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.7rem;
    align-items: stretch;
}

.file-attach__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: 0.8rem;
    color: #5a3d2a;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.3;
    text-align: center;
}

.file-attach__btn:not(.file-attach__btn--camera) .file-attach__title,
.file-attach__btn:not(.file-attach__btn--camera) .file-attach__icon,
.file-attach__btn:not(.file-attach__btn--camera) .file-attach__icon-svg,
.file-attach__btn:not(.file-attach__btn--camera):hover .file-attach__title,
.file-attach__btn:not(.file-attach__btn--camera):hover .file-attach__icon,
.file-attach__btn:not(.file-attach__btn--camera):hover .file-attach__icon-svg,
.file-attach__btn:not(.file-attach__btn--camera):focus-visible .file-attach__title,
.file-attach__btn:not(.file-attach__btn--camera):focus-visible .file-attach__icon,
.file-attach__btn:not(.file-attach__btn--camera):focus-visible .file-attach__icon-svg {
    color: #5a3d2a !important;
    stroke: #5a3d2a !important;
}

.file-attach__btn:not(.file-attach__btn--camera):hover,
.file-attach__btn:not(.file-attach__btn--camera):focus-visible {
    background: rgba(90, 61, 42, 0.05) !important;
    color: #5a3d2a !important;
}

.file-attach__btn--camera {
    border: none;
    background: transparent;
    color: #5a3d2a;
    width: 5.25rem;
    min-width: 5.25rem;
    height: 5.25rem;
    min-height: 5.25rem;
    padding: 0.5rem;
    gap: 0.2rem;
    flex-direction: column;
}

.file-attach__btn--camera .file-attach__title {
    font-size: 0;
    letter-spacing: 0;
    text-transform: none;
    gap: 0;
    margin: 0;
    line-height: 1;
}

.file-attach__btn--camera .file-attach__icon {
    font-size: 2rem;
}

.file-attach__btn--camera .file-attach__icon-svg,
.file-attach__icon-svg--camera {
    width: 1.85em !important;
    height: 1.85em !important;
    animation: none !important;
}

.file-attach__btn--camera .file-attach__icon-svg,
.file-attach__btn--camera .file-attach__icon-svg--camera {
    color: #5a3d2a !important;
    stroke: #5a3d2a !important;
}

.file-attach__btn--camera:hover .file-attach__icon-svg,
.file-attach__btn--camera:hover .file-attach__icon-svg--camera,
.file-attach__btn--camera:focus-visible .file-attach__icon-svg,
.file-attach__btn--camera:focus-visible .file-attach__icon-svg--camera {
    color: #5a3d2a !important;
    stroke: #5a3d2a !important;
}

.file-attach__btn--camera:hover,
.file-attach__btn--camera:focus-visible {
    background: rgba(90, 61, 42, 0.05) !important;
    border-color: transparent !important;
    color: #5a3d2a !important;
}

.file-attach__btn:hover,
.file-attach__btn:focus-visible {
    background: rgba(90, 61, 42, 0.05);
    border-color: transparent;
    color: #5a3d2a;
    box-shadow: none;
}



.file-attach__drop-zone-file--drag-over {
    background: #ffffff !important;
    border-color: #5a3d2a !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55), 0 6px 20px rgba(255, 255, 255, 0.22) !important;
}

.file-attach.file-attach--drag-over .file-attach__drop-zone-file {
    background: #ffffff !important;
    border-color: #5a3d2a !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55), 0 6px 20px rgba(255, 255, 255, 0.22) !important;
}

.file-attach__drop-zone-file--drag-over .file-attach__btn {
    background: rgba(90, 61, 42, 0.05) !important;
    border-color: transparent !important;
    color: #5a3d2a !important;
    box-shadow: none !important;
}

.file-attach.file-attach--drag-over .file-attach__drop-zone-file .file-attach__btn {
    background: rgba(90, 61, 42, 0.05) !important;
    border-color: transparent !important;
    color: #5a3d2a !important;
    box-shadow: none !important;
}

.file-attach__drop-zone-file--drag-over .file-attach__title,
.file-attach__drop-zone-file--drag-over .file-attach__icon,
.file-attach__drop-zone-file--drag-over .file-attach__icon-svg,
.file-attach__drop-zone-file--drag-over p {
    color: #5a3d2a !important;
    stroke: #5a3d2a !important;
}

.file-attach.file-attach--drag-over .file-attach__drop-zone-file .file-attach__title,
.file-attach.file-attach--drag-over .file-attach__drop-zone-file .file-attach__icon,
.file-attach.file-attach--drag-over .file-attach__drop-zone-file .file-attach__icon-svg,
.file-attach.file-attach--drag-over .file-attach__drop-zone-file p {
    color: #5a3d2a !important;
    stroke: #5a3d2a !important;
}

.file-attach__title {
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: none;
    line-height: 1.15;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

/* Paperclip Attention Animation */
@keyframes paperclipAttention {

    0%,
    90%,
    100% {
        transform: rotate(0deg) scale(1);
    }

    92% {
        transform: rotate(5deg) scale(1.05);
    }

    94% {
        transform: rotate(-5deg) scale(1.05);
    }

    96% {
        transform: rotate(5deg) scale(1.05);
    }

    98% {
        transform: rotate(-2deg) scale(1.02);
    }
}

.file-attach__icon-svg {
    display: inline-block;
    transform-origin: center center;
    animation: paperclipAttention 8s infinite ease-in-out;
    width: 1.1em !important;
    height: 1.1em !important;
}

.file-attach__icon-svg--paperclip {
    width: 1.42em !important;
    height: 1.42em !important;
    animation: none !important;
}

.file-attach__icon {
    font-size: 1rem;
    line-height: 1;
    display: flex;
}

.file-attach__terms {
    margin-top: 0.1rem;
    margin-bottom: 0.3rem;
}

.file-attach__list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-attach__list:empty {
    display: none;
}

.file-attach__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.6rem 0.9rem 0.88rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    overflow: hidden;
    text-align: left;
}

.file-attach__summary {
    display: grid;
    grid-template-columns: 0.92rem minmax(0, 1fr);
    align-items: center;
    align-content: center;
    justify-content: start;
    justify-items: start;
    column-gap: 0.52rem;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    padding-right: 0.7rem;
    text-align: left;
}

.file-attach__name {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: none;
    justify-self: start;
    align-self: center;
    margin: 0;
    text-align: left;
    line-height: 1.25;
}

.file-attach__check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.92rem;
    height: 0.92rem;
    flex: 0 0 0.92rem;
    position: relative;
    align-self: center;
    justify-self: start;
    color: #a8ef72;
    opacity: 0;
    transform: scale(0.84);
    filter: drop-shadow(0 0 0 rgba(168, 239, 114, 0));
    transition: opacity 0.24s ease, transform 0.24s ease, filter 0.26s ease;
}

.file-attach__check::before {
    content: "";
    display: block;
    width: 0.34rem;
    height: 0.64rem;
    border-right: 0.11rem solid currentColor;
    border-bottom: 0.11rem solid currentColor;
    transform: rotate(45deg) translate(-4%, -6%);
    transform-origin: center;
    box-sizing: border-box;
}

.file-attach__item[data-upload-visual-complete="true"] .file-attach__check,
.file-attach__item[data-temp-synced="true"] .file-attach__check {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 0.45rem rgba(168, 239, 114, 0.38));
}

.file-attach__item[data-upload-sync-state="failed"] .file-attach__check {
    color: #ff7070;
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 0.38rem rgba(255, 112, 112, 0.4));
    cursor: help;
}

.file-attach__item[data-upload-sync-state="failed"] .file-attach__check::before {
    width: 0.74rem;
    height: 0.74rem;
    border: 0.09rem solid currentColor;
    border-radius: 50%;
    transform: none;
    background: linear-gradient(-45deg,
            transparent calc(50% - 0.045rem),
            currentColor calc(50% - 0.045rem),
            currentColor calc(50% + 0.045rem),
            transparent calc(50% + 0.045rem));
}

.file-attach__item[data-upload-visual-bounce="true"] {
    animation: fileAttachItemHop 0.72s cubic-bezier(0.22, 1, 0.36, 1);
}

.file-attach__item[data-upload-visual-bounce="true"] .file-attach__check {
    animation: fileAttachCheckPop 0.58s cubic-bezier(0.2, 0.9, 0.2, 1);
}

@keyframes fileAttachItemHop {
    0% {
        transform: translateY(0);
    }

    28% {
        transform: translateY(-0.28rem);
    }

    58% {
        transform: translateY(0.06rem);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes fileAttachCheckPop {
    0% {
        opacity: 0;
        transform: translateY(0.16rem) scale(0.56);
        filter: drop-shadow(0 0 0 rgba(168, 239, 114, 0));
    }

    56% {
        opacity: 1;
        transform: translateY(-0.12rem) scale(1.22);
        filter: drop-shadow(0 0 0.72rem rgba(168, 239, 114, 0.5));
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 0 0.45rem rgba(168, 239, 114, 0.38));
    }
}

.file-attach__remove {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 0.3rem;
    transition: color 0.3s;
}

.file-attach__remove:hover {
    color: #ff6b6b;
}

.file-attach__progress {
    --file-progress-scale: 0;
    --file-progress-opacity: 0;
    --file-progress-transition-ms: 320ms;
    --file-progress-sheen-duration-ms: 1350ms;
    --file-progress-sheen-delay-ms: 0ms;
    --file-progress-complete-duration-ms: 320ms;
    --file-progress-complete-from: 0.84;
    position: absolute;
    left: 0.9rem;
    right: 0.9rem;
    bottom: 0.34rem;
    height: 0.22rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.24s ease, background-color 0.28s ease;
}

.file-attach__progress[data-progress-state="loading"],
.file-attach__progress[data-progress-state="complete"] {
    opacity: 1;
}

.file-attach__progress::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.36) 0%,
            rgba(255, 255, 255, 0.9) 24%,
            rgba(255, 255, 255, 1) 52%,
            rgba(255, 255, 255, 0.92) 74%,
            rgba(255, 255, 255, 0.44) 100%);
    background-size: 200% 100%;
    background-position: 0% 50%;
    box-shadow: 0 0 0.55rem rgba(255, 255, 255, 0.24);
    opacity: var(--file-progress-opacity);
    transform: scaleX(var(--file-progress-scale));
    transform-origin: left center;
    transition:
        transform var(--file-progress-transition-ms) cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.26s ease;
    will-change: transform, opacity, background-position;
}

.file-attach__progress[data-progress-state="loading"]::before {
    animation-name: fileAttachProgressSheen;
    animation-duration: var(--file-progress-sheen-duration-ms);
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-delay: var(--file-progress-sheen-delay-ms);
}

.file-attach__progress[data-progress-state="complete"] {
    background: rgba(132, 104, 82, 0.18);
}

.file-attach__progress[data-progress-state="complete"]::before {
    background-position: 100% 50%;
    animation-name: fileAttachProgressComplete;
    animation-duration: var(--file-progress-complete-duration-ms);
    animation-timing-function: cubic-bezier(0.2, 0.9, 0.2, 1);
    animation-fill-mode: forwards;
}

@keyframes fileAttachProgressSheen {
    from {
        background-position: 0% 50%;
    }

    to {
        background-position: 200% 50%;
    }
}

@keyframes fileAttachProgressComplete {
    0% {
        opacity: 0.9;
        transform: scaleX(var(--file-progress-complete-from));
        filter: brightness(1);
    }

    68% {
        opacity: 1;
        transform: scaleX(1);
        filter: brightness(1.08);
    }

    100% {
        opacity: 0;
        transform: scaleX(1);
        filter: brightness(1.14);
    }
}

@media (prefers-reduced-motion: reduce) {
    .file-attach__item[data-upload-visual-bounce="true"],
    .file-attach__item[data-upload-visual-bounce="true"] .file-attach__check {
        animation: none;
    }

    .file-attach__progress[data-progress-state="loading"]::before {
        animation: none;
    }

    .file-attach__progress[data-progress-state="complete"]::before {
        animation-duration: 0.24s;
    }
}
