/**
 * Guesty × Xendit Booking — Form Styles
 *
 * Designed to look good within the Helene's House Bali theme.
 * Uses neutral, warm tones. Override the custom properties below
 * to match any WordPress theme.
 */

:root {
    --gxb-primary:    #2c3e2d;
    --gxb-primary-hover: #3d5a3f;
    --gxb-accent:     #c8a96e;
    --gxb-bg:         #faf8f5;
    --gxb-card-bg:    #ffffff;
    --gxb-text:       #2c2c2c;
    --gxb-text-muted: #7a7a7a;
    --gxb-border:     #e5e0d8;
    --gxb-error:      #b94a48;
    --gxb-success:    #3d7a3f;
    --gxb-radius:     8px;
    --gxb-shadow:     0 2px 12px rgba(0, 0, 0, 0.06);
    --gxb-font:       -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ── Widget container ──────────────────────────────────────── */

.gxb-booking-widget {
    position: relative;
    max-width: 480px;
    margin: 0 auto;
    font-family: var(--gxb-font);
    color: var(--gxb-text);
    background: var(--gxb-card-bg);
    border: 1px solid var(--gxb-border);
    border-radius: var(--gxb-radius);
    box-shadow: var(--gxb-shadow);
    overflow: hidden;
}

/* ── Steps ─────────────────────────────────────────────────── */

.gxb-step {
    display: none;
    padding: 24px;
}
.gxb-step--active {
    display: block;
}

.gxb-step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.gxb-step-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

/* ── Header / Listing info ─────────────────────────────────── */

.gxb-widget-header {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: center;
}

.gxb-listing-photo {
    width: 80px;
    height: 80px;
    border-radius: var(--gxb-radius);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.gxb-listing-title {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
}

.gxb-base-price {
    margin: 0;
    font-size: 14px;
    color: var(--gxb-text-muted);
}
.gxb-base-price strong {
    color: var(--gxb-text);
    font-weight: 600;
}

/* ── Form elements ─────────────────────────────────────────── */

.gxb-form-section {
    margin-bottom: 20px;
}

.gxb-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gxb-text-muted);
    margin-bottom: 10px;
}

.gxb-date-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.gxb-date-field {
    flex: 1;
}

.gxb-date-field label,
.gxb-guest-field label,
.gxb-field label {
    display: block;
    font-size: 12px;
    color: var(--gxb-text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

.gxb-date-separator {
    padding-bottom: 10px;
    color: var(--gxb-text-muted);
    font-size: 16px;
}

.gxb-guests-row {
    margin-top: 12px;
}

.gxb-field-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}
.gxb-field-row .gxb-field {
    flex: 1;
}
.gxb-field {
    margin-bottom: 12px;
}

.gxb-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    font-family: var(--gxb-font);
    border: 1px solid var(--gxb-border);
    border-radius: 6px;
    background: var(--gxb-bg);
    color: var(--gxb-text);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.gxb-input:focus {
    outline: none;
    border-color: var(--gxb-accent);
    box-shadow: 0 0 0 3px rgba(200, 169, 110, 0.15);
}
.gxb-input::placeholder {
    color: #b5b0a8;
}

select.gxb-input {
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237a7a7a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* ── Buttons ───────────────────────────────────────────────── */

.gxb-btn {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--gxb-font);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s, transform 0.1s;
}
.gxb-btn:active {
    transform: scale(0.99);
}
.gxb-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gxb-btn--primary {
    background: var(--gxb-primary);
    color: #fff;
}
.gxb-btn--primary:hover:not(:disabled) {
    background: var(--gxb-primary-hover);
}

.gxb-btn--pay {
    background: var(--gxb-accent);
    color: #1a1a1a;
    font-size: 16px;
}
.gxb-btn--pay:hover:not(:disabled) {
    background: #b8993e;
}

.gxb-back-btn {
    background: none;
    border: 1px solid var(--gxb-border);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--gxb-text-muted);
    cursor: pointer;
    font-family: var(--gxb-font);
    transition: background 0.15s;
}
.gxb-back-btn:hover {
    background: var(--gxb-bg);
}

