/* appointment.css - booking page and My Appointments (loaded after public.css, uses its variables) */

/* 1. Page area and heading */

/* toggled by appointment.js */
.hidden {
    display: none !important;
}

/* 2. Step indicator */

/* connecting line */

.step {
    position: relative; /* above the line */
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    text-align: center;
}

/* step circle (not reached yet) */
.step span {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 2px solid #C9D2DD;
    border-radius: 50%;
    background: var(--white);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-soft);
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

/* step labels hidden on phones */
.step p {
    display: none;
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-soft);
}

/* current step */
.step.active span {
    border-color: var(--navy);
    background: var(--navy);
    color: var(--white);
}
.step.active p {
    color: var(--navy);
    font-weight: 600;
}

/* show step labels from 640px */
@media (min-width: 640px) {
    .step p {
        display: block;
    }
}

/* 3. Time slots */

/* 3 per row on phones, 5 from 640px */
.time-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.625rem;
}

@media (min-width: 640px) {
    .time-slots {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* slot button (created by appointment.js) */
.time-slot {
    min-height: 44px;
    padding: 0.5rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--navy);
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

/* hover */
.time-slot:hover {
    border-color: var(--sky);
    background: var(--sky-light);
}

/* selected slot */
.time-slot.selected {
    border-color: var(--navy);
    background: var(--navy);
    color: var(--white);
}

/* time with a small status label underneath */
.time-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
}
.slot-note {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* booked or passed: striped, crossed out, not clickable */
.time-slot.unavailable,
.time-slot:disabled {
    border-color: #DCE0E6;
    border-style: dashed;
    background: repeating-linear-gradient(135deg, #F1F3F6 0 6px, #E6E9EE 6px 12px);
    color: #9AA3AE;
    cursor: not-allowed;
}
.time-slot.unavailable .slot-time,
.time-slot:disabled .slot-time {
    text-decoration: line-through;
    text-decoration-thickness: 2px;
}
.time-slot.unavailable:hover,
.time-slot:disabled:hover {
    border-color: #DCE0E6;
    background: repeating-linear-gradient(135deg, #F1F3F6 0 6px, #E6E9EE 6px 12px);
}

/* legend above the slots */
.slot-key {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
    font-size: 0.8125rem;
    color: var(--text-soft);
}
.slot-key li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.slot-key-box {
    width: 18px;
    height: 14px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    background: var(--white);
}
.slot-key-box.is-selected {
    border-color: var(--navy);
    background: var(--navy);
}
.slot-key-box.is-booked {
    border-style: dashed;
    background: repeating-linear-gradient(135deg, #F1F3F6 0 3px, #E6E9EE 3px 6px);
}

/* 4. Buttons and messages */

/* primary button */
.continue-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.75rem 1.75rem;
    border: 0;
    border-radius: 8px;
    background: var(--navy);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: var(--white);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s;
}
.continue-button:hover:not(:disabled) {
    background: var(--navy-dark);
}

/* disabled until a choice is made */
.continue-button:disabled {
    background: #A9B6C4;
    cursor: not-allowed;
}

/* error message, hidden when empty */
.booking-error {
    margin: 1rem 0 0;
    font-size: 0.875rem;
    color: var(--error);
}
.booking-error:empty {
    display: none;
}

/* 5. My Appointments */

/* max 820px wide */
.my-appointments-container {
    display: grid;
    gap: 1rem;
    max-width: 820px;
    margin: 0 auto;
}

/* appointment card */
.appointment-list-card {
    padding: 1.5rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.appointment-list-card h2 {
    margin-bottom: 0.25rem;
    font-size: 1.25rem;
}
.appointment-list-card > p {
    margin: 0;
    color: var(--text-soft);
}

/* service left, status right */
.appointment-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.appointment-list-header h2 {
    margin-bottom: 0.125rem;
    font-size: 1.125rem;
}

.appointment-reference {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-soft);
}
.appointment-reference strong {
    color: var(--navy);
    letter-spacing: 0.03em;
}

/* status label */
.appointment-status {
    flex-shrink: 0;
    padding: 0.25rem 0.75rem;
    border-left: 3px solid var(--accent);
    border-radius: 3px;
    background: var(--accent-light);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent-text);
}

/* stacked on phones, 3 columns from 640px */
.appointment-list-details {
    display: grid;
    gap: 0.75rem;
    padding-top: 1rem;
}

@media (min-width: 640px) {
    .appointment-list-details {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* label above value */
.appointment-detail {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}
.appointment-detail span {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-soft);
}
.appointment-detail strong {
    font-weight: 600;
    color: var(--navy);
}

.appointment-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

/* cancel button (red outline) */
.cancel-appointment-button {
    min-height: 42px;
    padding: 0.5rem 1.25rem;
    border: 1.5px solid var(--error);
    border-radius: 8px;
    background: var(--white);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--error);
    cursor: pointer;
    transition: background-color 0.2s;
}
.cancel-appointment-button:hover:not(:disabled) {
    background: #FEF3F2;
}
.cancel-appointment-button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.cancelled-message {
    margin: 1rem 0 0;
    font-size: 0.875rem;
    font-style: italic;
    color: var(--text-soft);
}

.my-appointments-actions {
    display: flex;
    justify-content: center;
    margin-top: 0.75rem;
}

/* Booking page (appointment.php) */

.bk-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 2rem 16px 4rem;
}
.bk-heading {
    margin-bottom: 1.5rem;
}
.bk-heading h1 {
    margin-bottom: 0.25rem;
}
.bk-heading p {
    margin: 0;
    color: var(--text-soft);
}

/* step card */
.bk-card {
    margin-bottom: 1.25rem;
    padding: 1.5rem 1.25rem;
    border-radius: 12px;
    background: var(--white);
    box-shadow: var(--shadow);
}
.bk-card[hidden] {
    display: none;
}
.bk-card h2 {
    margin-bottom: 0.5rem;
    font-size: 1.375rem;
}
.bk-help {
    margin: 0 0 1rem;
    font-size: 0.9375rem;
    color: var(--text-soft);
}

/* details form fields */
.bk-fields {
    display: grid;
    gap: 0.875rem;
}
.bk-field {
    display: grid;
    gap: 0.35rem;
}
.bk-field[hidden] {
    display: none;
}
.bk-field span {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--heading);
}
.bk-field input,
.bk-field select {
    min-height: 52px;
    padding: 0 1rem;
    border: 1.5px solid transparent;
    border-radius: 6px;
    background: #ECEDF3;
    font-size: 1rem;
}
.bk-field input:focus,
.bk-field select:focus {
    border-color: var(--navy);
    background: var(--white);
    outline: none;
}
@media (min-width: 640px) {
    .bk-fields {
        grid-template-columns: 1fr 1fr;
    }
    #id-fields,
    .bk-fields .bk-check,
    .bk-fields .bk-help {
        grid-column: 1 / -1;
    }
}
#id-fields {
    display: grid;
    gap: 0.875rem;
}
#id-fields[hidden],
.bk-help[hidden] {
    display: none;
}

