/*
 * Salientis styling for Easy!Appointments (appointments.salientis.sg)
 *
 * Loaded after EA's own CSS by theme/company_color_style.php on the booking,
 * message and backend layouts. Tokens are copied verbatim from salientis.sg's
 * :root. See appointments/SPEC.md §4.1.
 *
 * Scope: everything below is limited via body:has(...) to the public pages
 * (booking wizard, message pages) and the account pages (admin login,
 * password recovery; styled per crenz 2026-10-08). The backend itself only
 * picks up the company colour that EA applies.
 *
 * !important is used only where EA/Bootstrap already use it or set inline
 * styles (utility classes like .bg-primary, .text-white, .rounded, and the
 * step indicators' inline style attributes).
 */

@font-face{
    font-family:"Mulish"; font-style:normal; font-weight:400 900; font-display:swap;
    src:url("fonts/mulish-latin-ext.woff2") format("woff2");
    unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face{
    font-family:"Mulish"; font-style:normal; font-weight:400 900; font-display:swap;
    src:url("fonts/mulish-latin.woff2") format("woff2");
    unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
    --paper:     #faf9f6;
    --surface:   #e7e5df;
    --structure: #96938a;
    --ink:       #111111;
    --insight:   #050505;
    --red:       #ed2939;
    --hair:      rgba(17, 17, 17, .18);
    --sans:      "Mulish", system-ui, sans-serif;

    /* --structure is only 2.9:1 on paper, too faint for text. Same hue,
       darkened to 5:1 for labels and secondary text. */
    --structure-text: #6f6c64;
}

/* ---------- page ground + Bootstrap variables ---------- */

body:has(#book-appointment-wizard),
body:has(#message-frame),
body:has(.card.min-vh-mobile) {
    --bs-body-font-family: var(--sans);
    --bs-body-color: var(--ink);
    --bs-body-color-rgb: 17, 17, 17;
    --bs-body-bg: var(--paper);
    --bs-body-bg-rgb: 250, 249, 246;
    --bs-secondary-color: var(--structure-text);
    --bs-border-color: var(--hair);
    --bs-border-radius: 0;
    --bs-border-radius-sm: 0;
    --bs-border-radius-lg: 0;
    --bs-link-color: var(--ink);
    --bs-link-color-rgb: 17, 17, 17;
    --bs-link-hover-color: var(--ink);
    --bs-link-hover-color-rgb: 17, 17, 17;
    --bs-focus-ring-color: transparent;

    font-family: var(--sans);
    color: var(--ink);
    background: var(--paper) !important;
    -webkit-font-smoothing: antialiased;
    line-height: 1.55;
}

body:has(#book-appointment-wizard) ::selection,
body:has(#message-frame) ::selection,
body:has(.card.min-vh-mobile) ::selection {
    background: var(--ink);
    color: var(--paper);
}

/* ---------- the wizard frame: hairline, no shadow, no rounding ---------- */

#book-appointment-wizard {
    background: var(--paper) !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

@media (min-width: 768px) {
    #book-appointment-wizard {
        border: 1px solid var(--hair);
    }
}

/* ---------- header: paper ground, ink wordmark, red salient dot ---------- */

#book-appointment-wizard #header.bg-primary {
    background: var(--paper) !important;
    border-bottom: 1px solid var(--hair);
    /* company_color_style forces border-color: primary !important on #header */
    border-color: var(--hair) !important;
}

#book-appointment-wizard #company-name {
    color: var(--ink) !important;
    font-weight: 700 !important;
    letter-spacing: .01em;
}

#book-appointment-wizard #company-logo {
    max-height: 48px !important;
}

/* The template wraps the name in whitespace inside the <span>; as an
   inline-flex box the edge whitespace collapses, so the dot sits tight
   against the last letter as on salientis.sg. */
#book-appointment-wizard #company-name > span {
    display: inline-flex;
    align-items: baseline;
}

#book-appointment-wizard #company-name > span::after {
    content: "";
    display: inline-block;
    width: .255em;
    height: .255em;
    margin-left: .06em;
    border-radius: 50%;
    background: var(--red);
    vertical-align: baseline;
}

#book-appointment-wizard #company-name .display-booking-selection {
    color: var(--structure-text) !important;
    border-right-color: var(--hair) !important;
    font-weight: 600 !important;
    letter-spacing: .02em;
}

/* ---------- step indicators: ink square when active, hairline otherwise ---------- */

#book-appointment-wizard .book-step {
    border-radius: 0 !important;
}

#book-appointment-wizard .book-step.active-step {
    background: var(--ink) !important;
}

#book-appointment-wizard .book-step.active-step strong {
    color: var(--paper) !important;
}

#book-appointment-wizard .book-step:not(.active-step) {
    background: transparent !important;
    box-shadow: inset 0 0 0 1px var(--hair);
}

#book-appointment-wizard .book-step:not(.active-step) strong {
    color: var(--structure-text) !important;
}

/* ---------- step headings: salientis.sg's uppercase label with a hairline ---------- */

