/* RandevumTamam - public booking pages */
.public-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.public-container {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 0 20px;
}

.public-header {
    background: var(--dr-surface);
    border-bottom: 1px solid var(--dr-border);
}

.public-header .public-container {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 64px;
}

.public-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: var(--dr-text);
    border-radius: 10px;
}

.public-brand:hover {
    color: var(--dr-primary);
}

.public-brand-name {
    font-weight: 600;
    font-size: 16px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Clinic profile page ---------- */
.profile-head {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 18px;
    border: 1px solid var(--dr-border);
    background: var(--dr-surface);
    overflow: hidden;
    flex-shrink: 0;
}

.profile-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-logo-mark {
    background: var(--dr-primary);
    color: #fff;
    font-size: 28px;
    border: 0;
}

.profile-head-text {
    min-width: 0;
}

.profile-head h1 {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 4px;
}

.profile-address {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    margin: 0;
    color: var(--dr-text-muted);
    font-size: 14px;
}

.profile-address i {
    margin-top: 2px;
    color: var(--dr-primary);
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.profile-actions .btn-outline-success {
    --bs-btn-color: #128c7e;
    --bs-btn-border-color: #cfeadb;
    --bs-btn-hover-bg: #e9f7ef;
    --bs-btn-hover-color: #128c7e;
    --bs-btn-hover-border-color: #cfeadb;
}

.profile-contact {
    margin: 18px 0 0;
}

.booking-step-icon {
    color: var(--dr-primary);
    font-size: 18px;
}

.profile-hours {
    list-style: none;
    margin: 0;
    padding: 0;
}

.profile-hours li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid var(--dr-border);
}

.profile-hours li:first-child {
    border-top: 0;
    padding-top: 0;
}

.profile-hours li.is-today .profile-hours-day {
    color: var(--dr-primary);
    font-weight: 600;
}

.profile-hours li.is-closed .profile-hours-time {
    color: var(--dr-text-muted);
}

.profile-hours-time {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

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

.profile-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid var(--dr-border);
}

.profile-list li:first-child {
    border-top: 0;
    padding-top: 0;
}

.profile-list-name {
    font-weight: 500;
}

.profile-list-meta {
    color: var(--dr-text-muted);
    font-size: 13px;
    white-space: nowrap;
}

/* Clinic phone + WhatsApp on the right of the public header: tap-to-call / tap-to-chat pills */
.public-contact {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.public-whatsapp {
    width: 40px;
    padding: 0;
    justify-content: center;
    font-size: 18px;
    color: #128c7e;
    background: #e9f7ef;
    border-color: #cfeadb;
}

.public-phone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--dr-border);
    border-radius: 999px;
    background: var(--dr-primary-softer);
    font-weight: 500;
    font-size: 14px;
}

.public-main {
    flex: 1;
    padding: 32px 0 48px;
}

.public-footer {
    border-top: 1px solid var(--dr-border);
    padding: 16px 0;
    font-size: 13px;
    color: var(--dr-text-muted);
}

.booking-intro {
    margin-bottom: 20px;
}

.booking-intro h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 6px;
}

.booking-intro p {
    color: var(--dr-text-muted);
    margin: 0;
}

.booking-card {
    background: var(--dr-surface);
    border: 1px solid var(--dr-border);
    border-radius: var(--dr-radius);
    box-shadow: var(--dr-shadow);
    padding: 24px;
    margin-bottom: 16px;
    transition: opacity 0.15s ease;
}

.booking-card.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.booking-step-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px;
}

.booking-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--dr-primary-soft);
    color: var(--dr-primary);
    font-size: 13px;
    font-weight: 600;
}

.booking-honeypot {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Option cards (services, doctors) */
.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
}

