/**
 * ROZR Public - Registration Form Styles
 * Supplements Tailwind utility classes used in rozr_rejestracja shortcode.
 * Provides WP-theme isolation so the form looks consistent across themes.
 */

/* =========================================================================
   1. ROOT CONTAINER & GLOBAL RESETS
   ========================================================================= */

.rozr-registration {
    font-family: 'Montserrat', 'Helvetica', 'Arial', sans-serif;
    color: #1e293b;
    max-width: 72rem;
    margin: 0 auto;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.rozr-registration *,
.rozr-registration *::before,
.rozr-registration *::after {
    box-sizing: border-box !important;
    border-width: 0;
    border-style: solid;
    border-color: #e5e7eb;
}

/*
 * Force font inheritance on ALL elements inside the form.
 * WP themes frequently set font-family on body, button, input etc.
 * with high specificity — we must match or exceed it.
 */
.rozr-registration,
.rozr-registration *:not(.material-symbols-outlined) {
    font-family: 'Montserrat', 'Helvetica', 'Arial', 'Lucida', sans-serif !important;
}

/* Ensure hidden class works even if Tailwind CDN or WP theme overrides it */
.rozr-registration .hidden {
    display: none !important;
}

/* Neutralize common WP theme overrides */
.rozr-registration h2,
.rozr-registration h3,
.rozr-registration h4,
.rozr-registration h5 {
    margin: 0;
    padding: 0;
    border: none;
    line-height: 1.3;
    letter-spacing: normal;
    font-family: 'Merriweather', serif !important;
}

.rozr-registration h2 {
    font-size: 1.5rem;
}

.rozr-registration h3 {
    font-size: 1.25rem;
}

.rozr-registration h4 {
    font-size: 1.125rem;
}

.rozr-registration h5 {
    font-size: 0.875rem;
}

.rozr-registration p {
    margin: 0;
    padding: 0;
}

.rozr-registration ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rozr-registration a {
    text-decoration-skip-ink: auto;
}

.rozr-registration img {
    max-width: 100%;
    height: auto;
}

.rozr-registration span {
    font-family: inherit !important;
}

/* Restore Material Symbols font specifically */
.rozr-registration .material-symbols-outlined {
    font-family: 'Material Symbols Outlined' !important;
}

/* =========================================================================
   2. MATERIAL SYMBOLS
   ========================================================================= */

.rozr-registration .material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
    font-family: 'Material Symbols Outlined';
    font-style: normal;
    -webkit-font-smoothing: antialiased;
}