/* ── Pricing breakdown ─────────────────────────────────────── */

.gxb-summary-bar {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--gxb-text-muted);
    border-bottom: 1px solid var(--gxb-border);
}

.gxb-price-breakdown {
    margin-bottom: 16px;
}

.gxb-price-line {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}
.gxb-price-line span:first-child {
    color: var(--gxb-text-muted);
}

.gxb-price-total {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    margin-bottom: 16px;
    border-top: 2px solid var(--gxb-text);
    font-size: 18px;
    font-weight: 700;
}
.gxb-price-total--small {
    font-size: 16px;
    border-top-width: 1px;
    border-color: var(--gxb-border);
    padding: 12px 0;
}

/* ── Messages ──────────────────────────────────────────────── */

.gxb-message {
    margin-top: 12px;
    padding: 0;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 6px;
    display: none;
}
.gxb-message--visible {
    display: block;
    padding: 10px 14px;
}
.gxb-message--error {
    background: #fef2f2;
    color: var(--gxb-error);
    border: 1px solid #fecaca;
}
.gxb-message--success {
    background: #f0fdf4;
    color: var(--gxb-success);
    border: 1px solid #bbf7d0;
}

.gxb-secure-note {
    margin-top: 12px;
    font-size: 12px;
    color: var(--gxb-text-muted);
    text-align: center;
    line-height: 1.5;
}

/* ── Loading overlay ───────────────────────────────────────── */

.gxb-loading {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    z-index: 10;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.gxb-loading--visible {
    display: flex;
}

.gxb-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--gxb-border);
    border-top-color: var(--gxb-primary);
    border-radius: 50%;
    animation: gxb-spin 0.7s linear infinite;
}
@keyframes gxb-spin {
    to { transform: rotate(360deg); }
}

.gxb-loading p {
    margin: 0;
    font-size: 14px;
    color: var(--gxb-text-muted);
}

/* ── Success page ──────────────────────────────────────────── */

.gxb-success-page {
    max-width: 480px;
    margin: 40px auto;
    font-family: var(--gxb-font);
}

.gxb-success-card {
    text-align: center;
    padding: 40px 32px;
    background: var(--gxb-card-bg);
    border: 1px solid var(--gxb-border);
    border-radius: var(--gxb-radius);
    box-shadow: var(--gxb-shadow);
}

.gxb-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: var(--gxb-success);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
}
.gxb-pending-icon {
    background: var(--gxb-accent);
    color: #1a1a1a;
}

.gxb-success-card h2 {
    margin: 0 0 8px;
    font-size: 22px;
}

.gxb-confirmation-code {
    font-size: 16px;
    margin-bottom: 20px;
}

.gxb-success-details {
    text-align: left;
    background: var(--gxb-bg);
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}
.gxb-success-details p {
    margin: 6px 0;
    font-size: 14px;
}

.gxb-small {
    font-size: 13px;
    color: var(--gxb-text-muted);
}

/* ── Flatpickr overrides ───────────────────────────────────── */

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    background: #fef2f2 !important;
    color: #d4a0a0 !important;
    text-decoration: line-through;
}
.flatpickr-day.selected {
    background: var(--gxb-primary) !important;
    border-color: var(--gxb-primary) !important;
}
.flatpickr-day.inRange {
    background: rgba(44, 62, 45, 0.08) !important;
    border-color: transparent !important;
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 520px) {
    .gxb-booking-widget {
        max-width: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    .gxb-field-row {
        flex-direction: column;
        gap: 0;
    }
}

/* ── Error state for inputs ────────────────────────────────── */

.gxb-input--error {
    border-color: var(--gxb-error) !important;
    box-shadow: 0 0 0 3px rgba(185, 74, 72, 0.12) !important;
}
