/**
 * LVB Tentative Hold — Public Form Styles
 * Clean, centered, premium booking experience.
 * v3.3.0 — Simple, correct centering on all page types.
 */

/* ── Container ──────────────────────────────────────────────────────────── */
.lvb-th-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 0.5rem 24px 3rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
    color: #1a1a1a;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

/* ── Event-page alignment ─────────────────────────────────────────────── */
/*
 * Pages 60/62/64/517 (Weddings, Corporate, Celebrations, Your Event):
 * Both the heading section (.legacy-page__booking) and the form (.lvb-th-wrap)
 * must use identical padding-based centering so they align on the same column.
 * TT5's alignfull zeroes out margins, so margin:auto doesn't work here.
 * Formula centers a 740px content column regardless of parent container width.
 */
body.page-id-60 .legacy-page__booking,
body.page-id-62 .legacy-page__booking,
body.page-id-64 .legacy-page__booking,
body.page-id-517 .legacy-page__booking,
body.page-id-60 .lvb-th-wrap,
body.page-id-62 .lvb-th-wrap,
body.page-id-64 .lvb-th-wrap,
body.page-id-517 .lvb-th-wrap {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
    padding-left: max(24px, calc((100% - 740px) / 2)) !important;
    padding-right: max(24px, calc((100% - 740px) / 2)) !important;
}

/* Form fields left-aligned; heading section keeps its own text-align:center */
body.page-id-60 .lvb-th-wrap,
body.page-id-62 .lvb-th-wrap,
body.page-id-64 .lvb-th-wrap,
body.page-id-517 .lvb-th-wrap {
    text-align: left;
}

/* Intro sentence beneath the page title */
.lvb-th-intro {
    text-align: center;
    font-size: 1rem;
    color: #666;
    margin: 0 auto 2.5rem;
    max-width: 560px;
    line-height: 1.6;
}

/* ── Field groups ───────────────────────────────────────────────────────── */
.lvb-th-field-group {
    margin-bottom: 1.5rem;
}

.lvb-th-field-row {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 0;
}

.lvb-th-field-row .lvb-th-field-group {
    flex: 1;
    min-width: 0;
}

.lvb-th-field-half {
    flex: 1;
}

.lvb-th-time-fields {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.lvb-th-time-fields .lvb-th-field-group {
    flex: 1;
    margin-bottom: 0;
}

/* ── Labels ─────────────────────────────────────────────────────────────── */
.lvb-th-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #1a1a1a;
}

.lvb-th-required {
    color: #c0392b;
    margin-left: 2px;
}

.lvb-th-optional {
    font-weight: 400;
    color: #666;
    font-size: 0.8em;
    margin-left: 4px;
}

/* ── Inputs ─────────────────────────────────────────────────────────────── */
.lvb-th-input,
.lvb-th-select,
.lvb-th-textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    color: #1a1a1a;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.lvb-th-input:focus,
.lvb-th-select:focus,
.lvb-th-textarea:focus {
    outline: none;
    border-color: #c9a96e;
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.18);
}

.lvb-th-input.lvb-th-input-sm {
    max-width: 140px;
}

.lvb-th-select {
    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='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
    cursor: pointer;
}

.lvb-th-textarea {
    resize: vertical;
    min-height: 110px;
}

/* Invalid state */
.lvb-th-input.lvb-th-invalid,
.lvb-th-select.lvb-th-invalid,
.lvb-th-textarea.lvb-th-invalid {
    border-color: #c0392b;
}

/* ── Radio group (event type) ───────────────────────────────────────────── */
.lvb-th-type-selector {
    margin-bottom: 2rem;
}

.lvb-th-type-selector legend {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: #1a1a1a;
}

