/* SF Calendar Styles */

:root {
    --sf-calendar-color: #0073aa;
    --sf-calendar-color-dark: #005a87;
    --sf-calendar-color-light: #b3d9e6;
}

/* Open calendar button (when admin enables modal-button mode) */
.sf-open-calendar-btn {
    background: var(--sf-btn-bg, var(--sf-calendar-color)) !important;
    color: var(--sf-btn-color, #fff) !important;
    border: none !important;
    padding: var(--sf-btn-padding, 14px 28px) !important;
    border-radius: var(--sf-btn-radius, 8px) !important;
    cursor: pointer !important;
    font-size: var(--sf-btn-font-size, 16px) !important;
    font-weight: 600 !important;
    transition: opacity 0.2s ease !important;
    display: inline-block !important;
}

.sf-open-calendar-btn:hover {
    opacity: 0.88 !important;
}

.sf-calendar-opener {
    text-align: center;
    margin: 20px 0;
}

/* Container kalendarza */
#sf-calendar-container {
    display: block;
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    font-family: Arial, sans-serif;
    width: 100%;
}

#sf-calendar-main-modal #sf-calendar-container {
    padding: 0;
}

.sf-calendar-wrapper {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    width: 100%;
}

/* Header kalendarza */
.sf-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sf-calendar-month-year {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.sf-calendar-nav {
    background: var(--sf-calendar-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.4s ease-in-out;
}

.sf-calendar-nav:hover {
    background: var(--sf-calendar-color-dark);
}

/* Dni tygodnia */
.sf-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.sf-calendar-weekday {
    text-align: center;
    font-weight: bold;
    color: #666;
    padding: 5px;
    font-size: 12px;
}

/* Dni kalendarza */
.sf-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 1fr;
    gap: 5px;
}

.sf-calendar-day {
    background: #e0e0e0;
    border: 2px solid #ccc;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    box-sizing: border-box;
    aspect-ratio: 1;
    min-height: 40px;
    transition: all 0.4s ease-in-out;
}

.sf-calendar-day-number {
    font-size: 13px;
    line-height: 1;
    color: #333;
    font-weight: normal;
    pointer-events: none;
    padding: 0 1px 1px 0;
    transition: all 0.4s ease-in-out;
}

.sf-calendar-day:hover {
    background: var(--sf-calendar-hover-bg, var(--sf-calendar-color-light));
    border-color: var(--sf-calendar-color);
    transform: scale(1.1);
}

.sf-calendar-day:hover .sf-calendar-day-number {
    font-weight: bolder;
    color: white;
}

.sf-calendar-day.past {
    background: #f0f0f0;
    cursor: not-allowed;
    opacity: 0.5;
}

.sf-calendar-day.past:hover {
    background: #f0f0f0;
    transform: none;
}

.sf-calendar-day.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.sf-calendar-day.empty:hover {
    background: transparent;
    transform: none;
}

.sf-calendar-day.today {
    border: 2px solid var(--sf-calendar-color);
}

/* Modale */
.sf-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.sf-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sf-modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #fefefe;
    margin: auto;
    padding: 10px 30px 30px 30px;
    border: 1px solid #888;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.sf-modal-close-container {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.sf-modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 4.55px 12px;
}

.sf-modal-close:hover,
.sf-modal-close:focus {
    color: #000;
}

.sf-modal-content h3 {
    font-size: 20px;
    font-weight: bold;
    width: 100%;
    margin: 0;
    color: #333;
}

.sf-modal-content h3.sf-selected-treatment,
.sf-modal-content h3.sf-selected-date,
.sf-modal-content h3.sf-booking-treatment,
.sf-modal-content h3.sf-booking-date {
    font-size: 18px;
    font-weight: normal;
}

.sf-selected-treatment span,
.sf-selected-date span,
.sf-booking-treatment span,
.sf-booking-date span {
    font-size: 18px;
    font-weight: bold;
    color: var(--sf-calendar-color);
}

.sf-modal-content h3 #sf-booking-date-title {
    font-weight: bold;
    color: var(--sf-calendar-color);
}

.sf-modal-content h3.sf-time-title,
.sf-modal-content h3.sf-form-title {
    font-size: 20px;
    font-weight: bold;
    color: #141111;
    margin-top: 10px;
    margin-bottom: 6px;
}

