/* ============================================================
   Man Man Booking System — Frontend Styles
   Design: Warm Vinyl / Jazz Kissa Premium
   All CSS custom properties are overridable via wp-admin
   ============================================================ */

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
    /* Base palette — admin can override bg, text, primary */
    --manman-bg: #F7F3EE;
    --manman-text: #2C1A0E;
    --manman-primary: #C85A17;

    /* Derived tokens (always computed, never overridden by admin) */
    --manman-primary-dark: #A34510;
    --manman-primary-light: #F2E0D4;
    --manman-primary-glow: rgba(200, 90, 23, 0.18);

    /* Surfaces */
    --manman-surface: #FFFFFF;
    --manman-surface-2: #F0EBE4;
    --manman-border: #DDD5C8;
    --manman-border-focus: var(--manman-primary);

    /* Text hierarchy */
    --manman-text-muted: rgba(44, 26, 14, 0.55);
    --manman-text-inv: #FFFFFF;

    /* States */
    --manman-error: #C0392B;
    --manman-error-bg: #FDF0EE;
    --manman-success: #2E7D32;
    --manman-disabled: rgba(44, 26, 14, 0.25);

    /* Radius / Shadow */
    --manman-radius-sm: 6px;
    --manman-radius-md: 10px;
    --manman-radius-lg: 16px;
    --manman-shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.08);
    --manman-shadow-md: 0 4px 20px rgba(0, 0, 0, 0.10);
    --manman-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.14);

    /* Transitions */
    --manman-transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ── Wrapper ────────────────────────────────────────────────── */
.manman-booking-wrapper {
    font-family: inherit;
    color: var(--manman-text);
    background: var(--manman-bg);
    padding: 28px 36px;
    border-radius: var(--manman-radius-lg);
    box-shadow: var(--manman-shadow-md);
    max-width: none;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    width: 100%;
    border: 1px solid var(--manman-border);
}

.manman-layout-split.manman-booking-wrapper {
    max-width: none;
}


/* ── Headings ───────────────────────────────────────────────── */
/* Force dark/themed text — overrides site theme that may set light headings */
.manman-booking-wrapper h1,
.manman-booking-wrapper h2,
.manman-booking-wrapper h3,
.manman-booking-wrapper h4,
.manman-booking-wrapper h5,
.manman-booking-wrapper h6 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 18px;
    letter-spacing: -0.01em;
    color: var(--manman-text) !important;
}


