/*--------------------------------------------
    APPOINTMENT PAGES (choose chair, details, confirmation)
    Form fields reuse the .booking-form styles from booking-form.css
---------------------------------------------*/
.appointment-area {
    --ap-primary: #e7272d;
    --ap-primary-soft: #fdecec;
    --ap-ink: #212121;
    --ap-muted: #7a7a7a;
    --ap-line: #eeeeee;
    --ap-success: #1e8e3e;
    --ap-shadow: 0 1px 3px rgba(17, 17, 17, .06), 0 10px 30px rgba(17, 17, 17, .05);
    padding: 48px 0 90px;
    background: #f6f6f7;
}

.booking-form.ap-form {
    max-width: none;
    margin: 0;
}

.appointment-area h2,
.appointment-area h3 {
    font-family: 'Roboto', sans-serif;
    text-transform: none;
    letter-spacing: 0;
}

/* Progress steps */
.ap-steps {
    display: flex;
    max-width: 720px;
    margin: 0 auto 36px;
    padding: 0;
    list-style: none;
}

.ap-steps li {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.ap-steps li:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 17px;
    left: calc(50% + 26px);
    right: calc(-50% + 26px);
    height: 2px;
    background: #dedede;
}

.ap-steps li.is-done:not(:last-child)::after {
    background: var(--ap-primary);
}

.ap-step-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #9a9a9a;
    background: #fff;
    border: 2px solid #dcdcdc;
    border-radius: 50%;
}

.ap-steps .is-done .ap-step-dot {
    color: #fff;
    background: var(--ap-primary);
    border-color: var(--ap-primary);
}

.ap-steps .is-current .ap-step-dot {
    border-color: var(--ap-primary);
    box-shadow: 0 0 0 4px rgba(231, 39, 45, .15);
}

.ap-steps .is-current:not(.is-done) .ap-step-dot {
    color: var(--ap-primary);
}

.ap-step-label {
    font-size: 13px;
    font-weight: 500;
    color: #9a9a9a;
}

.ap-steps .is-done .ap-step-label,
.ap-steps .is-current .ap-step-label {
    color: var(--ap-ink);
}

/* Cards */
.ap-card {
    margin-bottom: 24px;
    padding: 28px;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--ap-shadow);
}

.ap-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.ap-card-title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
    color: var(--ap-ink);
}

.ap-card-sub {
    margin: 0;
    font-size: 14px;
    color: var(--ap-muted);
}

/* Location filter */
.ap-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ap-filter {
    height: 36px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ap-ink);
    background: #fff;
    border: 1px solid #dcdcdc;
    border-radius: 18px;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}

.ap-filter span {
    margin-left: 6px;
    padding: 1px 7px;
    font-size: 11px;
    color: var(--ap-muted);
    background: #f0f0f0;
    border-radius: 10px;
}

.ap-filter:hover,
.ap-filter:focus-visible {
    color: var(--ap-primary);
    border-color: var(--ap-primary);
    outline: none;
}

.ap-filter.is-active {
    color: #fff;
    background: var(--ap-ink);
    border-color: var(--ap-ink);
}

.ap-filter.is-active span {
    color: #fff;
    background: rgba(255, 255, 255, .2);
}

/* Chair cards */
.ap-chair-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
}

.ap-chair {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 26px 16px 18px;
    text-align: center;
    background: #fff;
    border: 1.5px solid #e6e6e6;
    border-radius: 14px;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .2s, background .2s;
}

.ap-chair:hover {
    border-color: #f0a2a4;
    box-shadow: 0 10px 24px rgba(17, 17, 17, .08);
    transform: translateY(-2px);
}

.ap-chair.is-hidden {
    display: none;
}

.ap-chair-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ap-chair.is-focused {
    box-shadow: 0 0 0 3px rgba(231, 39, 45, .3);
}

.ap-chair.is-selected {
    background: #fffafa;
    border-color: var(--ap-primary);
    box-shadow: 0 10px 24px rgba(231, 39, 45, .15);
}

.ap-chair-check {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 11px;
    color: transparent;
    background: #fff;
    border: 1.5px solid #d0d0d0;
    border-radius: 50%;
    transition: background .2s, border-color .2s, color .2s;
}