/* Lista zabiegów */
.sf-treatments {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-height: 450px;
    overflow-y: auto;
    padding: 8px 6px;
    width: 100%;
    min-height: 500px;
}

.sf-treatment {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    padding: 15px;
    transition: all 0.4s ease-in-out;
}

.sf-treatment:hover {
    color: #fff;
    background: var(--sf-calendar-hover-bg, var(--sf-calendar-color-light));
    border-color: var(--sf-calendar-color);
    transform: scale(1.02);
}

.sf-treatment-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
}

.sf-treatment h4 {
    font-size: 16px;
    margin: 0;
    transition: all 0.4s ease-in-out;
}

.sf-treatment:hover h4 {
    color: #fff;
}

.sf-treatment p {
    font-size: 13px;
    margin: 0;
    transition: all 0.4s ease-in-out;
}

.sf-treatment:hover p {
    color: #fff;
}

.sf-treatment .sf-treatment-duration {
    font-size: 13px;
    color: #888;
    margin: 0;
    transition: all 0.4s ease-in-out;
}

.sf-treatment:hover .sf-treatment-duration {
    color: #fff;
}

.sf-treatment-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-end;
    flex-shrink: 0;
}

.sf-treatment-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--sf-calendar-color);
    margin: 0;
    transition: all 0.4s ease-in-out;
}

.sf-treatment:hover .sf-treatment-price {
    color: #fff;
}

/* Sloty czasowe */
.sf-time-slots {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-height: 450px;
    overflow-y: auto;
    padding: 8px 6px;
    width: 100%;
}

.sf-time-slot {
    padding: 10px;
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    font-size: 14px;
    transition: all 0.4s ease-in-out;
}

.sf-time-slot:hover {
    background: var(--sf-calendar-hover-bg, var(--sf-calendar-color-light));
    border: 1px solid var(--sf-calendar-color);
    color: #fff;
    font-weight: bolder;
}

.sf-time-slot.disabled {
    background: #f0f0f0;
    color: #999;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Formularz */
#sf-booking-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 16px;
}

.sf-form-group-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
}

.sf-form-group {
    display: flex !important;
    flex-direction: column !important;
    align-items: start !important;
    justify-content: center !important;
    width: 45% !important;
    gap: 6px !important;
}

.sf-form-group p {
    display: flex !important;
    flex-direction: column !important;
    align-items: start !important;
    width: 100% !important;
    gap: 4px !important;
    margin: 0 !important;
}

.sf-form-group.sf-form-group,
.sf-form-group p,
.sf-form-group p .wpcf7-form-control-wrap,
.sf-form-group p .wpcf7-form-control-wrap .wpcf7-form-control,
.sf-form-group p .wpcf7-form-control-wrap .wpcf7-form-control .wpcf7-list-item {
    width: 100% !important;
}

.wpcf7-response-output {
    display: none !important;
}

.sf-form-group label {
    display: flex !important;
    align-items: center !important;
    justify-content: start !important;
    gap: 16px !important;
    color: #333 !important;
    font-weight: bold !important;
    font-size: 14px !important;
}

.sf-form-group input[type="text"],
.sf-form-group input[type="tel"],
.sf-form-group input[type="email"] {
    width: 100% !important;
    padding: 10px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
    color: #333 !important;
    background: #fff !important;
}

.sf-form-group input:focus {
    outline: none !important;
    border-color: var(--sf-calendar-color) !important;
}

.sf-checkbox-label {
    display: flex !important;
    align-items: center !important;
    cursor: pointer;
    gap: 0 !important;
    flex-wrap: nowrap !important;
}

input[type="checkbox"] {
    width: 1.25em !important;
    height: 1.25em !important;
    min-width: 1.25em !important;
    min-height: 1.25em !important;
    vertical-align: middle !important;
    cursor: pointer;
    border: 1px solid #DEAC2B !important;
    border-radius: 4px !important;
    background-color: #fff !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: contain !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    display: inline-block !important;
    position: relative !important;
    flex-shrink: 0 !important;
    margin: 0 8px 0 0 !important;
    padding: 0 !important;
    float: none !important;
}

input[type="checkbox"]:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e") !important;
    background-color: #DEAC2B !important;
    background-size: 80% !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    border: 1px solid #DEAC2B !important;
}

input[type="checkbox"]:focus {
    outline: none;
    border: 1px solid var(--sf-calendar-color);
}