/* ── Layouts ────────────────────────────────────────────────── */
.manman-form-container {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.manman-layout-split .manman-form-container {
    flex-direction: row;
    gap: 28px;
}

.manman-layout-split .manman-left-column {
    flex: 1.5;
    min-width: 0;
}

.manman-layout-split .manman-right-column {
    flex: 1;
    min-width: 280px;
    background: var(--manman-surface);
    padding: 14px 24px;
    border-radius: var(--manman-radius-md);
    border: 1px solid var(--manman-border);
    box-shadow: var(--manman-shadow-sm);
    /* Right column always white — lock text dark in any theme */
    color: #2C1A0E;
}

.manman-layout-split .manman-right-column h1,
.manman-layout-split .manman-right-column h2,
.manman-layout-split .manman-right-column h3,
.manman-layout-split .manman-right-column h4 {
    color: #2C1A0E !important;
}

/* Ticket info box inside right column */
.manman-layout-split .manman-right-column .ticket-info {
    background: var(--manman-surface-2);
    color: var(--manman-text);
}


/* ── Wizard Progress ────────────────────────────────────────── */
.manman-layout-wizard .manman-step-section {
    display: none;
    animation: mmFadeIn 0.35s ease forwards;
}

.manman-layout-wizard .manman-step-section.active {
    display: block;
}

@keyframes mmFadeIn {
    from {
        opacity: 0;
        transform: translateX(16px);
    }

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

.manman-wizard-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 28px;
    border-bottom: 2px solid var(--manman-border);
    padding-bottom: 12px;
}

.wizard-step {
    flex: 1;
    text-align: center;
    color: var(--manman-text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color var(--manman-transition);
}

.wizard-step.active {
    color: var(--manman-primary);
}


/* ── Section Dividers ───────────────────────────────────────── */
.manman-step-section+.manman-step-section,
.manman-form-section+.manman-form-section {
    padding-top: 16px;
    border-top: 1px solid var(--manman-border);
}


/* ── Pax Selector ───────────────────────────────────────────── */
.manman-pax-selector {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 16px;
}

.manman-pax-selector button {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid var(--manman-primary);
    background: transparent;
    color: var(--manman-primary);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--manman-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.manman-pax-selector button:hover {
    background: var(--manman-primary);
    color: var(--manman-text-inv);
    box-shadow: 0 0 0 4px var(--manman-primary-glow);
}

.manman-pax-selector button:active {
    transform: scale(0.94);
}

.manman-pax-selector input {
    width: 64px;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 800;
    border: none;
    background: transparent;
    color: var(--manman-text);
}


/* ── Date & Time Layout ─────────────────────────────────────── */
.manman-datetime-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 28px;
    align-items: flex-start;
}

.manman-datetime-wrapper .manman-date-picker {
    flex: 1 1 360px;
    max-width: 100%;
}

.manman-datetime-wrapper .manman-time-slots {
    flex: 0 0 130px;
}

.manman-date-picker input[type="date"],
.manman-date-picker input[type="text"] {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--manman-border);
    border-radius: var(--manman-radius-sm);
    font-size: 1rem;
    margin-top: 8px;
    background: var(--manman-surface);
    color: var(--manman-text);
    box-sizing: border-box;
    transition: border-color var(--manman-transition);
}

.manman-date-picker input:focus {
    outline: none;
    border-color: var(--manman-border-focus);
    box-shadow: 0 0 0 3px var(--manman-primary-glow);
}


/* ── Calendar ───────────────────────────────────────────────── */
.manman-calendar {
    border: 1.5px solid var(--manman-border);
    border-radius: var(--manman-radius-md);
    padding: 18px;
    background: var(--manman-surface);
    margin-top: 0;
    width: 100%;
    box-sizing: border-box;
    box-shadow: var(--manman-shadow-sm);
}

.manman-layout-single .manman-calendar {
    max-width: 320px;
    padding: 12px 14px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 700;
    font-size: 1rem;
    /* Calendar sits on white - header text must always be dark */
    color: #2C1A0E;
}

.manman-layout-single .calendar-header {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.cal-nav {
    background: var(--manman-surface-2);
    border: 1.5px solid var(--manman-border);
    border-radius: var(--manman-radius-sm);
    cursor: pointer;
    font-weight: 700;
    padding: 4px 12px;
    color: #2C1A0E;
    line-height: 1.5;
    transition: all var(--manman-transition);
}

.cal-nav:hover {
    background: var(--manman-primary-light);
    border-color: var(--manman-primary);
    color: var(--manman-primary-dark);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    /* Calendar is always on white — use hardcoded muted brown */
    color: #8C6B4F;
    margin-bottom: 8px;
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calendar-day {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all var(--manman-transition);
    /* Calendar is on white surface — use readable dark brown */
    color: #2C1A0E;
}

.manman-layout-single .calendar-day {
    font-size: 0.78rem;
}

.calendar-day:not(.empty):not(.disabled):hover {
    background: var(--manman-primary-light);
    color: var(--manman-primary-dark);
    font-weight: 700;
}

.calendar-day.selected {
    background: var(--manman-primary);
    color: #FFFFFF;
    font-weight: 700;
    box-shadow: 0 2px 8px var(--manman-primary-glow);
}

.calendar-day.disabled {
    color: #2C1A0E;
    opacity: 0.22;
    cursor: not-allowed;
}

.calendar-day.closed {
    color: var(--manman-error);
    opacity: 0.35;
}


/* ── Time Slots ─────────────────────────────────────────────── */
.manman-hint {
    margin-top: 0;
    margin-bottom: 14px;
    color: var(--manman-text-muted);
    font-size: 0.88rem;
    font-style: italic;
}

.manman-empty-slots-msg {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--manman-error);
    font-weight: 600;
    padding: 18px;
    background: var(--manman-error-bg);
    border: 1.5px solid rgba(192, 57, 43, 0.2);
    border-radius: var(--manman-radius-sm);
    font-size: 0.95rem;
}

.slots-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.slot-btn {
    padding: 10px 8px;
    border: 1.5px solid var(--manman-border);
    background: var(--manman-surface);
    border-radius: var(--manman-radius-sm);
    cursor: pointer;
    text-align: center;
    transition: all var(--manman-transition);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--manman-text);
    /* Slots sit on white surface — force dark readable text */
    color: #2C1A0E;
}

.slot-btn:hover {
    border-color: var(--manman-primary);
    background: var(--manman-primary-light);
    color: var(--manman-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--manman-shadow-sm);
}

.slot-btn.selected {
    background: var(--manman-primary);
    color: #FFFFFF;
    border-color: var(--manman-primary);
    font-weight: 700;
    box-shadow: 0 3px 10px var(--manman-primary-glow);
    transform: translateY(-1px);
}


/* ── Contact Form ───────────────────────────────────────────── */
.manman-contact-form .form-row {
    margin-bottom: 8px;
}

.manman-contact-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    /* Override theme light label color */
    color: var(--manman-text) !important;
}

