/* ========== Variables ========== */
:root {
    --appt-primary: #2D4639;
    --appt-primary-light: #3d5c4a;
    --appt-primary-dark: #1e3028;
    --appt-gold: #c4a265;
    --appt-text-muted: #5a6b62;
    --appt-border: rgba(45, 70, 57, 0.15);
    --appt-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#think_page_trace_open,#think_page_trace{
    display: none;
}

.layui-layer-content {
    position: relative;
}

.appt-html {
    height: 100%;
}

/* iframe 內頁面 */
.appt-body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    font-family: 'Noto Sans SC', sans-serif;
    background: #fff;
    color: var(--appt-primary);
    -webkit-font-smoothing: antialiased;
}

.appt {
    width: 100%;
    min-height: 100%;
    padding: 24px 28px 72px;
    box-sizing: border-box;
}

/* ========== Header ========== */
.appt__header {
    margin-bottom: 24px;
}

.appt__title {
    font-size: 1.35rem;
    font-weight: 500;
    margin: 0 0 8px;
    color: var(--appt-primary);
}

.appt__subtitle {
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--appt-text-muted);
    margin: 0;
    line-height: 1.6;
}

/* ========== Steps ========== */
.appt-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
}

.appt-steps__item {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.45;
    transition: var(--appt-transition);
}

.appt-steps__item.active {
    opacity: 1;
}

.appt-steps__item.done {
    opacity: 0.75;
}

.appt-steps__num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.82rem;
    font-weight: 500;
    border: 2px solid var(--appt-border);
    color: var(--appt-text-muted);
    transition: var(--appt-transition);
}

.appt-steps__item.active .appt-steps__num {
    background: linear-gradient(135deg, var(--appt-primary), var(--appt-primary-light));
    border-color: transparent;
    color: #fff;
}

.appt-steps__item.done .appt-steps__num {
    background: var(--appt-gold);
    border-color: transparent;
    color: #fff;
}

.appt-steps__line {
    width: 28px;
    height: 2px;
    background: linear-gradient(90deg, var(--appt-border), var(--appt-gold), var(--appt-border));
    margin: 0 10px;
    flex-shrink: 0;
}

.appt-steps__text {
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--appt-primary);
    white-space: nowrap;
}

/* ========== Panels ========== */
.appt-panel {
    display: none;
    animation: apptFadeIn 0.35s ease;
}

.appt-panel--active {
    display: block;
}

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

/* ========== Form Fields ========== */
.appt-field {
    margin-bottom: 20px;
}

.appt-field--row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.appt-field__col {
    flex: 1;
    min-width: 0;
}

.appt-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--appt-primary);
    margin-bottom: 8px;
}

.appt-required {
    color: #c55050;
}

.appt-input,
.appt-textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 300;
    color: var(--appt-primary);
    background: #fff;
    border: 1px solid var(--appt-border);
    border-radius: 8px;
    box-sizing: border-box;
    transition: var(--appt-transition);
    height: auto;
    line-height: 1.5;
}

.appt-textarea {
    resize: vertical;
    min-height: 100px;
}

.appt-input:focus,
.appt-textarea:focus {
    outline: none;
    border-color: var(--appt-primary);
    box-shadow: 0 0 0 3px rgba(45, 70, 57, 0.1);
}

.appt-input::placeholder,
.appt-textarea::placeholder {
    color: rgba(45, 70, 57, 0.4);
}

.appt-hint {
    font-size: 0.78rem;
    font-weight: 300;
    color: var(--appt-text-muted);
    margin: 10px 0 0;
}

/* ========== Date availability legend & calendar ========== */
.appt-date-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-top: 10px;
}

.appt-date-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--appt-text-muted);
}

.appt-avail-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    vertical-align: middle;
}

.appt-avail-dot--free {
    background: #2f9e6e;
}

.appt-avail-dot--busy {
    background: #d4a017;
}

.appt-avail-dot--full {
    background: #c55050;
}

#apptDate {
    cursor: pointer;
}

/* Layui select override */
.appt-form .layui-form-select dl {
    top: 46px;
    border-radius: 8px;
    border-color: var(--appt-border);
}

.appt-form .layui-form-select dl dd.layui-this {
    background-color: white;
    color: var(--appt-primary);
}

.appt-form .layui-input {
    border-radius: 8px;
    border-color: var(--appt-border);
    height: 44px;
}

.appt-form .layui-form-select .layui-edge {
    border-top-color: var(--appt-primary);
}

/* ========== Time Slots ========== */
.appt-times {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.appt-time-slot {
    padding: 10px 4px;
    font-size: 0.82rem;
    font-weight: 400;
    text-align: center;
    color: var(--appt-primary);
    background: #fff;
    border: 1px solid var(--appt-border);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--appt-transition);
}



.appt-time-slot.selected {
    background: linear-gradient(135deg, var(--appt-primary), var(--appt-primary-light));
    background-size: 200% 200%;
    animation: apptGradient 4s ease infinite;
    border-color: transparent;
    color: #fff;
}