.sf-form-group p .wpcf7-form-control-wrap .wpcf7-form-control .wpcf7-list-item,
.sf-checkbox-label span {
    font-weight: normal;
}

/* Przyciski */
.sf-form-actions {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    gap: 10px !important;
    margin-top: 16px !important;
    float: none !important;
    clear: both !important;
}

.sf-form-actions p {
    display: flex !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 10px !important;
    margin: 0 !important;
}

.sf-form-actions p .wpcf7-spinner {
    display: none !important;
}

.sf-modal-btn {
    padding: 12px 24px !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: bold !important;
    transition: all 0.4s ease-in-out !important;
    display: inline-block !important;
    width: auto !important;
    float: none !important;
}

.sf-btn-cancel {
    background: #ccc !important;
    color: #333 !important;
}

.sf-btn-cancel:hover {
    background: #bbb !important;
}

.sf-btn-back {
    background: #e0e0e0 !important;
    color: #333 !important;
    border: 1px solid #ccc !important;
}

.sf-btn-back:hover {
    background: var(--sf-calendar-color-light) !important;
    border-color: var(--sf-calendar-color-dark) !important;
    color: #fff !important;
}

.sf-btn-submit {
    background: var(--sf-calendar-color) !important;
    color: white !important;
}

.sf-btn-submit:hover {
    background: var(--sf-calendar-color-dark) !important;
}

.sf-btn-submit:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
}

/* Napraw CF7 acceptance checkbox label */
.sf-form-group .wpcf7-list-item-label,
.sf-form-group .wpcf7-list-item label,
.sf-form-group.acceptance label,
.sf-form-group.acceptance span {
    color: #333 !important;
    font-size: 14px !important;
    flex-direction: row !important;
    display: flex !important;
    align-items: center !important;
}

.sf-form-group .wpcf7-list-item {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
}

/* Napraw kliknięcie checkboxa acceptance — theme może blokować pointer-events */
.sf-form-group .wpcf7-acceptance,
.sf-form-group .wpcf7-acceptance *,
.sf-form-group .wpcf7-form-control-wrap,
.sf-form-group .wpcf7-form-control-wrap *,
.sf-form-group .wpcf7-list-item,
.sf-form-group .wpcf7-list-item *,
.sf-form-group input[type="checkbox"] {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Komunikat sukcesu/błędu */
.sf-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
}

.sf-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.sf-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Animacja ładowania */
.sf-treatments.sf-loading {
    position: relative;
}

.sf-loading .sf-loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    background-color: #fefefe;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

.sf-loading .sf-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--sf-calendar-color);
    border-radius: 50%;
    animation: sf-spin 1s linear infinite;
    margin: 40px auto;
}

@keyframes sf-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Wiadomość błędu */
.sf-loading .sf-error-message {
    color: #b71c1c;
    text-align: center;
    padding: 20px;
    background: #ffcdd2;
    border-radius: 4px;
    margin: 20px;
    font-size: 14px;
}

/* Responsywność */
@media (max-width: 768px) {
    .sf-time-slots {
        grid-template-columns: repeat(3, 1fr);
    }

    .sf-modal-content {
        width: 95%;
        padding: 10px 20px 20px 20px;
    }

    #sf-calendar-main-modal.sf-modal-content {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .sf-time-slots {
        grid-template-columns: repeat(2, 1fr);
    }

    .sf-calendar-weekdays {
        gap: 2px;
    }

    .sf-calendar-days {
        gap: 2px;
    }

    #sf-calendar-main-modal .sf-calendar-wrapper {
        padding: 10px;
    }

    #sf-calendar-main-modal .sf-calendar-day {
        min-height: 30px;
    }

    #sf-calendar-main-modal .sf-calendar-day .sf-calendar-day-number {
        font-size: 12px;
    }

    .sf-modal-content h3 {
        font-size: 18px;
    }

    .sf-time-title {
        font-size: 18px;
    }

    .sf-treatments {
        grid-template-columns: 1fr;
    }
}

/* Modal podziękowań */
.sf-thank-you-content {
    text-align: center;
    padding: 20px 0;
    width: 100%;
}

.sf-thank-you-content h3 {
    font-size: 24px;
    font-weight: bold;
    color: var(--sf-calendar-color);
    margin: 0 0 15px 0;
}

.sf-thank-you-content p {
    font-size: 16px;
    color: #666;
    margin: 0;
    line-height: 1.6;
}
/* Nadpisanie wpcf7 flex-direction z popup.css - tylko dla przycisków */
.sf-form-actions > p {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 10px !important;
    margin: 0 !important;
}