.lvb-th-radio-group {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.lvb-th-radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.lvb-th-radio-label input[type="radio"] {
    width: 1.15em;
    height: 1.15em;
    accent-color: #c9a96e;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Field-level errors ─────────────────────────────────────────────────── */
.lvb-th-field-error {
    font-size: 0.82rem;
    color: #c0392b;
    margin-top: 0.3rem;
    min-height: 1.1em;
}

/* ── Error banner ───────────────────────────────────────────────────────── */
.lvb-th-error-banner {
    padding: 0.85rem 1rem;
    background: #fdf0f0;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    color: #7b2427;
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* ── Submit button ──────────────────────────────────────────────────────── */
.lvb-th-submit-group {
    margin-top: 2rem;
    text-align: center;
}

.lvb-th-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    letter-spacing: 0.02em;
}

.lvb-th-btn-primary {
    background: #c9a96e;
    color: #fff;
}

.lvb-th-btn-primary:hover {
    background: #b8934a;
}

.lvb-th-btn-primary:active {
    transform: scale(0.98);
}

.lvb-th-btn-primary:disabled {
    background: #dfc99a;
    cursor: not-allowed;
}

/* Spinner */
.lvb-th-btn-spinner {
    display: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lvbTHSpin 0.65s linear infinite;
}

.lvb-th-btn--loading .lvb-th-btn-spinner {
    display: inline-block;
}

@keyframes lvbTHSpin {
    to { transform: rotate(360deg); }
}

/* ── Success state ──────────────────────────────────────────────────────── */
#lvb-th-success {
    text-align: center;
    padding: 3rem 2rem;
    background: #fdfaf5;
    border: 1px solid #e2d5bc;
    border-radius: 10px;
    animation: lvbTHFadeIn 0.4s ease;
}

.lvb-th-success-icon {
    font-size: 3rem;
    color: #c9a96e;
    margin-bottom: 0.75rem;
    line-height: 1;
}

.lvb-th-success-heading {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 0.5rem;
}

.lvb-th-success-body {
    color: #555;
    margin-bottom: 1.5rem;
}

.lvb-th-success-details {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.4rem 1rem;
    text-align: left;
    max-width: 420px;
    margin: 0 auto 1.75rem;
    background: #fff;
    border-radius: 8px;
    padding: 1.1rem 1.4rem;
    border: 1px solid #e2d5bc;
}

.lvb-th-success-details dt {
    font-weight: 600;
    color: #555;
    font-size: 0.875rem;
}

.lvb-th-success-details dd {
    margin: 0;
    color: #1a1a1a;
    font-size: 0.95rem;
    font-weight: 500;
}

.lvb-th-success-next {
    font-size: 0.9rem;
    color: #666;
    max-width: 520px;
    margin: 0 auto;
}

@keyframes lvbTHFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Calendar widget ───────────────────────────────────────────────────── */

/* Calendar is the focal point — give it room */
.lvb-th-field-group:has(#lvb-th-calendar) {
    margin-bottom: 2rem;
}

.lvb-th-calendar {
    border: 1.5px solid #d0c9bc;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    user-select: none;
    position: relative;
    transition: opacity 0.15s ease;
    /* Allow calendar to use full container width */
    width: 100%;
    box-sizing: border-box;
}

.lvb-th-calendar.lvb-th-cal-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Header row: prev arrow / month-year title / next arrow */
.lvb-th-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    background: #f5f0e8;
    border-bottom: 1px solid #d0c9bc;
}

.lvb-th-cal-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #1a1a1a;
    letter-spacing: 0.02em;
}

.lvb-th-cal-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    background: none;
    border: 1.5px solid #c8bfb0;
    border-radius: 6px;
    cursor: pointer;
    color: #4a4035;
    transition: background 0.12s ease, border-color 0.12s ease;
    flex-shrink: 0;
}

.lvb-th-cal-nav:hover:not(:disabled) {
    background: #ede7da;
    border-color: #9a8e7e;
}

.lvb-th-cal-nav--disabled,
.lvb-th-cal-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Legend — centered */
.lvb-th-cal-legend {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    padding: 0.55rem 1rem;
    background: #faf8f4;
    border-bottom: 1px solid #e8e1d5;
    font-size: 0.8rem;
    color: #555;
}

.lvb-th-cal-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.lvb-th-cal-swatch {
    display: inline-block;
    width: 15px;
    height: 15px;
    border-radius: 3px;
    flex-shrink: 0;
}

.lvb-th-cal-swatch--avail {
    background: #fff;
    border: 1.5px solid #c8bfb0;
}

.lvb-th-cal-swatch--booked {
    background: #ede8df;
    border: 1.5px solid #c8bfb0;
    position: relative;
    overflow: hidden;
}

