/* The shareable digital card.

   Sized so the whole card fits one phone screen without scrolling and one sheet
   of paper when printed. Logical properties throughout: the card is handed out
   in Arabic as often as English, and a card whose padding only works one way
   round is half a card. */

.care-doctor-card-page {
    padding: 32px 0 64px;
}

.care-doctor-card-page .back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--care-primary-dark, #055744);
    font-size: .88rem;
    font-weight: 750;
    text-decoration: none;
}

.care-doctor-card-page .back-link svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.care-doctor-card-page .back-link:hover,
.care-doctor-card-page .back-link:focus-visible {
    text-decoration: underline;
}

.doctor-card {
    position: relative;
    overflow: hidden;
    max-width: 620px;
    margin-inline: auto;
    padding: 28px;
    border: 1px solid var(--care-border, #ddeaf3);
    border-radius: 24px;
    background: var(--care-card, #fff);
    box-shadow: 0 18px 44px rgba(4, 31, 25, .10);
}

/* A soft brand wash behind the header, with the pulse line across it. */
.doctor-card::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 120px;
    background: linear-gradient(180deg, rgba(8, 118, 93, .07), transparent);
    pointer-events: none;
}

.doctor-card-pulse {
    position: absolute;
    inset-inline: 0;
    top: 78px;
    width: 100%;
    height: 34px;
    color: var(--care-primary, #08765d);
    opacity: .14;
    pointer-events: none;
}

/* Screen hides the print brand strip; print swaps it for the site chrome. */
.doctor-card-print-brand {
    display: none;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--care-primary, #08765d);
}

.doctor-card-print-brand img {
    width: 28px;
    height: 28px;
}

.print-brand-name {
    color: var(--care-primary-dark, #055744);
    font-size: 1rem;
    font-weight: 800;
}

.print-brand-site {
    margin-inline-start: auto;
    color: var(--care-muted, #5a7184);
    font-size: .78rem;
}

.doctor-card-header {
    position: relative;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--care-border, #ddeaf3);
}

.doctor-card-identity {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.doctor-card-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
    overflow: hidden;
    border-radius: 50%;
    border: 3px solid var(--care-card, #fff);
    color: #fff;
    background: var(--care-gradient, linear-gradient(135deg, #055744, #0a8168));
    box-shadow: 0 6px 18px rgba(4, 31, 25, .18);
    font-size: 1.5rem;
    font-weight: 900;
}

.doctor-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.doctor-card-name-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.doctor-card h1 {
    margin: 0;
    color: var(--care-ink, #163e5f);
    font-size: 1.35rem;
    line-height: 1.25;
}

.doctor-card-title {
    margin: 4px 0 0;
    color: var(--care-muted, #5a7184);
    font-size: .9rem;
}

.doctor-card-verified {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 999px;
    color: var(--care-primary-dark, #055744);
    background: var(--sihatuna-green-soft, #e6f5f0);
    font-size: .72rem;
    font-weight: 800;
    white-space: nowrap;
}

.doctor-card-verified svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

/* Facts as inline rows: the label sits beside its value, never above it. */
.doctor-card-facts {
    display: flex;
    flex-direction: column;
    margin: 6px 0 0;
}

.doctor-card-fact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-block: 10px;
    border-bottom: 1px dashed var(--care-border, #ddeaf3);
    font-size: .88rem;
}

.doctor-card-fact .fact-icon {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 9px;
    color: var(--care-primary-dark, #055744);
    background: var(--sihatuna-green-soft, #e6f5f0);
}

.doctor-card-fact .fact-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.doctor-card-facts dt {
    color: var(--care-muted, #5a7184);
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
}

.doctor-card-facts dt::after {
    content: ":";
}

.doctor-card-facts dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--care-ink, #163e5f);
    font-size: .88rem;
    font-weight: 650;
}

.doctor-card-facts a {
    color: inherit;
    text-decoration: none;
}

/* The working week, compact enough for a card. */
.doctor-card-hours {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--sihatuna-green-soft, #e6f5f0);
}

.doctor-card-hours .hours-heading {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    color: var(--care-primary-dark, #055744);
    font-size: .78rem;
    font-weight: 800;
}

.doctor-card-hours .hours-heading svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.doctor-card-hours .hours-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-block: 3px;
    font-size: .8rem;
}

.doctor-card-hours .hours-day {
    color: var(--care-muted, #5a7184);
}

.doctor-card-hours .hours-times {
    color: var(--care-ink, #163e5f);
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

/* QR and its invitation together in one quiet panel. */
.doctor-card-share {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--care-border, #ddeaf3);
    border-radius: 16px;
    background: var(--care-surface-soft, #f7fbfe);
}

.doctor-card-qr img {
    display: block;
    width: 132px;
    height: 132px;
    padding: 8px;
    border: 1px solid var(--care-border, #ddeaf3);
    border-radius: 12px;
    background: #fff;
}

.doctor-card-link {
    min-width: 0;
}

.doctor-card-scan {
    margin: 0;
    color: var(--care-ink, #163e5f);
    font-size: .92rem;
    font-weight: 750;
}

.doctor-card-scan-hint {
    margin: 4px 0 0;
    color: var(--care-muted, #5a7184);
    font-size: .78rem;
}

.doctor-card-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.card-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--care-border, #ddeaf3);
    border-radius: 12px;
    color: var(--care-ink, #163e5f);
    background: transparent;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}

.card-button svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    stroke: currentColor;
}

.card-button.primary {
    grid-column: 1 / -1;
    color: #fff;
    background: var(--care-primary, #08765d);
    border-color: var(--care-primary, #08765d);
    box-shadow: 0 6px 18px rgba(8, 118, 93, .22);
}

.card-button:hover,
.card-button:focus-visible {
    border-color: var(--care-primary, #08765d);
}

.doctor-card-footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--care-border, #ddeaf3);
    color: var(--care-muted, #5a7184);
    font-size: .76rem;
    text-align: center;
}

[data-bs-theme="dark"] .doctor-card {
    border-color: rgba(255, 255, 255, .12);
    background: var(--care-card, #102a38);
}

[data-bs-theme="dark"] .doctor-card-avatar {
    border-color: var(--care-card, #102a38);
}

[data-bs-theme="dark"] .doctor-card-verified,
[data-bs-theme="dark"] .doctor-card-fact .fact-icon {
    color: #7fd4bd;
    background: rgba(13, 127, 102, .22);
}

[data-bs-theme="dark"] .doctor-card-hours .hours-heading,
[data-bs-theme="dark"] .care-doctor-card-page .back-link {
    color: #7fd4bd;
}

[data-bs-theme="dark"] .doctor-card-hours {
    background: rgba(13, 127, 102, .15);
}

@media (max-width: 620px) {
    .doctor-card {
        padding: 20px;
    }

    .doctor-card-share {
        flex-direction: column;
        text-align: center;
    }

    .doctor-card-qr img {
        margin-inline: auto;
    }

    .doctor-card-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .card-button:last-child {
        grid-column: 1 / -1;
    }
}

/* Printed, the card is the only thing on the page, keeps its colours, gains
   the brand strip, and always prints light — a dark theme is a screen choice,
   not a paper one. */
@media print {
    :root,
    [data-bs-theme="dark"] {
        --care-card: #ffffff;
        --care-surface-soft: #f7fbfe;
        --care-border: #ddeaf3;
        --care-muted: #5a7184;
        --care-ink: #163e5f;
        --care-primary: #08765d;
        --care-primary-dark: #055744;
        --sihatuna-green-soft: #e6f5f0;
    }

    body {
        background: #fff !important;
    }

    .care-header,
    .care-footer,
    .site-header,
    .site-footer,
    .theme-switch,
    #back-to-top,
    .care-doctor-card-page .back-link,
    .doctor-card-actions {
        display: none !important;
    }

    .care-doctor-card-page {
        padding: 0;
    }

    .doctor-card {
        border-color: #cfdcd6;
        box-shadow: none;
        /* The same medical tile the site paints behind every page. */
        background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cg fill='none' stroke='%2308765D' stroke-opacity='.05' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M30 20v20M20 30h20'/%3E%3Cpath d='M84 118h14l7-16 9 30 7-14h15'/%3E%3C/g%3E%3Cg fill='none' stroke='%234AA0D8' stroke-opacity='.05' stroke-width='2'%3E%3Ccircle cx='124' cy='44' r='8'/%3E%3Crect x='36' y='96' width='10' height='22' rx='5' transform='rotate(-35 41 107)'/%3E%3C/g%3E%3C/svg%3E");
        background-size: 160px 160px;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .doctor-card-print-brand {
        display: flex;
    }

    [data-bs-theme="dark"] .doctor-card-verified,
    [data-bs-theme="dark"] .doctor-card-fact .fact-icon {
        color: #055744;
        background: #e6f5f0;
    }

    [data-bs-theme="dark"] .doctor-card-hours .hours-heading {
        color: #055744;
    }

    [data-bs-theme="dark"] .doctor-card-hours {
        background: #e6f5f0;
    }
}