.ap-chair.is-selected .ap-chair-check {
    color: #fff;
    background: var(--ap-primary);
    border-color: var(--ap-primary);
}

.ap-chair-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    margin-bottom: 14px;
    overflow: hidden;
    background: var(--ap-primary-soft);
    border-radius: 50%;
    box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--ap-line);
}

.ap-chair-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ap-chair-initials {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--ap-primary);
}

.ap-chair-name {
    margin-bottom: 4px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ap-ink);
}

.ap-chair-barber {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ap-ink);
}

.ap-chair-barber i {
    color: var(--ap-primary);
}

.ap-chair-branch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--ap-muted);
}

.ap-chair-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 14px;
}

.ap-chair-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 12px;
    color: #555;
    background: #f4f4f5;
    border-radius: 20px;
}

.ap-chair-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--ap-success);
}

.ap-dot {
    width: 8px;
    height: 8px;
    background: var(--ap-success);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(30, 142, 62, .15);
}

.booking-form .bk-field.has-error .ap-chair:not(.is-selected) {
    border-color: #f3b5b2;
}

/* No chairs */
.ap-empty {
    padding: 24px 10px 8px;
    text-align: center;
}

.ap-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 16px;
    font-size: 32px;
    color: var(--ap-primary);
    background: var(--ap-primary-soft);
    border-radius: 50%;
}

.ap-empty h3 {
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 700;
}

.ap-empty p {
    max-width: 420px;
    margin: 0 auto 20px;
    color: var(--ap-muted);
}

/* Buttons */
.ap-btn,
.ap-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 22px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    border-radius: 8px;
    transition: background .2s, border-color .2s, color .2s;
}

.ap-btn {
    color: #fff;
    background: var(--ap-primary);
    border: 1px solid var(--ap-primary);
}

.ap-btn:hover,
.ap-btn:focus {
    color: #fff;
    background: var(--ap-ink);
    border-color: var(--ap-ink);
}

.ap-btn-outline {
    color: var(--ap-ink);
    background: #fff;
    border: 1px solid #dcdcdc;
}

.ap-btn-outline:hover,
.ap-btn-outline:focus {
    color: var(--ap-ink);
    border-color: var(--ap-ink);
}

/* Details form */
.booking-form .bk-optional {
    font-size: 13px;
    font-weight: 400;
    color: #9b9b9b;
}

.booking-form .bk-help {
    margin-top: 6px;
    font-size: 12px;
    color: var(--ap-muted);
}

.booking-form .bk-field.has-error .bk-help {
    display: none;
}

.booking-form .bk-textarea {
    height: auto;
    min-height: 100px;
    padding: 12px 16px;
    line-height: 1.5;
    resize: vertical;
}

.ap-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 4px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.ap-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.ap-back:hover {
    color: var(--ap-primary);
}

.booking-form .bk-submit.ap-submit {
    width: auto;
    min-width: 250px;
    margin-top: 0;
}

/* Summary */
.ap-summary {
    position: sticky;
    top: 120px;
    margin-bottom: 24px;
    padding: 24px;
    background: #fff;
    border-top: 4px solid var(--ap-primary);
    border-radius: 14px;
    box-shadow: var(--ap-shadow);
}

.ap-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.ap-summary-head h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--ap-ink);
}

.ap-summary-edit {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ap-primary);
}

.ap-summary-edit:hover {
    color: var(--ap-ink);
}

.ap-summary-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ap-summary-list li {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ap-summary-list li > i {
    display: flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 15px;
    color: var(--ap-primary);
    background: var(--ap-primary-soft);
    border-radius: 10px;
}

.ap-summary-list span {
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: #8a8a8a;
}

.ap-summary-list strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--ap-ink);
}

.ap-summary-list strong.is-empty {
    font-weight: 400;
    color: #9b9b9b;
}

.ap-summary-list small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #8a8a8a;
}

.ap-summary-note {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
    color: #555;
    background: #f7f7f8;
    border-radius: 10px;
}