/* =============================================
   Strona chroniona haslem — panel CRM
   ============================================= */
.post-password-form {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    margin: 0 !important;
    padding: 24px !important;
    background: linear-gradient(135deg, #1a0a00 0%, #2a1200 40%, #1f0e00 100%) !important;
    box-sizing: border-box !important;
}

.post-password-form::before,
.post-password-form::after {
    display: none !important;
    content: none !important;
}

/* Ukryj domyslny tekst WP */
.post-password-form p:first-of-type {
    display: none !important;
}

/* Karta */
.post-password-form p:last-of-type {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0 !important;
    margin: 0 !important;
    background: rgba(255,255,255,0.04) !important;
    border: 1px solid rgba(249,115,22,0.25) !important;
    border-radius: 20px !important;
    padding: 44px 48px 40px !important;
    box-shadow: 0 40px 80px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.06) !important;
    width: 380px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Naglowek nad karta przez pseudo-element na formularzu nie dziala dobrze — uzywamy ::before na p:last-of-type ale to tez nie wychodzi, wiec zamieniamy hide na pierwsze p i wstawiamy tekst przez nie */

/* Odkryj pierwsze p i ustaw je jako naglowek */
.post-password-form p:first-of-type {
    display: block !important;
    font-size: 0 !important;
    line-height: 0 !important;
    margin: 0 0 0 0 !important;
    position: relative !important;
    z-index: 1 !important;
}

.post-password-form p:first-of-type::before {
    content: "Studio Figura" !important;
    display: block !important;
    font-family: Arial, sans-serif !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: .35em !important;
    text-transform: uppercase !important;
    color: #f97316 !important;
    text-align: center !important;
    margin-bottom: 10px !important;
    line-height: 1 !important;
}

.post-password-form p:first-of-type::after {
    content: "Witamy w panelu zarzadzania klientkami" !important;
    display: block !important;
    font-family: Georgia, serif !important;
    font-size: 19px !important;
    font-weight: 400 !important;
    color: rgba(255,255,255,0.88) !important;
    text-align: center !important;
    line-height: 1.4 !important;
    margin-bottom: 6px !important;
}

.post-password-form p:last-of-type::before {
    content: "Zaloguj sie, aby wejsc do swojego panelu" !important;
    display: block !important;
    font-family: Arial, sans-serif !important;
    font-size: 12px !important;
    color: rgba(255,255,255,0.35) !important;
    text-align: center !important;
    margin-bottom: 28px !important;
    line-height: 1.5 !important;
}

.post-password-form label {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
    font-family: Arial, sans-serif !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .12em !important;
    color: rgba(255,255,255,0.3) !important;
    margin-bottom: 14px !important;
}

.post-password-form input[type="password"] {
    width: 100% !important;
    padding: 14px 18px !important;
    border: 1px solid rgba(249,115,22,0.2) !important;
    border-radius: 10px !important;
    font-size: 16px !important;
    font-family: Arial, sans-serif !important;
    color: #fff !important;
    background: rgba(255,255,255,0.06) !important;
    outline: none !important;
    transition: border-color .2s, background .2s !important;
    letter-spacing: .1em !important;
    box-sizing: border-box !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 100001 !important;
    cursor: text !important;
}

.post-password-form input[type="password"]:focus {
    border-color: #f97316 !important;
    background: rgba(249,115,22,0.08) !important;
}

.post-password-form input[type="submit"] {
    width: 100% !important;
    padding: 15px 18px !important;
    background: #f97316 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    font-family: Arial, sans-serif !important;
    cursor: pointer !important;
    letter-spacing: .14em !important;
    text-transform: uppercase !important;
    transition: opacity .2s, transform .1s !important;
    box-sizing: border-box !important;
    margin-top: 4px !important;
}

.post-password-form input[type="submit"]:hover {
    opacity: .88 !important;
    transform: translateY(-1px) !important;
}

.post-password-form input[type="submit"]:active {
    transform: translateY(0) !important;
}
/* Napraw Bootstrap modal-open blokujący formularz hasła */
body.modal-open .post-password-form,
body.modal-open .post-password-form * {
    pointer-events: auto !important;
}

body.modal-open {
    overflow: visible !important;
    overflow-y: auto !important;
    padding-right: 0 !important;
}