.rozr-registration .material-symbols-outlined.filled {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* =========================================================================
   3. FORM INPUTS — WP-theme isolation
   ========================================================================= */

.rozr-registration input[type="text"],
.rozr-registration input[type="email"],
.rozr-registration input[type="tel"],
.rozr-registration input[type="number"],
.rozr-registration select,
.rozr-registration textarea {
    font-family: inherit;
    font-size: 0.875rem;
    color: #1e293b;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    width: 100%;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.rozr-registration input[type="text"]:focus,
.rozr-registration input[type="email"]:focus,
.rozr-registration input[type="tel"]:focus,
.rozr-registration input[type="number"]:focus,
.rozr-registration select:focus,
.rozr-registration textarea:focus {
    border-color: #2E8B57;
    box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.15);
}

.rozr-registration input::placeholder,
.rozr-registration textarea::placeholder {
    color: #94a3b8;
}

/* Inputs with icon prefix already have pl-10 via Tailwind, keep specificity low */
.rozr-registration .relative input {
    width: 100%;
}

/* Checkbox */
.rozr-registration input[type="checkbox"] {
    accent-color: #2E8B57;
    width: 1rem;
    height: 1rem;
}

/* Hide native radio for custom styled radios */
.rozr-registration input[type="radio"].hidden,
.rozr-registration input[type="checkbox"].hidden {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* =========================================================================
   4. BUTTONS — Aggressive reset to defeat WP theme & browser defaults
   ========================================================================= */

.rozr-registration button,
.rozr-registration button[type="button"],
.rozr-registration button[type="submit"] {
    font-family: inherit !important;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
    cursor: pointer;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 solid transparent !important;
    border-style: solid !important;
    border-radius: 0;
    padding: 0;
    margin: 0;
    text-transform: none;
    text-align: inherit;
    letter-spacing: inherit;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    box-shadow: none;
    outline: none;
    transition: all 0.2s ease;
}

/*
 * Re-apply Tailwind-style border/bg/padding on buttons that HAVE those classes.
 * The !important above on background-color/border clears WP defaults.
 * Tailwind's inline styles (from CDN) are injected after, so they win.
 * But some classes need a specificity boost:
 */

/* Buttons with explicit border via Tailwind class */
.rozr-registration button[class*="border-slate"],
.rozr-registration button[class*="border-primary"],
.rozr-registration button[class*="border-gray"] {
    border-width: 1px !important;
    border-style: solid !important;
}

/* Buttons with 2px border */
.rozr-registration button[class*="border-2"] {
    border-width: 2px !important;
    border-style: solid !important;
}

/* Buttons with explicit backgrounds */
.rozr-registration button[class*="bg-white"] {
    background-color: #ffffff !important;
}

.rozr-registration button[class*="bg-primary-light"] {
    background-color: #e8f5ec !important;
}

.rozr-registration button[class*="bg-primary"] {
    background-color: #2E8B57 !important;
}

/* bg-primary-light should win over bg-primary when both present */
.rozr-registration button[class*="bg-primary-light"][class*="bg-primary"] {
    background-color: #e8f5ec !important;
}

.rozr-registration button[class*="bg-slate-50"] {
    background-color: #f8fafc !important;
}

.rozr-registration button[class*="bg-gray-50"] {
    background-color: #f9fafb !important;
}

/* Padding classes need specificity boost */
.rozr-registration button[class*="p-4"] {
    padding: 1rem !important;
}

.rozr-registration button[class*="p-5"] {
    padding: 1.25rem !important;
}

.rozr-registration button[class*="px-5"] {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
}

.rozr-registration button[class*="py-2.5"] {
    padding-top: 0.625rem !important;
    padding-bottom: 0.625rem !important;
}

.rozr-registration button[class*="py-3"] {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

.rozr-registration button[class*="px-3"] {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

.rozr-registration button[class*="py-1.5"] {
    padding-top: 0.375rem !important;
    padding-bottom: 0.375rem !important;
}

.rozr-registration button[class*="px-4"] {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.rozr-registration button[class*="py-2"] {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.rozr-registration button[class*="px-6"] {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

/* Border-radius */
.rozr-registration button[class*="rounded-xl"] {
    border-radius: 0.75rem !important;
}

.rozr-registration button[class*="rounded-lg"] {
    border-radius: 0.5rem !important;
}

.rozr-registration button[class*="rounded-md"] {
    border-radius: 0.375rem !important;
}

.rozr-registration button[class*="rounded-full"] {
    border-radius: 9999px !important;
}

/* Display flex */
.rozr-registration button[class*="flex"] {
    display: flex !important;
}

.rozr-registration button[class*="items-center"] {
    align-items: center !important;
}

.rozr-registration button[class*="justify-between"] {
    justify-content: space-between !important;
}

.rozr-registration button[class*="justify-center"] {
    justify-content: center !important;
}

.rozr-registration button[class*="gap-2"] {
    gap: 0.5rem !important;
}

.rozr-registration button[class*="gap-3"] {
    gap: 0.75rem !important;
}

/* Width */
.rozr-registration button[class*="w-full"] {
    width: 100% !important;
}

.rozr-registration button[class*="w-8"] {
    width: 2rem !important;
}

/* Height */
.rozr-registration button[class*="h-8"] {
    height: 2rem !important;
}

.rozr-registration button[class*="h-12"] {
    height: 3rem !important;
}

/* Text alignment */
.rozr-registration button[class*="text-left"] {
    text-align: left !important;
}

.rozr-registration button[class*="text-center"] {
    text-align: center !important;
}

/* Font sizes for text within buttons */
.rozr-registration button[class*="text-sm"] {
    font-size: 0.875rem !important;
}

.rozr-registration button[class*="text-xs"] {
    font-size: 0.75rem !important;
}

/* Font weights */
.rozr-registration button[class*="font-bold"] {
    font-weight: 700 !important;
}

.rozr-registration button[class*="font-semibold"] {
    font-weight: 600 !important;
}

.rozr-registration button[class*="font-medium"] {
    font-weight: 500 !important;
}

/* Text colors */
.rozr-registration button[class*="text-white"] {
    color: #ffffff !important;
}

.rozr-registration button[class*="text-primary"]:not([class*="text-primary-dark"]) {
    color: #2E8B57 !important;
}

.rozr-registration button[class*="text-slate-600"] {
    color: #475569 !important;
}

.rozr-registration button[class*="text-slate-500"] {
    color: #64748b !important;
}

.rozr-registration button[class*="text-slate-400"] {
    color: #94a3b8 !important;
}

.rozr-registration button[class*="text-slate-300"] {
    color: #cbd5e1 !important;
}

/* Border colors */
.rozr-registration button[class*="border-slate-200"] {
    border-color: #e2e8f0 !important;
}

.rozr-registration button[class*="border-primary"]:not([class*="border-primary/"]) {
    border-color: #2E8B57 !important;
}

.rozr-registration button[class*="border-gray-200"] {
    border-color: #e5e7eb !important;
}

/* Shadow */
.rozr-registration button[class*="shadow-sm"] {
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important;
}

.rozr-registration button[class*="shadow-md"] {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) !important;
}

/* Disabled state */
.rozr-registration button:disabled,
.rozr-registration button[disabled] {
    cursor: not-allowed !important;
    pointer-events: auto;
}

.rozr-registration button[class*="cursor-not-allowed"] {
    cursor: not-allowed !important;
}

.rozr-registration button:focus-visible {
    outline: 2px solid #2E8B57;
    outline-offset: 2px;
}

/* =========================================================================
   4b. LABELS acting as buttons (participant-type tabs, nocleg radios)
   ========================================================================= */

.rozr-registration label[class*="cursor-pointer"] {
    cursor: pointer;
    font-family: inherit !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

/* =========================================================================
   5. SECTIONS — Cards & steps
   ========================================================================= */

.rozr-registration section {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Step number badges */
.rozr-registration .rounded-full.bg-primary {
    background-color: #2E8B57;
}

/* =========================================================================
   6. STEP 1 — Center selection buttons
   ========================================================================= */

.rozr-registration .rozr-center-btn {
    transition: all 0.2s ease;
}

.rozr-registration .rozr-center-btn:hover {
    transform: translateY(-1px);
}

/* =========================================================================
   7. STEP 1 — Calendar
   ========================================================================= */

.rozr-registration #rozr-calendar-area .grid {
    /* Ensure 7-column grid even when WP themes set display rules */
    display: grid !important;
}

/* Calendar day cells — base */
.rozr-registration .rozr-cal-day {
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.rozr-registration .rozr-cal-day:hover {
    transform: scale(1.05);
}

/* Selected date: emphasize the dot below */
.rozr-registration .rozr-cal-day .absolute {
    animation: rozr-dot-pulse 1.5s ease-in-out infinite;
}

@keyframes rozr-dot-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* =========================================================================
   8. STEP 1 — Timeslots
   ========================================================================= */

.rozr-registration .rozr-timeslot {
    transition: all 0.2s ease;
}

.rozr-registration .rozr-timeslot:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 139, 87, 0.12);
}

/* =========================================================================
   9. STEP 1 — Mode toggle (location / activity)
   ========================================================================= */

.rozr-registration .rozr-mode-btn {
    transition: all 0.2s ease;
}

/* =========================================================================
   10. STEP 1 — Activity cards
   ========================================================================= */

.rozr-registration .rozr-activity-card {
    transition: all 0.2s ease;
}

.rozr-registration .rozr-activity-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Selected activity card (border-primary applied via JS) */
.rozr-registration .rozr-activity-card.border-primary,
.rozr-registration .rozr-activity-card[class*="border-primary"] {
    box-shadow: 0 4px 16px rgba(46, 139, 87, 0.15);
}

/* Category filter pills */
.rozr-registration #rozr-mode-activity .rounded-full {
    transition: all 0.15s ease;
}

/* =========================================================================
   11. STEP 2 — Participant type tabs
   ========================================================================= */

.rozr-registration .rozr-ptype-tab {
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* =========================================================================
   12. STEP 2 — Sub-option buttons (age group / type)
   ========================================================================= */

.rozr-registration .rozr-sub-btn {
    transition: all 0.15s ease;
}

.rozr-registration .rozr-sub-btn:hover {
    transform: translateY(-1px);
}

/* =========================================================================
   13. STEP 2 — Nocleg (accommodation) radio buttons
   ========================================================================= */

.rozr-registration .rozr-radio-dot {
    transition: all 0.2s ease;
}

/* =========================================================================
   14. STEP 2 — Group summary bar
   ========================================================================= */

#rozr-group-summary {
    animation: rozr-fade-in 0.3s ease;
}

/* =========================================================================
   15. STEP 3 — Session detail card
   ========================================================================= */

.rozr-registration #rozr-step-3 {
    animation: rozr-slide-up 0.35s ease;
}

/* Decorative corner circle */
.rozr-registration #rozr-step-3>.absolute {
    pointer-events: none;
}

/* =========================================================================
   16. STEP 4 — Contact form
   ========================================================================= */

.rozr-registration #rozr-step-4 {
    animation: rozr-slide-up 0.35s ease;
}

/* Submit button */
.rozr-registration #rozr-submit-btn {
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.rozr-registration #rozr-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(46, 139, 87, 0.25);
}

.rozr-registration #rozr-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.rozr-registration #rozr-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* =========================================================================
   17. STEP 5 — Confirmation
   ========================================================================= */

.rozr-registration #rozr-step-5 {
    animation: rozr-scale-in 0.4s ease;
}