.ap-summary-note i {
    margin-top: 2px;
    color: var(--ap-primary);
}

/* Confirmation */
.ap-success {
    max-width: 720px;
    margin: 0 auto;
    overflow: hidden;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--ap-shadow);
}

.ap-success-head {
    padding: 40px 32px 28px;
    text-align: center;
    background: linear-gradient(180deg, #f1f9f3 0%, #fff 100%);
}

.ap-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    margin-bottom: 22px;
    font-size: 34px;
    color: #fff;
    background: var(--ap-success);
    border-radius: 50%;
    box-shadow: 0 0 0 10px rgba(30, 142, 62, .12);
    animation: apPop .4s ease-out;
}

.ap-success-head h2 {
    margin-bottom: 10px;
    font-size: 26px;
    font-weight: 700;
    color: var(--ap-ink);
}

.ap-success-head p {
    max-width: 520px;
    margin: 0 auto 18px;
    font-size: 15px;
    line-height: 1.6;
    color: #555;
}

.ap-ref {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    color: #555;
    background: #fff;
    border: 1px dashed var(--ap-primary);
    border-radius: 8px;
}

.ap-ref strong {
    font-size: 16px;
    letter-spacing: 1px;
    color: var(--ap-primary);
}

.ap-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 32px 8px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 10px;
}

.ap-notice i {
    margin-top: 3px;
}

.ap-notice.is-success {
    color: #1b6b33;
    background: #e8f5ec;
}

.ap-notice.is-warning {
    color: #8a5300;
    background: #fff4e0;
}

.ap-success-body {
    padding: 16px 32px 8px;
}

.ap-success-chair {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
    padding: 16px;
    border: 1px solid var(--ap-line);
    border-radius: 12px;
}

.ap-success-chair .ap-chair-avatar {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    margin: 0;
}

.ap-success-chair .ap-chair-initials {
    font-size: 18px;
}

.ap-success-chair > div {
    flex: 1;
    min-width: 0;
}

.ap-success-chair strong {
    display: block;
    font-size: 16px;
    color: var(--ap-ink);
}

.ap-success-chair > div span {
    font-size: 13px;
    color: var(--ap-muted);
}

.ap-status-pill {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    color: #b26a00;
    background: #fff4e0;
    border-radius: 20px;
}

.ap-success-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 24px;
    margin: 0;
}

.ap-success-list > div {
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ap-success-list > .is-wide {
    grid-column: 1 / -1;
}

.ap-success-list dt {
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: #8a8a8a;
}

.ap-success-list dt i {
    margin-right: 6px;
    color: var(--ap-primary);
}

.ap-success-list dd {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    word-break: break-word;
    color: var(--ap-ink);
}

.ap-success-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 24px 32px 36px;
}

@keyframes apPop {
    0% { transform: scale(.6); opacity: 0; }
    70% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
}

@media (max-width: 991px) {
    .ap-summary {
        position: static;
    }
}

@media (max-width: 575px) {
    .appointment-area {
        padding: 32px 0 60px;
    }

    .ap-steps {
        margin-bottom: 24px;
    }

    .ap-step-label {
        font-size: 11px;
    }

    .ap-card,
    .ap-summary {
        padding: 20px;
    }

    .ap-chair-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .ap-chair {
        padding: 20px 10px 14px;
    }

    .ap-chair-avatar {
        width: 60px;
        height: 60px;
    }

    .ap-chair-name {
        font-size: 14px;
    }

    .ap-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .booking-form .bk-submit.ap-submit {
        width: 100%;
        min-width: 0;
    }

    .ap-back {
        justify-content: center;
    }

    .ap-success-head {
        padding: 32px 20px 24px;
    }

    .ap-success-head h2 {
        font-size: 22px;
    }

    .ap-notice {
        margin: 0 20px 8px;
    }

    .ap-success-body {
        padding: 16px 20px 8px;
    }

    .ap-success-chair {
        flex-wrap: wrap;
    }

    .ap-success-list {
        grid-template-columns: 1fr;
    }

    .ap-success-actions {
        padding: 20px 20px 28px;
    }

    .ap-success-actions a {
        width: 100%;
    }
}
