/* ============================================
   Đặt lịch bảo dưỡng - VinFast Style
   ============================================ */
.dlbd-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 60px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1a1a1a;
    font-size: 14px;
}

.dlbd-title {
    margin: 40px 0 32px;
    padding: 0;
    font-size: 32px;
    font-weight: 400;
    text-align: center;
    color: #1a1a1a;
    line-height: 1.3;
}

/* Ẩn tiêu đề trang WordPress/Bricks trùng với form */
body:has(.dlbd-wrap) .brxe-post-title,
body:has(.dlbd-wrap) .brxe-page-title,
body:has(.dlbd-wrap) .brxe-wordpress .post-title,
body:has(.dlbd-wrap) #brx-content > .brxe-section:first-child .brxe-post-title,
body:has(.dlbd-wrap) #brx-content > .brxe-section:first-child > .brxe-container > .brxe-heading:first-child {
    display: none !important;
}

/* 2-column layout */
.dlbd-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
    position: relative;
}

.dlbd-form-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow: visible;
}

.dlbd-form-col--left {
    position: relative;
    z-index: 5;
}

/* Section card */
.dlbd-section {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 24px 28px;
    overflow: visible;
}

.dlbd-section--services {
    position: relative;
    z-index: 10;
}

.dlbd-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 20px;
    color: #1a1a1a;
}

.dlbd-section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #555;
    color: #fff;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.dlbd-section-num--active {
    background: #1464F4;
}

/* Fields */
.dlbd-field {
    margin-bottom: 16px;
}

.dlbd-field:last-child {
    margin-bottom: 0;
}

.dlbd-field > label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.dlbd-req {
    color: #1464F4;
}

.dlbd-grid {
    display: grid;
    gap: 12px;
}

.dlbd-grid-2 {
    grid-template-columns: 1fr 1fr;
}

/* Text inputs */
.dlbd-field input[type="text"],
.dlbd-field input[type="tel"],
.dlbd-field input[type="email"],
.dlbd-field input[type="date"],
.dlbd-field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    color: #1a1a1a;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.dlbd-field input::placeholder,
.dlbd-field textarea::placeholder {
    color: #aaa;
}

.dlbd-field input:focus,
.dlbd-field textarea:focus {
    outline: none;
    border-color: #1464F4;
}

.dlbd-field textarea {
    resize: vertical;
    min-height: 90px;
}

/* Name counter */
.dlbd-input-wrap {
    position: relative;
}

.dlbd-input-wrap input {
    width: 100%;
    padding: 11px 50px 11px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

.dlbd-input-wrap input:focus {
    outline: none;
    border-color: #1464F4;
}

.dlbd-char-count {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #999;
    pointer-events: none;
}

/* Custom select */
.dlbd-select-wrap {
    position: relative;
}

.dlbd-select {
    width: 100%;
    padding: 11px 36px 11px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    color: #1a1a1a;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.dlbd-select:focus {
    outline: none;
    border-color: #1464F4;
}

.dlbd-select:disabled {
    background: #f7f7f7;
    color: #aaa;
    cursor: not-allowed;
}

.dlbd-select option[value=""] {
    color: #aaa;
}

.dlbd-select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #666;
    pointer-events: none;
}

/* Date / time icons */
.dlbd-input-icon-wrap {
    position: relative;
}

.dlbd-input-icon-wrap input[type="date"] {
    width: 100%;
    padding: 11px 36px 11px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    color: #1a1a1a;
}

.dlbd-input-icon-wrap input[type="date"]:focus {
    outline: none;
    border-color: #1464F4;
}

.dlbd-input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    pointer-events: none;
    opacity: 0.5;
}

.dlbd-icon-calendar {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center/contain no-repeat;
}

.dlbd-icon-clock {
    border: none;
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Consent checkbox (reuse svc style) */
.dlbd-consent input,
.dlbd-radio input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.dlbd-svc-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 3px;
    flex-shrink: 0;
    transition: all 0.15s;
    position: relative;
}