#book-appointment-wizard .frame-title {
    display: flex;
    align-items: center;
    gap: .9em;
    margin-top: 0 !important;
    font-size: .74rem;
    font-weight: 700 !important;
    letter-spacing: .16em;
    text-transform: uppercase;
    text-align: left !important;
    color: var(--structure-text) !important;
}

#book-appointment-wizard .frame-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--hair);
}

#book-appointment-wizard label,
#book-appointment-wizard .form-label {
    font-weight: 600;
}

/* ---------- buttons ---------- */

#book-appointment-wizard .btn,
#message-frame .btn {
    border-radius: 0 !important;
    font-weight: 600;
    letter-spacing: .02em;
}

#book-appointment-wizard .btn-dark,
#book-appointment-wizard .btn-primary,
#message-frame .btn-dark,
#message-frame .btn-primary {
    --bs-btn-bg: var(--ink);
    --bs-btn-border-color: var(--ink);
    --bs-btn-color: var(--paper);
    --bs-btn-hover-bg: var(--insight);
    --bs-btn-hover-border-color: var(--insight);
    --bs-btn-hover-color: var(--paper);
    --bs-btn-active-bg: var(--insight);
    --bs-btn-active-border-color: var(--insight);
    --bs-btn-disabled-bg: var(--structure-text);
    --bs-btn-disabled-border-color: var(--structure-text);
    background-color: var(--ink) !important;
    /* the default Bootswatch theme paints .btn-primary with a green gradient */
    background-image: none !important;
    border-color: var(--ink) !important;
    color: var(--paper) !important;
    box-shadow: none !important;
}

#book-appointment-wizard .btn-outline-secondary,
#book-appointment-wizard .btn-outline-primary,
#book-appointment-wizard .btn-light,
#book-appointment-wizard .btn-outline-dark {
    --bs-btn-color: var(--ink);
    --bs-btn-border-color: var(--hair);
    --bs-btn-hover-bg: var(--surface);
    --bs-btn-hover-border-color: var(--ink);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-active-bg: var(--surface);
    --bs-btn-active-color: var(--ink);
    background-color: transparent;
    background-image: none !important;
    color: var(--ink) !important;
    box-shadow: none !important;
}

/* available-hour buttons: hairline boxes, ink when selected */
#book-appointment-wizard #available-hours .available-hour {
    border-radius: 0 !important;
    border-color: var(--hair) !important;
    color: var(--ink) !important;
    font-weight: 600;
}

#book-appointment-wizard #available-hours .available-hour:hover {
    border-color: var(--ink) !important;
}

#book-appointment-wizard #available-hours .selected-hour {
    background-color: var(--ink) !important;
    /* the default Bootswatch theme paints .btn-primary with a green gradient */
    background-image: none !important;
    border-color: var(--ink) !important;
    color: var(--paper) !important;
    box-shadow: none !important;
}

/* ---------- form controls: hairline borders, square corners ---------- */

#book-appointment-wizard .form-control,
#book-appointment-wizard .form-select {
    border-radius: 0 !important;
    border-color: var(--hair);
    background-color: #fff;
    color: var(--ink);
}

#book-appointment-wizard .form-control:focus,
#book-appointment-wizard .form-select:focus {
    border-color: var(--ink);
    box-shadow: none;
}

#book-appointment-wizard .form-check-input:checked {
    background-color: var(--ink);
    border-color: var(--ink);
}

/* ---------- calendar (flatpickr inline) ---------- */

#book-appointment-wizard .flatpickr-calendar.inline {
    border-radius: 0 !important;
    box-shadow: inset 0 0 0 1px var(--hair) !important;
}

#book-appointment-wizard .flatpickr-months,
#book-appointment-wizard .flatpickr-weekdays,
#book-appointment-wizard span.flatpickr-weekday,
#book-appointment-wizard .flatpickr-month {
    border-radius: 0 !important;
}

#book-appointment-wizard .flatpickr-day.selected,
#book-appointment-wizard .flatpickr-day.selected:hover {
    background: var(--ink) !important;
    border-color: var(--ink) !important;
    color: var(--paper) !important;
}

/* ---------- final step: ALTCHA box, summary ---------- */

#book-appointment-wizard .altcha-challenge {
    background: var(--paper) !important;
    border: 1px solid var(--hair) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

#book-appointment-wizard .altcha,
#book-appointment-wizard altcha-widget {
    --altcha-border-radius: 0;
    --altcha-color-border: var(--hair);
    --altcha-color-base: var(--paper);
    --altcha-color-text: var(--ink);
    --altcha-color-border-focus: var(--ink);
    --altcha-color-error-text: var(--red);
}

/* ---------- manage page: "cancel appointment" bar (link from the booking email) ---------- */

#book-appointment-wizard #cancel-appointment-frame {
    background: var(--surface) !important;
    border-bottom: 1px solid var(--hair);
    color: var(--ink);
}

#book-appointment-wizard #cancel-appointment {
    background: transparent !important;
    background-image: none !important;
    border: 1px solid var(--ink) !important;
    border-radius: 0 !important;
    color: var(--ink) !important;
    font-weight: 600;
    box-shadow: none !important;
}