.manman-contact-form input,
.manman-contact-form textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--manman-border);
    border-radius: var(--manman-radius-sm);
    font-size: 1rem;
    box-sizing: border-box;
    /* Always white bg + dark text for readability in any theme */
    background: #FFFFFF;
    color: #2C1A0E;
    transition: border-color var(--manman-transition), box-shadow var(--manman-transition);
}

.manman-contact-form input::placeholder,
.manman-contact-form textarea::placeholder {
    color: #B0957C;
    opacity: 1;
}

.manman-contact-form input:focus,
.manman-contact-form textarea:focus {
    outline: none;
    border-color: var(--manman-primary);
    box-shadow: 0 0 0 3px var(--manman-primary-glow);
}

/* Override: the phone number input inside the group should not have its own full border */
.manman-phone-group .manman-phone-number {
    border-left: none !important;
    border-radius: 0 var(--manman-radius-sm) var(--manman-radius-sm) 0 !important;
}

.manman-phone-group .manman-phone-number:focus {
    border-left: none !important;
    box-shadow: none !important;
}

.manman-phone-group:focus-within {
    border-radius: var(--manman-radius-sm);
    box-shadow: 0 0 0 3px var(--manman-primary-glow);
}


/* ── Phone Group ────────────────────────────────────────────── */
.manman-phone-group {
    display: flex;
    align-items: stretch;
    border: 1.5px solid var(--manman-border);
    border-radius: var(--manman-radius-sm);
    overflow: hidden;
    background: #FFFFFF;
    transition: border-color var(--manman-transition);
}

.manman-phone-group:focus-within {
    border-color: var(--manman-primary);
}

.manman-phone-code {
    flex-shrink: 0;
    padding: 10px 10px 10px 12px;
    border: none;
    border-right: 1.5px solid var(--manman-border);
    background: var(--manman-surface-2);
    color: #2C1A0E;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    /* Custom dropdown arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238C6B4F' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
    min-width: 100px;
    transition: background-color var(--manman-transition);
}

.manman-phone-code:focus {
    background-color: var(--manman-primary-light);
    border-right-color: var(--manman-primary);
}

.manman-phone-number {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #FFFFFF;
    color: #2C1A0E;
    font-size: 1rem;
    outline: none;
}

.manman-phone-number::placeholder {
    color: #B0957C;
    opacity: 1;
}

/* Ensure the manman-contact-form's general input style doesn't override the group */
.manman-contact-form .manman-phone-group input {
    width: auto;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 9px 12px;
}

/* ── Ticket Summary ─────────────────────────────────────────── */
.ticket-info {
    background: var(--manman-surface-2);
    border: 1px solid var(--manman-border);
    padding: 10px 14px;
    border-radius: var(--manman-radius-sm);
    margin-bottom: 10px;
    color: var(--manman-text);
    font-size: 0.95rem;
}

.ticket-info p {
    margin: 5px 0;
    color: inherit;
}

.ticket-info strong {
    color: var(--manman-primary);
}

.manman-time-note,
.ticket-info p.manman-time-note {
    margin: 10px 0 0;
    padding-top: 8px;
    border-top: 1px solid var(--manman-border);
    font-size: 0.78rem;
    color: #c0392b !important;
    line-height: 1.4;
}