.appt-time-slot.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* ========== Region / District chips ========== */
.appt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.appt-chip {
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 400;
    font-family: inherit;
    color: var(--appt-primary);
    background: #fff;
    border: 1px solid var(--appt-border);
    border-radius: 50px;
    cursor: pointer;
    transition: var(--appt-transition);
}

.appt-chip:hover {
    border-color: var(--appt-primary);
    background: rgba(45, 70, 57, 0.04);
}

.appt-chip.selected {
    background: linear-gradient(135deg, var(--appt-primary), var(--appt-primary-light));
    border-color: transparent;
    color: #fff;
}

/* ========== Places ========== */
.appt-places {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.appt-place {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    padding: 12px 14px;
    text-align: left;
    font-family: inherit;
    color: var(--appt-primary);
    background: #fff;
    border: 1px solid var(--appt-border);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--appt-transition);
}

.appt-place:hover {
    border-color: var(--appt-primary);
    background: rgba(45, 70, 57, 0.04);
}

.appt-place.selected {
    border-color: var(--appt-primary);
    background: rgba(45, 70, 57, 0.06);
    box-shadow: inset 0 0 0 1px var(--appt-primary);
}

.appt-place__name {
    font-size: 0.9rem;
    font-weight: 500;
}

.appt-place__meta {
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--appt-text-muted);
}

/* ========== Services ========== */
.appt-services {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.appt-service {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    padding: 12px 14px;
    text-align: left;
    font-family: inherit;
    color: var(--appt-primary);
    background: #fff;
    border: 1px solid var(--appt-border);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--appt-transition);
}

.appt-service:hover {
    border-color: var(--appt-gold);
    background: rgba(196, 162, 101, 0.06);
}

.appt-service.selected {
    border-color: var(--appt-gold);
    background: rgba(196, 162, 101, 0.1);
    box-shadow: inset 0 0 0 1px var(--appt-gold);
}

.appt-service__name {
    font-size: 0.9rem;
    font-weight: 500;
}

.appt-service__desc {
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--appt-text-muted);
}

@keyframes apptGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ========== Summary ========== */
.appt-summary {
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(45, 70, 57, 0.05) 0%, rgba(196, 162, 101, 0.08) 100%);
    border-radius: 8px;
    border-left: 3px solid var(--appt-gold);
    margin-bottom: 20px;
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--appt-text-muted);
    line-height: 1.7;
    display: none;
}

.appt-summary.visible {
    display: block;
}

.appt-summary strong {
    color: var(--appt-primary);
    font-weight: 500;
}

/* ========== Buttons ========== */
.appt-actions {
    width: 100%;
    padding:  12px 0;
    position: fixed;
    left: 0;
    bottom: 0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 -2px 12px rgba(45, 70, 57, 0.08);
}

.appt-actions--split {
    display: flex;
    gap: 12px;
}

.appt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80%;
    padding: 13px 24px;
    font-size: 0.92rem;
    font-weight: 500;
    font-family: inherit;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: var(--appt-transition);
}

.appt-actions--split .appt-btn {
    flex: 1;
}

.appt-btn--primary {
    background: linear-gradient(135deg, var(--appt-primary) 0%, var(--appt-primary-light) 50%, var(--appt-primary-dark) 100%);
    background-size: 200% 200%;
    animation: apptGradient 5s ease infinite;
    color: #fff;
    margin-right: 12px;
}

#apptNext1 {
    margin-right: 0;
}

.appt-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 70, 57, 0.3);
}

.appt-btn--outline {
    background: #fff;
    color: var(--appt-primary);
    border: 1.5px solid var(--appt-border);
    margin-left: 12px;
}

.appt-btn--outline:hover {
    border-color: var(--appt-primary);
    background: rgba(45, 70, 57, 0.04);
}

/* ========== Layer skin (parent page) ========== */
.appt-layer.layui-layer {
    border-radius: 12px !important;
    overflow: hidden;
}

.appt-layer .layui-layer-content {
    overflow: hidden !important;
}

.appt-layer .layui-layer-setwin {
    top: 16px;
    right: 16px;
}

.appt-layer .layui-layer-setwin .layui-layer-close1 {
    opacity: 0.6;
    transition: opacity 0.2s;
}

.appt-layer .layui-layer-setwin .layui-layer-close1:hover {
    opacity: 1;
}

/* ========== Responsive ========== */
@media (max-width: 520px) {
    .appt {
        padding: 20px 18px 72px;
    }

    .appt-steps__text {
        font-size: 0.75rem;
    }

    .appt-steps__line {
        flex: 1;
        width: 16px;
        margin: 0 6px;
    }

    .appt-times {
        grid-template-columns: repeat(3, 1fr);
    }

    .appt-field--row {
        flex-direction: column;
        gap: 20px;

        .appt-field__col {
            width: 100%;
        }
    }
}

@media (max-width: 380px) {
    .appt-times {
        grid-template-columns: repeat(3, 1fr);
    }

    .appt-steps__text {
        display: none;
    }
}