/* text-style button */
.bk-link {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 700;
    color: var(--navy);
    text-decoration: underline;
    cursor: pointer;
}

/* checkbox with label */
.bk-check {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 0.5rem 0;
    font-size: 0.9375rem;
    color: var(--text);
}
.bk-check input {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    min-height: 0;
    margin-top: 0.1rem;
}

/* honeypot field, hidden from people */
.bk-trap {
    position: absolute;
    left: -9999px;
}

/* list of problems at the top of the details step */
.bk-alert {
    margin: 0 0 1rem;
    padding: 0.875rem 1.25rem;
    border: 1px solid #F5C2C7;
    border-radius: 6px;
    background: #F8D7DA;
    font-size: 0.9375rem;
    color: #842029;
}
.bk-alert[hidden] {
    display: none;
}
.bk-alert p {
    margin: 0;
}

/* message under a field */
.bk-field-error {
    font-size: 0.8125rem;
    color: var(--error);
}
.bk-field-error:empty {
    display: none;
}
.bk-fields > .bk-field-error {
    grid-column: 1 / -1;
    margin-top: -0.5rem;
}

.bk-error {
    min-height: 1.25rem;
    margin: 0.5rem 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--error);
}
.bk-next {
    min-width: 140px;
}

/* date with prev/next arrows */
.bk-date-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.bk-date-text {
    position: relative;
    display: grid;
}
.bk-label {
    font-size: 0.875rem;
    color: var(--text-soft);
}
.bk-date-text strong {
    font-size: 1.125rem;
    color: var(--navy);
}
/* transparent date input over the label so a tap opens the calendar */
.bk-date-picker {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    opacity: 0;
    cursor: pointer;
}
.bk-arrows {
    display: flex;
    gap: 0.5rem;
}
.bk-arrow {
    display: grid;
    place-items: center;
    width: 46px;
    height: 40px;
    border: 1.5px solid var(--navy);
    border-radius: 6px;
    background: var(--white);
    color: var(--navy);
    cursor: pointer;
}
.bk-arrow:disabled {
    border-color: var(--border);
    color: var(--border);
    cursor: not-allowed;
}
.bk-arrow .icon {
    width: 20px;
    height: 20px;
}