.dlbd-svc-checkbox::after {
    content: '';
    display: none;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.dlbd-consent input:checked + .dlbd-svc-checkbox {
    background: #1464F4;
    border-color: #1464F4;
}

.dlbd-consent input:checked + .dlbd-svc-checkbox::after {
    display: block;
}

/* ---- Service tree (VinFast expandable) ---- */
.dlbd-field-services {
    position: relative;
}

.dlbd-service-tree {
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: visible;
}

.dlbd-service-tree .group-item-checkbox {
    border-bottom: 1px solid #f0f0f0;
}

.dlbd-service-tree .group-item-checkbox:last-child {
    border-bottom: none;
}

.dlbd-service-tree > .group-item-checkbox > .expandable {
    position: relative;
    padding: 0;
}

.dlbd-service-tree .service-checkbox {
    position: absolute;
    opacity: 0;
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    z-index: 2;
    left: 14px;
    top: 14px;
}

.dlbd-service-tree > .group-item-checkbox > .expandable > .service-checkbox {
    top: 14px;
}

.dlbd-service-tree .service-checkbox + label {
    display: block;
    padding: 12px 110px 12px 42px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    position: relative;
    margin: 0;
    line-height: 1.4;
}

.dlbd-service-tree .service-checkbox + label::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 3px;
    background: #fff;
    box-sizing: border-box;
    transition: all 0.15s;
}

.dlbd-service-tree .service-checkbox:checked + label::before {
    background: #1464F4;
    border-color: #1464F4;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3 3 7-7' stroke='%23fff' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
}

.dlbd-service-tree .service-checkbox:checked + label,
.dlbd-service-tree .expandable.active > .service-checkbox:checked + label {
    background: #f0f6ff;
}

.dlbd-service-tree .service-checkbox:checked + label.has-summary {
    background: #f0f6ff;
}

.dlbd-svc-name {
    font-weight: 600;
}

.dlbd-svc-summary {
    font-weight: 400;
    color: #333;
}

.dlbd-service-list-expand-lv1 .service-checkbox + label .dlbd-svc-name {
    font-weight: 500;
}

/* Field validation */
.dlbd-field-error {
    display: block;
    color: #e53935;
    font-size: 12px;
    margin-top: 6px;
}

.dlbd-input-invalid {
    border-color: #e53935 !important;
}

.dlbd-field-error[hidden] {
    display: none;
}

.dlbd-service-tree .add-detail,
.dlbd-service-tree .add-detail_child {
    position: absolute;
    right: 14px;
    top: 13px;
    color: #1464F4;
    font-size: 13px;
    cursor: pointer;
    z-index: 3;
    user-select: none;
}

.dlbd-service-tree .service-list-expand-lv1 .add-detail_child {
    top: 50%;
    transform: translateY(-50%);
    right: calc(50% + 14px);
    left: auto;
}

.dlbd-service-tree .add-detail:hover,
.dlbd-service-tree .add-detail_child:hover {
    text-decoration: underline;
}

/* Anti-spam honeypot */
.dlbd-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* Level 1 panel — vừa cột trái */
.dlbd-service-tree .service-list-expand-lv1 {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    z-index: 50;
    overflow: visible;
}

.dlbd-service-tree .expandable.open-lv1 > .service-list-expand-lv1 {
    display: block;
}

.dlbd-service-tree .service-list-expand-lv1 > .expandable,
.dlbd-service-tree .service-list-expand-lv1 > div:not(.expandable) {
    position: relative;
    border-bottom: 1px solid #f5f5f5;
    overflow: visible;
}

/* Level 1 items: left half only */
.dlbd-service-tree .service-list-expand-lv1 > .expandable > .service-checkbox + label,
.dlbd-service-tree .service-list-expand-lv1 > div:not(.expandable) > .service-checkbox + label {
    max-width: none;
    padding-right: 110px;
}

.dlbd-service-tree .service-list-expand-lv1 .add-detail_child {
    right: 14px;
}

.dlbd-service-tree .service-list-expand-lv1 .service-checkbox {
    left: 14px;
    top: 12px;
}

.dlbd-service-tree .service-list-expand-lv1 .service-checkbox + label {
    padding: 10px 110px 10px 42px;
}

.dlbd-service-tree .service-list-expand-lv1 > div:not(.expandable) .service-checkbox + label {
    padding-right: 14px;
}

