/* TeleMed booking tool — design system derived from docs/design/Design Guidelines.md */

:root {
    --color-primary: #5C8FBD;
    --color-primary-light: #8FB6D6;
    --color-teal: #5FBBB0;
    --color-teal-light: #9AD4CC;
    --color-footer: #4A7C8C;
    --color-surface: #FFFFFF;
    --color-bg: #EAF1F4;
    --color-fill: #F4F7F8;
    --color-text: #2E3B42;
    --color-text-muted: #6B7D85;
    --color-mint: #C9EDE6;
    --color-danger: #B4544B;
    --radius-card: 24px;
    --radius-field: 999px;
    --shadow-soft: 0 8px 24px rgba(46, 59, 66, 0.08);
    --font-head: 'Quicksand', 'Comfortaa', system-ui, sans-serif;
    --font-body: 'Nunito Sans', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
}

/* --- Section banner --- */
.tm-banner {
    background: var(--color-teal);
    padding: 18px 32px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.tm-banner-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.tm-banner-title {
    margin: 0;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 26px;
    color: #fff;
}

.tm-main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 36px 24px 60px;
}

/* --- Cards / steps --- */
.tm-card {
    background: var(--color-surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    padding: 32px;
    position: relative;
    overflow: hidden;
}
.tm-step { display: none; }
.tm-step.is-active { display: block; }
#tm-booking[data-step="slots"] #step-slots,
#tm-booking[data-step="form"] #step-form,
#tm-booking[data-step="sent"] #step-sent { display: block; }

/* --- Service header --- */
.tm-service-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}
.tm-service-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #EAF6F4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.tm-service-name {
    margin: 0 0 2px;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 20px;
}
.tm-service-sub {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-muted);
}

/* --- Booking grid --- */
.tm-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.2fr 1fr;
    gap: 24px;
    align-items: start;
}
.tm-col-label {
    margin: 0 0 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* days */
.tm-days { display: flex; flex-direction: column; gap: 8px; }
.tm-day {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    background: var(--color-fill);
    color: var(--color-text);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-body);
}
.tm-day:hover { background: #E3ECEE; }
.tm-day.is-active { background: var(--color-teal); color: #fff; }

/* time slots */
.tm-slots { display: none; }
.tm-slots.is-active { display: block; }
.tm-slot-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.tm-slot {
    padding: 10px 16px;
    border-radius: var(--radius-field);
    border: 2px solid #E3ECEE;
    background: #fff;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    min-height: 44px;
}
.tm-slot:hover:not([disabled]) { border-color: var(--color-teal-light); }
.tm-slot.is-selected { background: var(--color-teal); border-color: var(--color-teal); color: #fff; }
.tm-slot[disabled] {
    background: var(--color-fill);
    border: none;
    color: #C3CDD1;
    text-decoration: line-through;
    cursor: not-allowed;
}

.tm-summary {
    margin-top: 18px;
    padding: 14px 18px;
    background: #EAF6F4;
    border-radius: 14px;
    font-size: 14px;
}

/* disclaimer + agree */
.tm-col-agree {
    background: var(--color-fill);
    border-radius: 18px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.tm-disclaimer {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--color-text-muted);
}
.tm-agree-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    cursor: pointer;
}
.tm-agree-label input {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: var(--color-teal);
    flex: 0 0 auto;
}

/* --- Buttons --- */
.tm-btn {
    padding: 12px 24px;
    border-radius: var(--radius-field);
    border: none;
    font-weight: 700;
    font-size: 14px;
    font-family: var(--font-body);
    cursor: pointer;
    min-height: 44px;
}
.tm-btn-primary { background: var(--color-teal); color: #fff; }
.tm-btn-primary:hover { background: #52a99f; }
.tm-btn-primary:disabled { background: #B9C7CB; cursor: not-allowed; }
.tm-btn-ghost { background: transparent; color: var(--color-primary); border: 2px solid var(--color-primary-light); }
.tm-btn-danger { background: var(--color-danger); color: #fff; }
.tm-btn-danger:hover { background: #9c463e; }

/* --- Patient form --- */
.tm-form-heading {
    margin: 0 0 6px;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 20px;
}
.tm-form-intro { margin: 0 0 22px; font-size: 13px; color: var(--color-text-muted); }
.tm-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tm-field { display: flex; flex-direction: column; gap: 4px; }
.tm-field-wide { grid-column: 1 / -1; }
.tm-field label { font-size: 13px; font-weight: 600; color: var(--color-text-muted); padding-left: 4px; }
.tm-field input,
.tm-field textarea {
    border: none;
    background: var(--color-fill);
    padding: 14px 20px;
    border-radius: var(--radius-field);
    font-size: 14px;
    font-family: var(--font-body);
    color: var(--color-text);
    outline: none;
}
.tm-field textarea { border-radius: 20px; resize: vertical; }
.tm-field input:focus,
.tm-field textarea:focus { box-shadow: 0 0 0 2px var(--color-primary); }
.tm-error { color: var(--color-danger); font-size: 12px; padding-left: 4px; }

.tm-payment {
    margin: 22px 0 0;
    border: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
}
.tm-payment legend {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0;
    margin-bottom: 8px;
    width: 100%;
}
.tm-radio { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.tm-radio input { accent-color: var(--color-teal); width: 16px; height: 16px; }

.tm-form-actions { margin-top: 24px; display: flex; gap: 12px; justify-content: flex-end; }

/* --- Notices / results --- */
.tm-notice {
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 14px;
    margin: 0 0 18px;
    background: var(--color-fill);
    color: var(--color-text);
}
.tm-notice-warn { background: #FBECEA; color: #8c3b33; }
.tm-notice-ok { background: #E6F5EF; color: #2f7a63; }
.tm-empty {
    margin: 0;
    padding: 20px;
    background: var(--color-fill);
    border-radius: 14px;
    color: #8FA5AC;
    font-size: 14px;
    text-align: center;
}
.tm-result { text-align: center; padding: 24px 8px; }
.tm-result-icon { font-size: 40px; display: block; margin-bottom: 12px; }
.tm-result-heading { margin: 0 0 8px; font-family: var(--font-head); font-weight: 600; font-size: 22px; }
.tm-result-text { margin: 0 auto; max-width: 460px; color: var(--color-text-muted); }

/* --- Bank info table --- */
.tm-bank { border-collapse: collapse; margin: 8px 0 20px; font-size: 14px; }
.tm-bank th { text-align: left; color: var(--color-text-muted); font-weight: 600; padding: 6px 24px 6px 0; vertical-align: top; }
.tm-bank td { padding: 6px 0; font-weight: 700; }

/* --- Resend e-mail --- */
.tm-resend { text-align: center; }

.tm-local-link { margin-top: 2em; }

/* --- Responsive --- */
@media (max-width: 820px) {
    .tm-grid { grid-template-columns: 1fr; }
    .tm-form-grid { grid-template-columns: 1fr; }
    .tm-banner { padding: 16px 20px; }
    .tm-banner-title { font-size: 22px; }
    .tm-card { padding: 22px; }
    .tm-main { padding: 24px 16px 48px; }
}