/* doctor row */
.bk-doctor {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}
.bk-doctor strong {
    display: block;
    font-size: 1.125rem;
    color: var(--navy);
}
.bk-doctor span {
    font-size: 0.9375rem;
    color: var(--text-soft);
}

.bk-subheading {
    margin: 1.25rem 0 0.75rem;
    font-size: 1.0625rem !important;
}

/* consultation type options */
.bk-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.bk-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0.5rem 1.1rem;
    border: 1.5px solid var(--navy);
    border-radius: 6px;
    background: var(--white);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--navy);
    cursor: pointer;
}
.bk-chip .icon {
    width: 20px;
    height: 20px;
}
.bk-chip.is-selected {
    background: var(--navy);
    color: var(--white);
}

/* terms box */
.bk-terms {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    background: var(--sky-light);
}
.bk-terms h3 {
    margin-bottom: 0.4rem;
    font-size: 1rem;
    color: var(--navy);
}
.bk-terms p {
    margin: 0 0 0.4rem;
    font-size: 0.9375rem;
}

.bk-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.bk-actions .btn {
    width: auto;
    min-width: 140px;
}

/* confirmation card */
.bk-done {
    text-align: center;
}
.bk-done-icon {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 0.5rem;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent-text);
}
.bk-summary {
    margin: 1rem 0;
    text-align: left;
}
.bk-summary div {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}
.bk-summary dt {
    color: var(--text-soft);
}
.bk-summary dd {
    margin: 0;
    font-weight: 700;
    color: var(--navy);
}
.bk-done .bk-actions {
    justify-content: center;
}

/* disabled until a time is picked and the box is ticked */
.bk-actions .btn:disabled {
    border-color: #B8C2CC;
    background: #B8C2CC;
    cursor: not-allowed;
}

/* review popup */
.bk-review h2 {
    margin-bottom: 0.25rem;
}
.bk-review .bk-summary {
    margin: 0.75rem 0 1rem;
}
.bk-review-back {
    margin-top: 0.625rem;
}