#rozr-reservation-code {
    letter-spacing: 0.1em;
}

/* =========================================================================
   18. LOADING SPINNER
   ========================================================================= */

.rozr-public-spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: rozr-pub-spin 0.6s linear infinite;
}

@keyframes rozr-pub-spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================================================
   19. ANIMATIONS
   ========================================================================= */

@keyframes rozr-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes rozr-slide-up {
    from {
        opacity: 0;
        transform: translateY(1rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rozr-scale-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* =========================================================================
   20. SCROLLBAR
   ========================================================================= */

.rozr-registration ::-webkit-scrollbar {
    width: 8px;
}

.rozr-registration ::-webkit-scrollbar-track {
    background: transparent;
}

.rozr-registration ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.rozr-registration ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* =========================================================================
   21. INFO / ALERT BOXES
   ========================================================================= */

/* Blue info boxes */
.rozr-registration .bg-blue-50 {
    border-radius: 0.5rem;
}

/* Amber warning boxes */
.rozr-registration .bg-amber-50 {
    border-radius: 0.5rem;
}

/* Green success boxes */
.rozr-registration .bg-green-50 {
    border-radius: 0.5rem;
}

/* =========================================================================
   22. RESPONSIVE ADJUSTMENTS
   ========================================================================= */

@media (max-width: 640px) {
    .rozr-registration {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Stack mode toggle buttons vertically on very small screens */
    .rozr-registration .rozr-mode-btn {
        min-width: 0;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        font-size: 0.8125rem;
    }

    /* Calendar cells smaller */
    .rozr-registration .rozr-cal-day,
    .rozr-registration #rozr-calendar-area button {
        height: 2.5rem;
        font-size: 0.8125rem;
    }

    /* Step 2 sub-option buttons wrap nicely */
    .rozr-registration .rozr-sub-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }

    /* Participant type tabs: allow wrap */
    .rozr-registration .rozr-ptype-tab {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        font-size: 0.8125rem;
    }
}

/* =========================================================================
   23. PRINT
   ========================================================================= */

@media print {
    .rozr-registration section.hidden {
        display: none !important;
    }

    .rozr-registration button:not(#rozr-submit-btn) {
        display: none;
    }

    .rozr-registration {
        box-shadow: none;
    }

    .rozr-registration section {
        border: 1px solid #e2e8f0;
        break-inside: avoid;
    }
}

/* =========================================================================
   CENTER BUTTONS & SHOWCASE
   ========================================================================= */

/* Overlay gradient on center buttons with background images */
.rozr-center-btn-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, .65) 0%, rgba(0, 0, 0, .15) 60%, transparent 100%) !important;
}