.option-card {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.option-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-card-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border: 1px solid var(--dr-border);
    border-radius: 10px;
    background: var(--dr-surface);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.option-card-title {
    font-weight: 600;
}

.option-card-meta {
    font-size: 13px;
    color: var(--dr-text-muted);
}

.option-card:hover .option-card-body {
    border-color: var(--dr-border-strong);
}

.option-card input:checked + .option-card-body {
    border-color: var(--dr-primary);
    box-shadow: 0 0 0 2px rgba(var(--dr-primary-rgb), 0.2);
    background: var(--dr-primary-soft);
}

.option-card input:focus-visible + .option-card-body {
    outline: 2px solid var(--dr-primary);
    outline-offset: 2px;
}

.option-card[hidden] {
    display: none;
}

.booking-date {
    max-width: 260px;
}

.booking-card {
    scroll-margin-top: 12px;
}

/* Day strip: the next two weeks as chips, scrolls sideways on narrow screens */
.day-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 8px;
    margin: 0 -2px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.day-strip::-webkit-scrollbar {
    display: none;
}

/* Wide screens have room for all two weeks at once */
@media (min-width: 768px) {
    .day-strip {
        flex-wrap: wrap;
        overflow: visible;
    }
}

.day-chip {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 72px;
    min-height: 60px;
    padding: 8px 10px;
    border: 1px solid var(--dr-border);
    border-radius: 12px;
    background: var(--dr-surface);
    color: var(--dr-text);
    font: inherit;
    line-height: 1.2;
    cursor: pointer;
    scroll-snap-align: start;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.day-chip-name {
    font-weight: 600;
    font-size: 14px;
}

.day-chip-date {
    font-size: 12.5px;
    color: var(--dr-text-muted);
}

.day-chip-closed {
    font-size: 11px;
    color: var(--dr-text-muted);
}

.day-chip:hover:not(:disabled) {
    border-color: var(--dr-border-strong);
}

.day-chip.is-selected {
    border-color: var(--dr-primary);
    background: var(--dr-primary-soft);
    box-shadow: 0 0 0 2px rgba(var(--dr-primary-rgb), 0.2);
}

.day-chip.is-selected .day-chip-name {
    color: var(--dr-primary);
}

.day-chip:disabled {
    cursor: default;
    background: var(--dr-bg);
    color: var(--dr-text-muted);
    border-style: dashed;
}

.day-chip:focus-visible {
    outline: 2px solid var(--dr-primary);
    outline-offset: 2px;
}

.booking-other-date {
    margin-top: 6px;
}

.booking-other-date .booking-date {
    margin-top: 8px;
}

/* Time slots */
.slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 8px;
}

.slot-button {
    min-height: 44px;
    padding: 8px 6px;
    border: 1px solid var(--dr-border);
    border-radius: 8px;
    background: var(--dr-surface);
    font: inherit;
    font-weight: 500;
    color: var(--dr-text);
    cursor: pointer;
}

/* Taken / past / blocked hours stay visible but dark; tapping one only shows a message */
.slot-button.is-unavailable {
    background: #475569;
    border-color: #475569;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: line-through;
    text-decoration-color: rgba(255, 255, 255, 0.45);
    cursor: not-allowed;
}

/* The hour the customer's appointment is on right now: recognisable, but not selectable again */
.slot-button.is-current {
    background: var(--dr-surface);
    border: 1px dashed var(--dr-primary);
    color: var(--dr-primary);
    text-decoration: none;
    opacity: 1;
}

.slot-button.is-unavailable.is-past {
    background: #94a3b8;
    border-color: #94a3b8;
}

.slot-button.is-unavailable:hover {
    border-color: #475569;
}

.slot-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--dr-text-muted);
}

.slot-grid:empty + .slot-legend {
    display: none;
}

.slot-legend-free,
.slot-legend-taken {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid var(--dr-border);
    background: var(--dr-surface);
}

.slot-legend-taken {
    margin-left: 8px;
    background: #475569;
    border-color: #475569;
}

.slot-button:hover {
    border-color: var(--dr-border-strong);
}

.slot-button.is-selected {
    background: var(--dr-primary);
    border-color: var(--dr-primary);
    color: #fff;
}

.slot-button:focus-visible {
    outline: 2px solid var(--dr-primary);
    outline-offset: 2px;
}

.slot-message {
    color: var(--dr-text-muted);
    margin: 0 0 10px;
}