/* ── Pricing & Payment Section ──────────────────────────────── */
#manman-price-display {
    background: linear-gradient(135deg, var(--manman-primary) 0%, var(--manman-primary-dark) 100%);
    color: #FFFFFF !important;
    padding: 9px 16px;
    border-radius: var(--manman-radius-sm);
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
    box-shadow: 0 3px 12px var(--manman-primary-glow);
    letter-spacing: 0.01em;
}

#manman-price-display small {
    display: block;
    font-weight: 400;
    opacity: 0.85;
    font-size: 0.8em;
    margin-top: 3px;
}

#manman-payment-methods p {
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--manman-text-muted);
    margin-bottom: 6px;
}

#manman-payment-methods label {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    cursor: pointer !important;
    margin-bottom: 6px !important;
    width: auto !important;
    text-align: left !important;
    padding: 8px 12px !important;
    border: 1.5px solid var(--manman-border) !important;
    border-radius: var(--manman-radius-sm) !important;
    background: var(--manman-surface) !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    /* Ensure text is always readable */
    color: #2C1A0E !important;
    transition: border-color var(--manman-transition), background var(--manman-transition) !important;
}

#manman-payment-methods label:has(input:checked) {
    border-color: var(--manman-primary) !important;
    background: var(--manman-primary-light) !important;
    color: var(--manman-primary-dark) !important;
    font-weight: 700 !important;
}

#manman-payment-methods label:hover:not(:has(input:checked)) {
    border-color: var(--manman-primary) !important;
    background: #FAF5F0 !important;
}

#manman-payment-methods input[type="radio"] {
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    width: 16px !important;
    max-width: 16px !important;
    height: 16px !important;
    display: inline-block !important;
    box-shadow: none !important;
    accent-color: var(--manman-primary) !important;
}


/* ── Buttons ────────────────────────────────────────────────── */
.manman-btn-primary,
.btn-next-step {
    background: linear-gradient(135deg, var(--manman-primary) 0%, var(--manman-primary-dark) 100%);
    color: #FFFFFF;
    border: none;
    padding: 10px 24px;
    border-radius: var(--manman-radius-sm);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    margin-top: 6px;
    transition: all var(--manman-transition);
    letter-spacing: 0.01em;
    box-shadow: 0 3px 10px var(--manman-primary-glow);
    position: relative;
    overflow: hidden;
}

.manman-btn-primary::after,
.btn-next-step::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: background var(--manman-transition);
}

.manman-btn-primary:hover:not(:disabled)::after,
.btn-next-step:hover:not(:disabled)::after {
    background: rgba(255, 255, 255, 0.12);
}

.manman-btn-primary:hover:not(:disabled),
.btn-next-step:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px var(--manman-primary-glow);
}

.manman-btn-primary:active:not(:disabled),
.btn-next-step:active:not(:disabled) {
    transform: translateY(0);
}

.manman-btn-primary:disabled,
.btn-next-step:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-prev-step {
    background: transparent;
    color: var(--manman-text);
    border: 1.5px solid var(--manman-border);
    padding: 15px 24px;
    border-radius: var(--manman-radius-sm);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 12px;
    transition: all var(--manman-transition);
}

.btn-prev-step:hover {
    background: var(--manman-surface-2);
    border-color: var(--manman-text);
}

.wizard-actions {
    display: flex;
    gap: 12px;
    margin-top: 22px;
}


/* ── Utility / State ────────────────────────────────────────── */
.manman-hidden,
#manman-booking-app .manman-hidden,
#manman-payment-methods label.manman-hidden {
    display: none !important;
}

.manman-error-msg {
    color: var(--manman-error);
    margin-top: 10px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
}


/* ── Inline Field Validation States ────────────────────────── */

/* Valid state — green border + subtle glow */
.manman-contact-form input.field-valid,
.manman-contact-form textarea.field-valid {
    border-color: var(--manman-success) !important;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12) !important;
}

/* Invalid state — red border + subtle glow */
.manman-contact-form input.field-invalid,
.manman-contact-form textarea.field-invalid {
    border-color: var(--manman-error) !important;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12) !important;
}

/* Phone group wrapper valid / invalid */
.manman-phone-group.phone-group-valid {
    border-color: var(--manman-success) !important;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12) !important;
}

