/*
 * Booking page for the initial phone consultation (templates/default/appointment.html.twig).
 * Reference: docs/erstgespraech-termin.html. All classes use the tb- prefix; colors come from tokens.css.
 */

/* Width and padding come from .container in base.html.twig */
.tb-container {
    box-sizing: border-box;
}

.tb-handlee {
    font-family: 'Handlee', cursive;
    font-weight: 400;
    color: var(--tv-accent);
}

.tb-eyebrow {
    margin: 0 0 12px;
    font-size: 13px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--tv-muted);
}

/* ---------- Intro ---------- */
.tb-intro {
    display: flex;
    flex-wrap: wrap;
    gap: 32px 96px;
    align-items: flex-end;
    padding: 0 0 56px;
}
.tb-intro__text {
    flex: 3 1 480px;
    min-width: 0;
}
.tb-intro h1 {
    margin: 0 0 24px;
    font-size: 56px;
    line-height: 1.1;
}
.tb-lead {
    margin: 0;
    max-width: 58ch;
    font-size: 19px;
    line-height: 1.75;
    color: var(--tv-text-soft);
}
.tb-facts {
    flex: 1 1 260px;
    min-width: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.tb-facts li {
    display: flex;
    align-items: center;
    gap: 14px;
}
.tb-facts strong {
    font-weight: 700;
}

/* ---------- Booking area ---------- */
.tb-booking {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: flex-start;
    padding: 48px 0 96px;
    border-top: 1px solid var(--tv-line);
}
/*
 * The reference assumes a 1140px container, but app.css limits .container to 960px (936px content).
 * 520px + 40px gap + 340px form = 900px keeps both side by side from 992px viewport width on;
 * below that the form wraps under the picker as in the reference.
 */
.tb-pick {
    flex: 999 1 520px;
    min-width: 0;
}
.tb-step {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 24px;
}
.tb-step__no {
    font-family: 'Handlee', cursive;
    font-size: 20px;
    color: var(--tv-accent);
}
.tb-step h2 {
    margin: 0;
    font-size: 32px;
    line-height: 1.2;
}

.tb-weeknav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.tb-weeknav p {
    margin: 0;
    font-size: 15px;
    color: var(--tv-muted);
}
.tb-iconbtn {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--tv-line);
    border-radius: 6px;
    background: #fff;
    color: var(--tv-text);
    cursor: pointer;
}
.tb-iconbtn:hover:not(:disabled) {
    background: var(--tv-sand-100);
}
.tb-iconbtn:disabled {
    opacity: .4;
    cursor: default;
}