/* Level 2 panel — flyout gọn sang cột phải */
.dlbd-service-tree .service-list-expand-lv2 {
    display: none;
    position: absolute;
    left: calc(100% + 24px);
    top: 0;
    width: 300px;
    max-width: calc(50vw - 20px);
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 80;
    padding: 6px 0;
    max-height: 320px;
    overflow-y: auto;
}

.dlbd-service-tree .expandable.open-lv2 > .service-list-expand-lv2 {
    display: block;
}

.dlbd-lv2-list {
    display: flex;
    flex-direction: column;
}

.dlbd-lv2-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}

.dlbd-lv2-row:hover {
    background: #fafafa;
}

.dlbd-lv2-row:has(.service-checkbox:checked) {
    background: #f0f6ff;
}

.dlbd-lv2-row .service-checkbox {
    position: static;
    opacity: 1;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    flex-shrink: 0;
    accent-color: #1464F4;
    cursor: pointer;
}

.dlbd-lv2-text {
    flex: 1;
    color: #333;
}

/* Painting note */
.dlbd-service-tree .service_paintingNote {
    font-size: 12px;
    color: #888;
    padding: 8px 14px 12px;
    margin: 0;
    line-height: 1.5;
    font-style: italic;
}

/* Radio buttons */
.dlbd-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dlbd-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.dlbd-radio-dot {
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.15s;
}

.dlbd-radio input:checked + .dlbd-radio-dot {
    border-color: #1464F4;
}

.dlbd-radio input:checked + .dlbd-radio-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #1464F4;
    border-radius: 50%;
}

.dlbd-radio-label {
    font-size: 14px;
    color: #333;
}

/* Upload */
.dlbd-upload-area {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.dlbd-upload-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dlbd-upload-preview {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.dlbd-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dlbd-upload-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.dlbd-upload-btn {
    width: 80px;
    height: 80px;
    border: 1px dashed #ccc;
    border-radius: 4px;
    background: #fafafa;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, color 0.2s;
    padding: 0;
}

.dlbd-upload-btn:hover {
    border-color: #1464F4;
    color: #1464F4;
}

.dlbd-upload-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Footer */
.dlbd-footer {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

.dlbd-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 24px;
}

.dlbd-consent-text {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}

.dlbd-consent-text a {
    color: #1464F4;
    text-decoration: none;
}

.dlbd-consent-text a:hover {
    text-decoration: underline;
}

/* Submit */
.dlbd-submit {
    display: block;
    width: 100%;
    padding: 14px;
    background: #ccc;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: not-allowed;
    font-family: inherit;
    transition: background 0.2s;
}

.dlbd-submit--active,
.dlbd-submit:not(:disabled) {
    background: #555;
    cursor: pointer;
}

.dlbd-submit--active:hover,
.dlbd-submit:not(:disabled):hover {
    background: #333;
}

.dlbd-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Error toast */
.dlbd-error-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #e53935;
    color: #fff;
    padding: 14px 28px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    animation: dlbd-slide-up 0.3s ease;
}

@keyframes dlbd-slide-up {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Success */
.dlbd-success {
    text-align: center;
    padding: 60px 20px;
}

.dlbd-success-icon {
    width: 72px;
    height: 72px;
    background: #4caf50;
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin-bottom: 24px;
}

.dlbd-success h2 {
    font-size: 24px;
    margin: 0 0 12px;
}

.dlbd-success p {
    font-size: 15px;
    color: #666;
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto 28px;
}

/* Responsive */
@media (max-width: 860px) {
    .dlbd-form-grid {
        grid-template-columns: 1fr;
    }

    .dlbd-service-tree .service-list-expand-lv1 {
        width: 100%;
        position: relative;
        box-shadow: none;
        border: none;
        border-top: 1px solid #f0f0f0;
    }

    .dlbd-service-tree .service-list-expand-lv1 .add-detail_child {
        right: 14px;
    }

    .dlbd-service-tree .service-list-expand-lv2 {
        position: relative;
        left: 0;
        top: 0;
        width: 100%;
        max-width: none;
        margin: 0;
        box-shadow: none;
        border: none;
        border-top: 1px solid #f0f0f0;
        max-height: none;
    }
}

@media (max-width: 480px) {
    .dlbd-section {
        padding: 18px 16px;
    }

    .dlbd-grid-2 {
        grid-template-columns: 1fr;
    }
}