.rozr-center-btn:hover .rozr-center-btn-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, .7) 0%, rgba(0, 0, 0, .2) 60%, rgba(0, 0, 0, .05) 100%) !important;
}

/* Allow background-image on center buttons (overrides global button reset) */
.rozr-registration button.rozr-center-btn {
    background-color: transparent !important;
    background-image: var(--rozr-bg-img, none) !important;
    background-size: cover !important;
    background-position: center !important;
}

/* Gallery thumbnails — bg via CSS custom property (beats the global button reset) */
.rozr-registration button.rozr-gallery-thumb {
    background-color: #f1f5f9 !important;
    background-image: var(--rozr-th-img, none) !important;
    background-size: cover !important;
    background-position: center !important;
}

/* Gallery thumbnail strip */
.rozr-gallery-strip {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, .15) transparent;
}

.rozr-gallery-strip::-webkit-scrollbar {
    height: 4px;
}

.rozr-gallery-strip::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, .15);
    border-radius: 999px;
}

/* Hero click area */
.rozr-center-hero {
    cursor: pointer;
}

.rozr-center-hero:hover img {
    transform: scale(1.02);
    transition: transform .3s ease;
}

.rozr-center-hero img {
    transition: transform .3s ease;
}

/* =========================================================================
   GALLERY LIGHTBOX
   ========================================================================= */

