/* ============================================================
   KHM Booking Form CSS — Polished v2
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Wrapper ────────────────────────────────────────────── */
.khm-booking-wrapper {
    max-width: 800px;
    background: #fff;
    padding: 40px 45px;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
}

/* ── Form title (tuỳ chọn, thêm vào shortcode wrapper) ─── */
.khm-booking-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a2332;
    margin: 0 0 6px;
}
.khm-booking-desc {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 28px;
}

.khm-booking-form {
    display: block;
    width: 100%;
}

/* ── Grid layout ────────────────────────────────────────── */
.khm-booking-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -12px;
}
.khm-booking-col {
    padding: 0 12px;
    margin-bottom: 20px;
    box-sizing: border-box;
    position: relative;
}
.khm-col-full  { width: 100%; }
.khm-col-half  { width: 50%; }

/* ── Labels ─────────────────────────────────────────────── */
.khm-booking-label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 7px;
    font-weight: 600;
    color: #1a2332;
    font-size: 14px;
}
.khm-req { color: #ef4444; font-weight: 600; font-size: 13px; }

/* ── Custom Placeholder Overlay ─────────────────────────── */
.khm-placeholder-overlay {
    position: absolute;
    left: 28px; /* Column padding 12px + Input padding 16px */
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 44px);
    display: flex;
    align-items: center;
    gap: 4px;
}
textarea.khm-booking-input ~ .khm-placeholder-overlay {
    top: 26px;
    transform: none;
}
.khm-booking-input:focus ~ .khm-placeholder-overlay,
.khm-booking-input:not(:placeholder-shown) ~ .khm-placeholder-overlay {
    opacity: 0;
    visibility: hidden;
}

/* ── Inputs ─────────────────────────────────────────────── */
.khm-booking-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    color: #1a2332;
    background: #f8fafc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}
.khm-booking-input:hover {
    border-color: #cbd5e1;
}
.khm-booking-input:focus {
    border-color: #27ae60;
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.12);
}

textarea.khm-booking-input {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

select.khm-booking-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 44px;
}

/* ── Radio & Checkbox ───────────────────────────────────── */
.khm-booking-radio-group,
.khm-booking-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    padding-top: 6px;
}
.khm-booking-radio,
.khm-booking-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    gap: 8px;
    padding: 8px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.15s ease;
    background: #f8fafc;
}
.khm-booking-radio:hover,
.khm-booking-checkbox:hover {
    border-color: #27ae60;
    background: #f0fdf4;
}
.khm-booking-radio input,
.khm-booking-checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #27ae60;
    margin: 0;
}

/* ── Submit button ──────────────────────────────────────── */
.khm-booking-submit-wrap {
    margin-top: 20px;
    text-align: center;
}
.khm-booking-submit-btn {
    background: #28b44f!important; /* Solid vibrant flat green exactly like the photo */
    color: #fff!important;
    border: none!important;
    border-radius: 7px!important;
    padding: 13px 40px;
    font-size: 17px;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 220px;
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.2px;
}
.khm-booking-submit-btn:hover:not(:disabled) {
    background: #219643; /* Darker green on hover, flat style without shadow */
}
.khm-booking-submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

/* ── reCAPTCHA Centering ────────────────────────────────── */
.g-recaptcha {
    display: flex;
    justify-content: center;
    margin-bottom: 5px;
}

/* ── Spinner bên trong nút ──────────────────────────────── */
.khm-btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: khmSpin 0.7s linear infinite;
    display: none;
    flex-shrink: 0;
}
@keyframes khmSpin {
    to { transform: rotate(360deg); }
}

/* ── Alert lỗi — có animation ──────────────────────────── */
.khm-booking-alert {
    padding: 14px 18px;
    margin-bottom: 24px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: khmAlertIn 0.3s ease;
}
@keyframes khmAlertIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.khm-booking-alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
}
.khm-booking-alert-error::before {
    content: '⚠';
    font-size: 16px;
    line-height: 1.2;
    flex-shrink: 0;
}

/* ── Trang cảm ơn ───────────────────────────────────────── */
.khm-thankyou-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #27ae60, #1e8449);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    animation: khmBounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes khmBounceIn {
    0%   { transform: scale(0); opacity: 0; }
    70%  { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}
.khm-thankyou-title {
    font-size: 26px;
    font-weight: 700;
    color: #1a2332;
    margin: 0 0 10px;
    font-family: 'Inter', sans-serif;
}
.khm-thankyou-subtitle {
    color: #6b7280;
    font-size: 15px;
    margin: 0 0 30px;
    line-height: 1.6;
}
.khm-thankyou-card {
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 28px;
}
.khm-thankyou-card table {
    width: 100%;
    border-collapse: collapse;
}
.khm-thankyou-card tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}
.khm-thankyou-card tr:last-child { border-bottom: none; }
.khm-thankyou-card tr:hover { background: #f8fafc; }
.khm-thankyou-card td {
    padding: 13px 18px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}
.khm-thankyou-card td:first-child {
    color: #6b7280;
    width: 38%;
    font-weight: 500;
}
.khm-thankyou-card td:last-child {
    color: #1a2332;
    font-weight: 600;
    text-align: right;
}
.khm-thankyou-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.khm-thankyou-btn {
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}
.khm-thankyou-btn-outline {
    background: #f8fafc;
    color: #374151;
    border: 1.5px solid #e2e8f0;
}
.khm-thankyou-btn-outline:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
    color: #1a2332;
}
.khm-thankyou-btn-primary {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    color: #fff;
    border: none;
}
.khm-thankyou-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(39,174,96,0.3);
    color: #fff;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .khm-col-half { width: 100%; }
    .khm-booking-wrapper {
        padding: 24px 18px;
        margin: 16px;
        border-radius: 12px;
    }
    .khm-booking-submit-btn { width: 100%; }
    .khm-booking-radio,
    .khm-booking-checkbox { width: 100%; }
    .khm-thankyou-card td { padding: 10px 14px; }
    .khm-thankyou-card td:first-child { width: 45%; }
}