.slot-message.is-warning {
    color: var(--dr-danger);
    font-weight: 500;
}

.slot-message:empty {
    display: none;
}

.field-error {
    color: var(--dr-danger);
    font-size: 13px;
    margin-top: 6px;
}

.field-error:empty {
    display: none;
}

.booking-selection {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -4px 0 16px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--dr-primary-soft);
    color: var(--dr-primary);
    font-weight: 500;
    font-size: 13.5px;
}

.booking-selection::before {
    content: "\f26b"; /* bi-check-circle */
    font-family: "bootstrap-icons";
    font-size: 15px;
    flex-shrink: 0;
}

.booking-privacy {
    font-size: 13px;
    color: var(--dr-text-muted);
    margin: 20px 0 16px;
}

/* Confirmation */
.booking-confirmation {
    text-align: center;
    padding: 40px 24px;
}

.booking-confirmation h1 {
    font-size: 22px;
    font-weight: 600;
}

.booking-confirmation-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #e9f7ef;
    color: #34a853;
    font-size: 28px;
    margin-bottom: 16px;
}

.booking-summary {
    max-width: 320px;
    margin: 24px auto 0;
    text-align: left;
}

/* ---------- Attendance (Katılıyorum / Katılmıyorum) ---------- */
.attendance-card {
    max-width: 520px;
    margin: 0 auto;
}

.attendance-title {
    font-size: 22px;
    font-weight: 600;
    text-align: center;
}

.attendance-card .booking-summary {
    max-width: none;
}

.attendance-selfservice {
    border-top: 1px solid var(--dr-border);
    padding-top: 16px;
}

.attendance-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.attendance-actions .btn.is-chosen {
    box-shadow: 0 0 0 3px rgba(var(--dr-primary-rgb), 0.25);
}

@media (max-width: 479.98px) {
    .attendance-actions {
        grid-template-columns: 1fr;
    }
}

/* ---------- Phones ---------- */
@media (max-width: 575.98px) {
    .public-container {
        padding: 0 16px;
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    .public-header .public-container {
        height: auto;
        min-height: 60px;
        padding-top: env(safe-area-inset-top);
    }

    .public-phone span {
        display: none;
    }

    .public-contact {
        gap: 6px;
    }

    .public-phone {
        width: 40px;
        padding: 0;
        justify-content: center;
        font-size: 17px;
    }

    .public-main {
        padding: 20px 0 32px;
    }

    .public-footer {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    .booking-intro h1 {
        font-size: 22px;
    }

    .booking-card {
        padding: 18px 16px;
        margin-bottom: 12px;
    }

    /* Two services side by side halves the scrolling on a phone */
    .option-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .option-grid {
        gap: 6px;
    }

    .option-card-body {
        padding: 7px 10px;
        min-height: 46px;
        justify-content: center;
        border-radius: 8px;
    }

    .option-card-title {
        font-size: 13.5px;
        line-height: 1.2;
    }

    .option-card-meta {
        font-size: 12px;
    }

    /* Small time squares in rows of five; long days scroll inside the box instead of filling the screen */
    .slot-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px;
        max-height: 46vh;
        max-height: 46dvh;
        overflow-y: auto;
        padding: 2px;
        margin: -2px;
    }

    .slot-button {
        min-height: 38px;
        padding: 6px 0;
        font-size: 13px;
        border-radius: 7px;
    }

    /* 16px keeps iOS Safari from zooming into focused fields */
    .booking-form .form-control {
        font-size: 16px;
        min-height: 46px;
    }

    .booking-date {
        max-width: none;
    }

    #booking-submit {
        min-height: 52px;
    }
}

@media (max-width: 575.98px) {
    .profile-logo {
        width: 60px;
        height: 60px;
        border-radius: 14px;
    }

    .profile-head h1 {
        font-size: 20px;
    }

    .profile-actions .btn {
        flex: 1 1 auto;
        min-height: 46px;
    }

    .profile-actions .btn-primary {
        flex-basis: 100%;
    }
}