/* hold to confirm: the fill grows while the button is held */
.bk-hold {
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.bk-hold-fill {
    position: absolute;
    inset: 0;
    width: 0;
    background: var(--accent);
    transition: width 0.2s ease-out;
}
.bk-hold.is-holding .bk-hold-fill {
    width: 100%;
    transition: width 1.5s linear;
}
.bk-hold-text {
    position: relative;
}
/* availability page: free times only, Book now is the one button */
.av-card {
    max-width: 640px;
}
.av-service {
    margin: 0;
    color: var(--accent);
    font-weight: 600;
}
.av-date {
    margin: 0.25rem 0 0;
}
.av-note {
    margin: 0.75rem 0 0;
    color: var(--muted, #6b7280);
}
.av-count {
    margin: 1.25rem 0 0.75rem;
    color: var(--muted, #6b7280);
    font-size: 0.9375rem;
}
.av-times {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.av-time {
    width: 100%;
    padding: 0.5rem 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    color: var(--navy);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}
.av-time:hover {
    border-color: var(--navy);
}
.av-time[aria-pressed="true"] {
    border-color: var(--navy);
    background: var(--navy);
    color: var(--white);
}
/* grey until a time is picked */
.av-book.is-disabled {
    border-color: #B8C2CC;
    background: #B8C2CC;
    pointer-events: none;
}
.av-book {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 1.5rem;
}

/* guest details: one column, labels hidden (the hint is in the box) */
.bk-details .bk-fields {
    grid-template-columns: 1fr;
}
.bk-details .bk-field > span:first-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}
#dob-field.bk-field > span:first-child,
#id-number-field.bk-field > span:first-child {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
}

/* changing a booking */
.bk-heading .bk-change-note {
    margin: 0.5rem 0 0;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--accent);
    background: var(--sky-light);
    color: var(--navy);
}

/* my appointments: hold to cancel */
.bk-hold-cancel {
    background: #B42318;
    border-color: #B42318;
}
.bk-hold-cancel .bk-hold-fill {
    background: #7A1A12;
}
.bk-review-close {
    float: right;
    margin: -0.5rem -0.5rem 0 0;
    padding: 0.25rem 0.5rem;
    border: 0;
    background: none;
    color: var(--muted, #6b7280);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}
.cancel-done {
    margin: 0 0 1rem;
    padding: 0.875rem 1rem;
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    background: var(--sky-light);
    color: var(--navy);
}

/* closed day picked: note under the date */
.bk-date-note {
    margin: 0.75rem 0 0;
    padding: 0.625rem 0.875rem;
    border-left: 3px solid var(--accent);
    background: var(--sky-light);
    color: var(--navy);
    font-size: 0.9375rem;
}

/* guest booking: details left, create an account right */
.bk-page-wide {
    max-width: 1180px;
}
.bk-page-wide .bk-heading,
.bk-page-wide #time-step,
.bk-page-wide #done-step {
    max-width: 760px;
}
.bk-guest-layout {
    display: grid;
    gap: 1.5rem;
    align-items: start;
}
.bk-guest-layout[hidden] {
    display: none;
}
.bk-guest-layout .bk-card {
    margin-bottom: 0;
}
.bk-side {
    display: grid;
    gap: 1.25rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--white);
}
.bk-side h2 {
    margin: 0 0 1rem;
    color: var(--navy);
    font-size: 1.375rem;
}
.bk-side .login-benefits {
    margin-bottom: 1.25rem;
}
.bk-side img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}
@media (min-width: 900px) {
    .bk-guest-layout {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    }
    .bk-side {
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
        align-items: center;
    }
}

/* the visit picked on the availability page */
.bk-picked {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    background: var(--sky-light);
    color: var(--navy);
}
.bk-picked strong {
    display: block;
}
.bk-picked a {
    flex: none;
    font-weight: 600;
}

/* note above Next */
.bk-note {
    margin: 1.25rem 0 1rem;
    padding: 0.875rem 1.25rem;
    border: 1px solid #C3DCF4;
    border-radius: 4px;
    background: var(--accent-light);
    color: var(--navy);
    font-size: 0.9375rem;
}

/* red ! inside a field with a problem */
.bk-field input[aria-invalid="true"],
.bk-field select[aria-invalid="true"] {
    padding-right: 2.75rem;
    border-color: var(--error);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B42318' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v6M12 16.5v.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    background-size: 18px;
}

/* availability: booked or passed times, greyed out with the word under the time */
.av-time-taken {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 0.3rem 0;
    border-style: dashed;
    border-color: #DCE0E6;
    background: repeating-linear-gradient(135deg, #F1F3F6 0 6px, #E6E9EE 6px 12px);
    color: #9AA3AE;
    line-height: 1.2;
    cursor: not-allowed;
}
.av-time-taken s {
    text-decoration-thickness: 2px;
}
.av-time-taken small {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.av-time-taken:hover {
    border-color: #DCE0E6;
}

/* every box the same height, free or taken */
.av-times li {
    display: flex;
}
.av-times li > .av-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 52px;
}

/* "I don't have any of these click here" on its own line under the ID help */
.bk-no-id {
    display: block;
    margin-top: 0.15rem;
    color: var(--navy);
}
.bk-no-id .bk-link {
    text-decoration: none;
}