.rozr-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s ease;
}

.rozr-lightbox.active {
    opacity: 1;
}

.rozr-lightbox-bg {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .85);
}

.rozr-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rozr-lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: .75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .5);
}

.rozr-lightbox-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(255, 255, 255, .15) !important;
    color: #fff !important;
    border: none !important;
    cursor: pointer;
    transition: background .15s;
}

.rozr-lightbox-close:hover {
    background: rgba(255, 255, 255, .3) !important;
}

.rozr-lightbox-prev,
.rozr-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(255, 255, 255, .15) !important;
    color: #fff !important;
    border: none !important;
    cursor: pointer;
    transition: background .15s;
}

.rozr-lightbox-prev {
    left: -3.5rem;
}

.rozr-lightbox-next {
    right: -3.5rem;
}

.rozr-lightbox-prev:hover,
.rozr-lightbox-next:hover {
    background: rgba(255, 255, 255, .3) !important;
}

.rozr-lightbox-counter {
    position: absolute;
    bottom: -2rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, .7);
    font-size: .8125rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Gallery grid in center panel */
.rozr-gallery-grid {
    border-radius: .75rem;
    overflow: hidden;
}

@media (max-width: 640px) {
    .rozr-lightbox-prev {
        left: .5rem;
    }

    .rozr-lightbox-next {
        right: .5rem;
    }

    .rozr-lightbox-close {
        top: .5rem;
        right: .5rem;
    }

    .rozr-lightbox-counter {
        bottom: .5rem;
    }
}