#book-appointment-wizard #cancel-appointment:hover {
    background: var(--ink) !important;
    color: var(--paper) !important;
}

/* ---------- message pages (confirmation, cancellation, notices) ---------- */

#message-frame {
    background: var(--paper) !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

@media (min-width: 768px) {
    #message-frame {
        border: 1px solid var(--hair);
    }
}

/* Status icon: ink glyph in a hairline square instead of a tinted circle.
   The title carries the meaning (registered / cancelled). */
#message-frame .rounded-circle.bg-opacity-10 {
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: inset 0 0 0 1px var(--hair);
}

#message-frame .rounded-circle.bg-opacity-10 > * {
    color: var(--ink) !important;
}

/* Title in ink. No salient dot here: EA's titles end in "!", and a dot
   after it reads as "!." */
#message-frame h3,
#message-frame h4 {
    color: var(--ink) !important;
    font-weight: 600 !important;
    letter-spacing: -.01em;
    text-wrap: balance;
}

#message-frame .btn-outline-primary {
    --bs-btn-color: var(--ink);
    --bs-btn-border-color: var(--hair);
    --bs-btn-hover-bg: var(--surface);
    --bs-btn-hover-border-color: var(--ink);
    --bs-btn-hover-color: var(--ink);
    background-image: none !important;
    color: var(--ink) !important;
    box-shadow: none !important;
}

#message-frame a:not(.btn) {
    color: var(--structure-text);
    text-decoration-color: var(--hair);
    text-underline-offset: 2px;
}

/* ---------- account pages: admin login, password recovery ---------- */

body:has(.card.min-vh-mobile) .card {
    background: var(--paper) !important;
    border: 1px solid var(--hair) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

body:has(.card.min-vh-mobile) .card-footer {
    background: transparent;
    border-top-color: var(--hair);
    color: var(--structure-text);
}

/* login.php hard-codes the Easy!Appointments logo as an <img>; hide it and
   draw the Salientis mark on its container instead. */
body:has(.card.min-vh-mobile) img[src*="assets/img/logo.png"] {
    display: none;
}

body:has(.card.min-vh-mobile) .card-body > .text-center:first-child {
    padding-top: 64px;
    background: url("logo.svg") center top / auto 48px no-repeat;
}

body:has(.card.min-vh-mobile) .card-body h4 {
    color: var(--ink) !important;
    font-weight: 700 !important;
}

body:has(.card.min-vh-mobile) .card-body h4::after {
    content: "";
    display: inline-block;
    width: .255em;
    height: .255em;
    margin-left: .06em;
    border-radius: 50%;
    background: var(--red);
    vertical-align: baseline;
}

body:has(.card.min-vh-mobile) .form-control {
    border-radius: 0 !important;
    border-color: var(--hair);
    background-color: #fff;
}

body:has(.card.min-vh-mobile) .input-group-text {
    border-radius: 0 !important;
    border-color: var(--hair);
    background: var(--paper);
    color: var(--ink);
}

body:has(.card.min-vh-mobile) .form-control:focus {
    border-color: var(--ink);
    box-shadow: none;
}

body:has(.card.min-vh-mobile) .btn {
    border-radius: 0 !important;
    font-weight: 600;
    letter-spacing: .02em;
}

body:has(.card.min-vh-mobile) .btn-primary {
    background-color: var(--ink) !important;
    background-image: none !important;
    border-color: var(--ink) !important;
    color: var(--paper) !important;
    box-shadow: none !important;
}

body:has(.card.min-vh-mobile) .btn-primary:hover {
    background-color: var(--insight) !important;
}

body:has(.card.min-vh-mobile) a:not(.btn) {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--hair);
    text-underline-offset: 2px;
}

body:has(.card.min-vh-mobile) .altcha-challenge {
    background: var(--paper) !important;
    border: 1px solid var(--hair) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* ---------- footer ---------- */

#book-appointment-wizard #frame-footer {
    border-top-color: var(--hair) !important;
    color: var(--structure-text);
}

#book-appointment-wizard #frame-footer a {
    color: var(--structure-text);
    text-decoration: underline;
    text-decoration-color: var(--hair);
    text-underline-offset: 2px;
}

#book-appointment-wizard #frame-footer #select-language {
    background: transparent !important;
    color: var(--structure-text) !important;
    border: 1px solid var(--hair);
    border-radius: 0 !important;
    font-weight: 600;
}

/* ---------- focus: salientis.sg's red ring, everywhere on the public pages ---------- */

body:has(#book-appointment-wizard) :focus-visible,
body:has(#message-frame) :focus-visible,
body:has(.card.min-vh-mobile) :focus-visible {
    outline: 2px solid var(--red) !important;
    outline-offset: 3px;
    box-shadow: none !important;
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
    #book-appointment-wizard *,
    #book-appointment-wizard *::before,
    #book-appointment-wizard *::after {
        animation: none !important;
        transition: none !important;
    }
}