.manman-phone-group.phone-group-invalid {
    border-color: var(--manman-error) !important;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12) !important;
}

/* Hint text that slides in beneath the field */
.manman-field-hint {
    display: block;
    font-size: 0.78rem;
    margin-top: 4px;
    min-height: 1.1em;
    transition: opacity var(--manman-transition);
}

.manman-field-error {
    color: var(--manman-error);
    animation: mmHintSlide 0.18s ease forwards;
}

@keyframes mmHintSlide {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ── Success Overlay ────────────────────────────────────────── */
#manman-success-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--manman-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: mmFadeIn 0.4s ease forwards;
}

.success-box {
    text-align: center;
    padding: 40px;
}

.success-icon {
    width: 64px;
    height: 64px;
    color: var(--manman-success);
    margin-bottom: 18px;
}

.success-box h2 {
    color: var(--manman-text) !important;
    font-size: 1.5rem !important;
    margin-bottom: 10px !important;
}

.success-box p {
    color: var(--manman-text-muted);
    font-size: 1rem;
}


/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .manman-booking-wrapper {
        padding: 22px 18px;
        border-radius: var(--manman-radius-md);
    }

    .manman-layout-split .manman-form-container {
        flex-direction: column;
    }

    .manman-layout-split .manman-right-column {
        min-width: unset;
        width: 100%;
        box-sizing: border-box;
    }

    .manman-layout-single .manman-calendar,
    .manman-layout-split .manman-calendar {
        max-width: 100%;
    }

    .manman-contact-form input,
    .manman-contact-form textarea {
        width: 100%;
    }

    .manman-datetime-wrapper .manman-time-slots {
        flex: 1 1 100%;
        width: 100%;
    }

    .slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .manman-booking-wrapper {
        padding: 16px 14px;
        border-radius: 0;
        box-shadow: none;
        border-left: none;
        border-right: none;
    }

    .manman-layout-split .manman-right-column {
        padding: 20px 16px;
    }

    .calendar-day {
        font-size: 0.82rem;
    }

    .slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .manman-pax-selector input {
        width: 50px;
    }

    .manman-pax-selector button {
        width: 42px;
        height: 42px;
    }
}

/* ── House Rules Modal ──────────────────────────────────────── */
.manman-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.manman-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.manman-modal-box {
    background: var(--manman-surface);
    width: 90%;
    max-width: 560px;
    border-radius: var(--manman-radius-lg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.manman-modal-overlay.active .manman-modal-box {
    transform: translateY(0);
}

/* Direct-child selector: only the modal title h3, not h3s inside injected content */
.manman-modal-box > h3 {
    padding: 24px;
    margin: 0;
    border-bottom: 1px solid var(--manman-border);
    color: var(--manman-text);
    font-size: 1.5rem;
    font-family: var(--manman-font-serif);
    background: var(--manman-surface-2);
}

.manman-modal-body {
    padding: 24px;
    max-height: 55vh;
    overflow-y: auto;
    font-size: 1rem;
    color: var(--manman-text);
    line-height: 1.6;
}

/* Reset theme/WP styles that override the inline styles in user-authored HTML rules */
.manman-modal-body h1,
.manman-modal-body h2,
.manman-modal-body h3,
.manman-modal-body h4 {
    all: revert;
}
.manman-modal-body ul,
.manman-modal-body ol,
.manman-modal-body li,
.manman-modal-body p {
    all: revert;
}

.manman-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--manman-border);
    background: var(--manman-surface-2);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 12px;
}

.manman-timer-label {
    font-size: 0.9rem;
    color: var(--manman-text-muted);
    font-style: italic;
}

#manman-rules-agree {
    flex-shrink: 0;
    min-width: 120px;
}

#manman-rules-agree:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--manman-border);
    color: var(--manman-text-muted);
    box-shadow: none;
    transform: none;
}

@media (max-width: 480px) {
    .manman-modal-overlay {
        align-items: flex-end;
    }
    .manman-modal-box {
        width: 100%;
        max-width: 100%;
        border-radius: var(--manman-radius-lg) var(--manman-radius-lg) 0 0;
    }
    .manman-modal-body {
        max-height: 65vh;
    }
    .manman-modal-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    #manman-rules-agree {
        width: 100%;
    }
}