.lvb-th-cal-swatch--booked::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 3px,
        rgba(0,0,0,0.14) 3px,
        rgba(0,0,0,0.14) 4px
    );
}

/* 7-column grid for days */
.lvb-th-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 0.75rem 0.85rem 1rem;
    gap: 4px;
}

/* Day-of-week headers */
.lvb-th-cal-dow {
    text-align: center;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    padding: 0.35rem 0;
}

/* Individual day cells */
.lvb-th-cal-day {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border: 1.5px solid transparent;
    background: none;
    color: #1a1a1a;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
    padding: 0;
    line-height: 1;
}

.lvb-th-cal-day--empty {
    cursor: default;
    pointer-events: none;
}

/* Past dates */
.lvb-th-cal-day--past {
    color: #ccc;
    cursor: not-allowed;
    background: none;
}

/* Too-soon dates */
.lvb-th-cal-day--toosoon {
    color: #bbb;
    cursor: not-allowed;
    background: #f9f9f9;
    border-color: #ebebeb;
}

/* Available dates */
.lvb-th-cal-day--avail {
    border-color: #c8bfb0;
    background: #fff;
    color: #1a1a1a;
}

.lvb-th-cal-day--avail:hover {
    background: #fdf5e8;
    border-color: #c9a96e;
    color: #7a5c1e;
    transform: scale(1.06);
    box-shadow: 0 2px 6px rgba(201, 169, 110, 0.25);
}

/* Today's date */
.lvb-th-cal-day--today.lvb-th-cal-day--avail {
    border-color: #c9a96e;
    font-weight: 700;
    color: #7a5c1e;
}

.lvb-th-cal-day--today.lvb-th-cal-day--past {
    border-color: #ccc;
}

/* Selected date — site gold */
.lvb-th-cal-day--selected {
    background: #c9a96e !important;
    border-color: #c9a96e !important;
    color: #fff !important;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(201, 169, 110, 0.4);
}

.lvb-th-cal-day--selected:hover {
    background: #b8934a !important;
    border-color: #b8934a !important;
}

/* Booked / unavailable dates */
.lvb-th-cal-day--booked {
    background: #ede8df;
    border-color: #cec4b6;
    color: #b0a494;
    cursor: not-allowed;
    position: relative;
    overflow: hidden;
}

.lvb-th-cal-day--booked::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 4px;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 3px,
        rgba(0,0,0,0.09) 3px,
        rgba(0,0,0,0.09) 4px
    );
    pointer-events: none;
}

/* Time hint text */
.lvb-th-time-hint {
    font-size: 0.78rem;
    color: #777;
    margin: 0.2rem 0 0;
}

/* Selected date display text */
.lvb-th-date-display {
    margin-top: 0.6rem;
    font-size: 0.9rem;
    color: #c9a96e;
    font-weight: 600;
    min-height: 1.4em;
}

/* Section divider between calendar and contact fields — on the ROW, not one field */
.lvb-th-field-row:has(input[name="first_name"]) {
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid #e8e1d5;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
    .lvb-th-wrap {
        padding: 0 0 2rem;
    }
    .lvb-th-cal-grid {
        padding: 0.5rem 0.5rem 0.75rem;
        gap: 3px;
    }
    .lvb-th-cal-day {
        font-size: 0.85rem;
    }
}

@media (max-width: 520px) {
    .lvb-th-field-row,
    .lvb-th-time-fields {
        flex-direction: column;
        gap: 0;
    }

    .lvb-th-field-row .lvb-th-field-group,
    .lvb-th-time-fields .lvb-th-field-group {
        margin-bottom: 1.5rem;
    }

    .lvb-th-btn {
        width: 100%;
        justify-content: center;
    }

    .lvb-th-radio-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .lvb-th-cal-header {
        padding: 0.7rem 0.85rem;
    }

    .lvb-th-cal-title {
        font-size: 0.92rem;
    }

    .lvb-th-cal-grid {
        gap: 2px;
        padding: 0.4rem 0.4rem 0.6rem;
    }

    .lvb-th-cal-day {
        font-size: 0.78rem;
        border-radius: 4px;
    }
}