.tb-days,
.tb-slots {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.tb-days {
    margin-bottom: 28px;
}
.tb-day {
    min-height: 88px;
    padding: 12px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    border: 1px solid var(--tv-line);
    background: #fff;
    color: var(--tv-text);
}
.tb-day:hover {
    border-color: var(--tv-accent-dark);
}
.tb-day[aria-pressed="true"] {
    background: var(--tv-accent-dark);
    border-color: var(--tv-accent-dark);
    color: #fff;
}
.tb-day.is-full {
    background: var(--tv-booked);
    color: #6B645D;
}
.tb-day__wd {
    display: block;
    font-size: 13px;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.tb-day__date {
    display: block;
    font-family: 'Handlee', cursive;
    font-size: 26px;
    line-height: 1.2;
}
.tb-day__free {
    display: block;
    font-size: 13px;
}

.tb-slotlabel {
    margin: 0 0 12px;
    font-size: 15px;
    color: var(--tv-muted);
}
.tb-slotlabel strong {
    color: var(--tv-text);
}
.tb-slot {
    min-height: 48px;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    border: 1px solid var(--tv-line-accent);
    background: #fff;
    color: var(--tv-text);
    cursor: pointer;
}
.tb-slot:hover:not(:disabled) {
    border-color: var(--tv-accent-dark);
    background: var(--tv-sand-100);
}
.tb-slot[aria-pressed="true"] {
    background: var(--tv-accent-dark);
    border-color: var(--tv-accent-dark);
    color: #fff;
    font-weight: 700;
}
.tb-slot:disabled {
    background: var(--tv-booked);
    border-color: var(--tv-booked);
    color: var(--tv-booked-text);
    text-decoration: line-through;
    cursor: not-allowed;
}
.tb-legend {
    margin: 16px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    font-size: 13px;
    color: var(--tv-muted);
}
.tb-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.tb-legend i {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
}
.tb-legend__free {
    border: 1px solid var(--tv-line-accent);
}
.tb-legend__selected {
    background: var(--tv-accent-dark);
}
.tb-legend__taken {
    background: var(--tv-booked);
}

/* Shown when no slots are available or JavaScript is off */
.tb-empty {
    margin: 0;
    padding: 20px;
    background: var(--tv-sand-50);
    border: 1px solid var(--tv-line);
    border-radius: 6px;
    line-height: 1.75;
    color: var(--tv-text-soft);
}

.tb-alt {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid var(--tv-line);
}
.tb-alt h3 {
    margin: 0 0 8px;
    font-size: 26px;
    line-height: 1.2;
}
.tb-alt p {
    margin: 0;
    max-width: 58ch;
    line-height: 1.75;
    color: var(--tv-text-soft);
}

.tb-link {
    color: var(--tv-accent-dark);
    text-decoration: none;
    border-bottom: 1px solid var(--tv-line-accent);
}
.tb-link:hover {
    color: var(--tv-text);
    border-bottom-color: var(--tv-text);
}

/* ---------- Form ---------- */
.tb-form {
    flex: 1 1 340px;
    min-width: 0;
    background: var(--tv-sand-50);
    border: 1px solid var(--tv-line);
    border-radius: 6px;
    padding: 28px;
    box-sizing: border-box;
}
.tb-form .tb-step {
    margin-bottom: 20px;
}
.tb-summary {
    background: #fff;
    border: 1px solid var(--tv-line);
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 24px;
}
.tb-summary__label {
    margin: 0;
    font-size: 13px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--tv-muted);
}
.tb-summary__value {
    margin: 2px 0 0;
    font-size: 17px;
    font-weight: 700;
}
.tb-summary__value.is-empty {
    font-size: 16px;
    font-weight: 400;
    color: var(--tv-muted);
}
.tb-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}
.tb-field label {
    font-size: 15px;
    font-weight: 700;
}
.tb-field input {
    min-height: 48px;
    padding: 0 14px;
    font-size: 16px;
    font-family: inherit;
    color: var(--tv-text);
    background: #fff;
    border: 1px solid var(--tv-input-border);
    border-radius: 4px;
    box-sizing: border-box;
    width: 100%;
}
.tb-field input:focus {
    outline: 2px solid var(--tv-accent);
    outline-offset: 1px;
    border-color: var(--tv-accent);
}
.tb-field small {
    font-size: 13px;
    color: var(--tv-muted);
}
.tb-consent {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 14px;
    line-height: 1.5;
    color: var(--tv-text-soft);
    margin: 4px 0 24px;
    cursor: pointer;
}
.tb-consent input {
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    accent-color: var(--tv-accent-dark);
    flex: none;
}
.tb-submit {
    width: 100%;
    min-height: 52px;
    border: 1px solid var(--tv-accent-dark);
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    color: #fff;
    background: var(--tv-accent-dark);
    cursor: pointer;
}
.tb-submit:hover:not(:disabled) {
    background: var(--tv-text);
    border-color: var(--tv-text);
}
.tb-submit:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.tb-cancel {
    margin: 14px 0 0;
    font-size: 13px;
    color: var(--tv-muted);
    text-align: center;
}

/* Server-side validation messages */
.tb-error {
    margin: 0;
    font-size: 14px;
    color: #A3312A;
}
.tb-error ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.tb-form .tb-error--slot {
    margin: 0 0 20px;
}
.tb-consent + .tb-error {
    margin: -16px 0 20px;
}
.tb-field input[aria-invalid="true"] {
    border-color: #A3312A;
}

/* Honeypot: out of sight for people, still in the DOM for bots */
.tb-hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- Confirmation ---------- */
.tb-done {
    padding: 56px 0 96px;
    border-top: 1px solid var(--tv-line);
}
.tb-done__box {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
    background: var(--tv-sand-50);
    border: 1px solid var(--tv-line);
    border-radius: 6px;
    padding: 48px 32px;
}
.tb-done__box svg {
    display: block;
    margin: 0 auto 16px;
}
.tb-done h2 {
    margin: 0 0 12px;
    font-size: 36px;
    line-height: 1.2;
}
.tb-done p {
    margin: 0 0 8px;
    font-size: 17px;
    line-height: 1.7;
    color: var(--tv-text-soft);
}
.tb-done .tb-done__when {
    margin: 0 0 20px;
    font-size: 20px;
    font-weight: 700;
    color: var(--tv-text);
}
.tb-btn-ghost {
    min-height: 48px;
    padding: 0 24px;
    border: 1px solid var(--tv-accent-dark);
    background: #fff;
    color: var(--tv-accent-dark);
    font-size: 16px;
    font-family: inherit;
    cursor: pointer;
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}
.tb-btn-ghost:hover {
    background: var(--tv-sand-100);
    color: var(--tv-accent-dark);
}

.tb-page [hidden] {
    display: none !important;
}

@media (max-width: 575.98px) {
    .tb-intro {
        padding: 48px 0 40px;
    }
    .tb-intro h1 {
        font-size: 40px;
    }
    .tb-days,
    .tb-slots {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .tb-form {
        padding: 20px;
    }
}
