/*
 * Monoceros Scheduler — widget styles.
 *
 * Every color / spacing / font the widget uses goes through a --sched-*
 * custom property declared once below. A host page re-themes the widget by
 * overriding these tokens on `.mc-scheduler` (or any ancestor) — nothing
 * else in this file uses a raw literal. This is what satisfies the repo's
 * style-guard raw-color ratchet (colors only inside :root token lines).
 *
 * Layout: two-pane (event info left, calendar+slots right) at >=900px,
 * stacked below that. The widget owns its own overflow-x so a very old
 * narrow viewport never pushes the host page into horizontal scroll.
 */

:root {
    /* Brand colors, Monoceros-derived defaults. */
    --sched-accent: rgb(229, 46, 119);
    --sched-accent-hover: rgb(36, 128, 151);
    --sched-accent-soft: rgba(229, 46, 119, 0.08);
    --sched-accent2: rgb(36, 128, 151);

    /* Neutrals */
    --sched-text: #111;
    --sched-text-inverse: #fff;
    --sched-muted: #888;
    --sched-border: #ddd;
    --sched-border-soft: #eee;
    --sched-bg: #fff;
    --sched-bg-subtle: #f7f7f7;
    --sched-bg-raised: #fafafa;

    /* Status */
    --sched-success: #1a7a2e;
    --sched-error: rgb(229, 46, 119);
    --sched-warning-bg: #fff3cd;
    --sched-warning-border: #ffc107;
    --sched-warning-text: #664d03;

    /* Skeleton shimmer */
    --sched-skeleton-base: #ececec;
    --sched-skeleton-shine: #f7f7f7;

    /* Overlay / modal */
    --sched-overlay-bg: rgba(17, 17, 17, 0.55);
    --sched-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);

    /* Typography */
    --sched-font: 'MarkPro', 'Helvetica Neue', Helvetica, Arial;
    --sched-font-light: 'MarkPro', 'Helvetica Neue', Helvetica, Arial;

    /* Spacing scale — the site leans on generous whitespace. */
    --sched-gap-xs: 6px;
    --sched-gap-sm: 12px;
    --sched-gap-md: 20px;
    --sched-gap-lg: 40px;

    --sched-radius: 0px;
    --sched-radius-sm: 4px;
    --sched-radius-round: 50%;

    --sched-focus-ring: rgb(36, 128, 151);
    --sched-z-modal: 1000;
    /* Clearance reserved above the widget when it's programmatically
       scrolled into view (see scheduler.js _render()), so a step change
       never lands new content underneath a host page's sticky header. A
       host page with a taller fixed header should override this token. */
    --sched-scroll-offset: 100px;
}

/* ── Reset scoped to the widget only ── */

.mc-scheduler,
.mc-scheduler * {
    box-sizing: border-box;
}

.mc-scheduler {
    position: relative;
    font-family: var(--sched-font-light);
    color: var(--sched-text);
    background: var(--sched-bg);
    font-size: 15px;
    line-height: 1.5;
    max-width: 100%;
    overflow-x: auto;
    text-align: left;
    scroll-margin-top: var(--sched-scroll-offset);
}

/* :where() keeps the reset at element specificity so component classes such as .mc-btn can override it. */
:where(.mc-scheduler) button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
    text-align: inherit;
}

:where(.mc-scheduler) button:disabled {
    cursor: default;
}

.mc-scheduler a {
    color: var(--sched-accent);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

.mc-scheduler a:hover {
    text-decoration-style: solid;
}

.mc-scheduler :focus {
    outline: none;
}

.mc-scheduler :focus-visible {
    outline: 2px solid var(--sched-focus-ring);
    outline-offset: 2px;
}

.mc-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Honeypot field: visually and structurally hidden, but still present in
   the DOM (not display:none) so unsophisticated bots that only skip
   display:none fields still fall for it. Never in the visible tab order. */
.mc-hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ── Frame / header row ── */

.mc-head {
    display: flex;
    align-items: center;
    gap: var(--sched-gap-sm);
    margin-bottom: var(--sched-gap-md);
}

.mc-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--sched-radius-round);
    color: var(--sched-text);
    flex: 0 0 auto;
}

.mc-back:hover {
    background: var(--sched-bg-subtle);
}

.mc-back svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.mc-step-title {
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* ── Banner (reschedule "former time") ── */

.mc-banner {
    background: var(--sched-warning-bg);
    border: 1px solid var(--sched-warning-border);
    border-radius: var(--sched-radius-sm);
    padding: var(--sched-gap-sm) var(--sched-gap-md);
    margin-bottom: var(--sched-gap-md);
    font-size: 14px;
    color: var(--sched-warning-text);
}

.mc-banner strong {
    font-weight: 600;
}

/* ── Step 0: event type cards ── */

.mc-type-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sched-gap-sm);
}

.mc-type-card {
    display: block;
    width: 100%;
    text-align: left;
    border: 1px solid var(--sched-border);
    border-radius: var(--sched-radius-sm);
    padding: var(--sched-gap-md);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.mc-type-card:hover,
.mc-type-card:focus-visible {
    border-color: var(--sched-accent);
    background: var(--sched-accent-soft);
}

.mc-type-name {
    font-size: 16px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.mc-type-duration {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--sched-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 8px;
}

.mc-type-desc {
    font-size: 14px;
    color: var(--sched-muted);
}

/* ── Two-pane layout ── */

.mc-grid {
    display: block;
}

.mc-info {
    margin-bottom: var(--sched-gap-lg);
}

.mc-info-organizer {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--sched-muted);
    margin-bottom: var(--sched-gap-xs);
}

.mc-info-name {
    font-size: 24px;
    text-transform: uppercase;
    margin-bottom: var(--sched-gap-sm);
}

.mc-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--sched-text);
    margin-bottom: 8px;
}

.mc-info-row svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
}

.mc-info-meet {
    color: var(--sched-muted);
}

.mc-info-desc {
    margin-top: var(--sched-gap-md);
    font-size: 14px;
    color: var(--sched-muted);
}

.mc-panel {
    min-width: 0;
}

@media (min-width: 900px) {
    .mc-grid {
        display: grid;
        grid-template-columns: 300px 1fr;
        gap: var(--sched-gap-lg);
    }

    .mc-info {
        margin-bottom: 0;
        padding-right: var(--sched-gap-lg);
        border-right: 1px solid var(--sched-border);
    }
}

/* ── Calendar + slots sub-grid ── */

.mc-cal-slots {
    display: block;
    min-width: 0;
}

@media (min-width: 620px) {
    .mc-cal-slots.has-slots {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 220px;
        gap: var(--sched-gap-lg);
        align-items: start;
    }
}

.mc-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sched-gap-md);
}

.mc-cal-month {
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.mc-cal-nav-btns {
    display: flex;
    gap: 4px;
}

.mc-cal-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--sched-radius-round);
    color: var(--sched-text);
}

.mc-cal-chevron svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.mc-cal-chevron:hover:not(:disabled) {
    background: var(--sched-bg-subtle);
}

.mc-cal-chevron:disabled {
    opacity: 0.25;
}

.mc-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 4px;
}

.mc-cal-weekdays span {
    text-align: center;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--sched-muted);
    letter-spacing: 0.03em;
}

.mc-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
}

.mc-day {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--sched-radius-round);
    font-size: 14px;
    color: var(--sched-text);
}

.mc-day.mc-day-blank {
    visibility: hidden;
}

.mc-day.mc-day-disabled {
    color: var(--sched-border);
    cursor: default;
}

.mc-day.mc-day-available {
    color: var(--sched-accent);
    font-weight: 600;
}

.mc-day.mc-day-available:hover {
    background: var(--sched-accent-soft);
}

.mc-day.mc-day-selected {
    background: var(--sched-accent);
    color: var(--sched-text-inverse);
}

.mc-day.mc-day-today:not(.mc-day-selected)::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
}

/* ── Timezone / format row ── */

.mc-tzrow {
    margin-top: var(--sched-gap-md);
    padding-top: var(--sched-gap-md);
    border-top: 1px solid var(--sched-border-soft);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sched-gap-sm);
    font-size: 13px;
    position: relative;
}

.mc-tz-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--sched-text);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

.mc-tz-btn:hover {
    text-decoration-style: solid;
}

.mc-fmt-toggle {
    display: inline-flex;
    border: 1px solid var(--sched-border);
    border-radius: var(--sched-radius-sm);
    overflow: hidden;
}

.mc-fmt-toggle button {
    padding: 4px 10px;
    font-size: 12px;
    text-transform: uppercase;
}

.mc-fmt-toggle button.active {
    background: var(--sched-accent);
    color: var(--sched-text-inverse);
}

.mc-tz-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: min(320px, 100%);
    max-height: 280px;
    overflow-y: auto;
    background: var(--sched-bg);
    border: 1px solid var(--sched-border);
    border-radius: var(--sched-radius-sm);
    box-shadow: var(--sched-shadow);
    z-index: 5;
    display: none;
}

.mc-tz-dropdown.open {
    display: block;
}

.mc-tz-search {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    border: 0;
    border-bottom: 1px solid var(--sched-border-soft);
    background: var(--sched-bg);
    color: var(--sched-text);
    position: sticky;
    top: 0;
}

.mc-tz-option {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
}

.mc-tz-option:hover,
.mc-tz-option:focus-visible {
    background: var(--sched-bg-subtle);
}

.mc-tz-option.active {
    color: var(--sched-accent);
    font-weight: 600;
}

/* ── Slots column ── */

.mc-slots {
    margin-top: var(--sched-gap-md);
}

@media (min-width: 620px) {
    .has-slots .mc-slots {
        margin-top: 0;
    }
}

.mc-slots-heading {
    font-size: 13px;
    text-transform: uppercase;
    color: var(--sched-muted);
    letter-spacing: 0.03em;
    margin-bottom: var(--sched-gap-sm);
}

.mc-slots-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 2px;
}

.mc-slot {
    display: flex;
    flex-shrink: 0;
    border: 1px solid var(--sched-accent);
    border-radius: var(--sched-radius-sm);
    overflow: hidden;
}

.mc-slot-time {
    flex: 1;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--sched-accent);
    background: var(--sched-bg);
}

.mc-slot.mc-slot-picked .mc-slot-time {
    background: var(--sched-accent);
    color: var(--sched-text-inverse);
}

.mc-slot-confirm {
    flex: 0 0 auto;
    padding: 10px 16px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--sched-accent);
    color: var(--sched-text-inverse);
    display: none;
}

.mc-slot.mc-slot-picked .mc-slot-confirm {
    display: block;
}

.mc-slot-confirm:hover {
    background: var(--sched-accent-hover);
}

.mc-empty-note {
    font-size: 14px;
    color: var(--sched-muted);
    padding: var(--sched-gap-md) 0;
}

/* ── Buttons (echo the site .btn look) ── */

.mc-btn {
    display: inline-block;
    font-size: 14px;
    text-transform: uppercase;
    padding: 12px 28px;
    background: var(--sched-accent);
    color: var(--sched-text-inverse);
    border-radius: var(--sched-radius);
    letter-spacing: 0.03em;
    transition: background 0.25s ease;
}

.mc-btn:hover:not(:disabled) {
    background: var(--sched-accent-hover);
}

.mc-btn:disabled {
    opacity: 0.55;
}

.mc-btn-outline {
    background: transparent;
    color: var(--sched-text);
    box-shadow: inset 0 0 0 1px var(--sched-border);
}

.mc-btn-outline:hover {
    background: var(--sched-accent-hover);
    color: var(--sched-text-inverse);
    box-shadow: inset 0 0 0 1px var(--sched-accent-hover);
}

.mc-btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* ── Details form ── */

.mc-form {
    display: flex;
    flex-direction: column;
    gap: var(--sched-gap-sm);
    max-width: 480px;
}

.mc-form label {
    font-size: 13px;
    display: block;
}

.mc-form .mc-field-hint {
    font-size: 12px;
    color: var(--sched-muted);
    font-weight: normal;
    text-transform: none;
}

.mc-form :is(input, textarea) {
    margin-top: 4px;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--sched-border);
    border-radius: var(--sched-radius);
    background: var(--sched-bg);
    color: var(--sched-text);
    width: 100%;
}

.mc-form :is(input, textarea):focus-visible {
    border-color: var(--sched-accent);
}

.mc-form textarea {
    resize: vertical;
    min-height: 80px;
}

.mc-field-error {
    display: block;
    font-size: 12px;
    color: var(--sched-error);
    margin-top: 4px;
    min-height: 14px;
}

.mc-guest-toggle {
    align-self: flex-start;
    font-size: 13px;
    color: var(--sched-accent);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

.mc-guest-toggle:hover {
    text-decoration-style: solid;
}

.mc-guests-wrap {
    display: none;
}

.mc-guests-wrap.open {
    display: block;
}

.mc-selected-slot-summary {
    font-size: 13px;
    color: var(--sched-muted);
    margin-bottom: var(--sched-gap-sm);
}

.mc-selected-slot-summary strong {
    color: var(--sched-text);
    font-weight: 600;
}

/* ── Confirmation ── */

.mc-confirm {
    text-align: center;
    max-width: 420px;
    margin: 0 auto;
    padding: var(--sched-gap-lg) 0;
}

.mc-check {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--sched-success);
    color: var(--sched-text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--sched-gap-md);
}

.mc-check svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
}

.mc-confirm-title {
    font-size: 22px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.mc-confirm-sub {
    font-size: 14px;
    color: var(--sched-muted);
    margin-bottom: var(--sched-gap-md);
}

.mc-confirm-card {
    text-align: left;
    border: 1px solid var(--sched-border);
    border-radius: var(--sched-radius-sm);
    padding: var(--sched-gap-sm) var(--sched-gap-md);
    margin-bottom: var(--sched-gap-md);
}

.mc-confirm-event {
    font-size: 16px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.mc-confirm-when {
    font-size: 14px;
    margin-bottom: var(--sched-gap-sm);
    padding-bottom: var(--sched-gap-sm);
    border-bottom: 1px solid var(--sched-border-soft);
}

.mc-confirm-meet {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 2px 0;
}

/* The Meet glyph is an inline icon on the link row, not a hero image — an
   unsized <svg> falls back to the browser default (300x150) otherwise. */
.mc-confirm-meet svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    color: var(--sched-muted);
}

.mc-confirm-meet a {
    color: var(--sched-text);
    font-weight: 600;
    text-decoration: none;
}

.mc-confirm-meet a:hover {
    text-decoration: underline;
}

.mc-copy-btn {
    margin-left: auto;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--sched-accent2);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    flex: 0 0 auto;
}

.mc-copy-btn:hover {
    text-decoration-style: solid;
}

.mc-confirm-links {
    display: flex;
    justify-content: center;
    gap: var(--sched-gap-md);
    font-size: 13px;
}

/* ── Loading / skeleton ── */

.mc-skeleton {
    background: linear-gradient(90deg, var(--sched-skeleton-base) 25%, var(--sched-skeleton-shine) 37%, var(--sched-skeleton-base) 63%);
    background-size: 400% 100%;
    animation: mc-shimmer 1.4s ease infinite;
    border-radius: var(--sched-radius-round);
}

@keyframes mc-shimmer {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mc-skeleton {
        animation: none;
    }
}

.mc-skel-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.mc-skel-day {
    aspect-ratio: 1;
}

.mc-slots-list .mc-skeleton.mc-slot {
    height: 40px;
    border: 0;
    border-radius: var(--sched-radius-sm);
}

/* ── Toast / status ── */

.mc-status {
    font-size: 13px;
    min-height: 18px;
}

.mc-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    background: var(--sched-text);
    color: var(--sched-text-inverse);
    padding: 12px 20px;
    border-radius: var(--sched-radius-sm);
    font-size: 13px;
    box-shadow: var(--sched-shadow);
    z-index: calc(var(--sched-z-modal) + 1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.mc-toast.visible {
    opacity: 1;
}

/* ── Popup modal variant ── */

.mc-popup-overlay {
    position: fixed;
    inset: 0;
    background: var(--sched-overlay-bg);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--sched-gap-md);
    z-index: var(--sched-z-modal);
}

.mc-popup-overlay.open {
    display: flex;
}

.mc-popup-modal {
    position: relative;
    background: var(--sched-bg);
    border-radius: var(--sched-radius-sm);
    box-shadow: var(--sched-shadow);
    max-width: 960px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: var(--sched-gap-lg);
}

.mc-popup-close {
    position: absolute;
    top: var(--sched-gap-sm);
    right: var(--sched-gap-sm);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--sched-radius-round);
    color: var(--sched-muted);
    z-index: 1;
}

.mc-popup-close:hover {
    background: var(--sched-bg-subtle);
    color: var(--sched-text);
}

.mc-popup-close svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

@media (max-width: 619px) {
    .mc-popup-modal {
        padding: var(--sched-gap-md);
    }
}

/* ── Small screens ── */

@media (max-width: 480px) {
    .mc-confirm-links {
        flex-direction: column;
        gap: var(--sched-gap-sm);
    }

    .mc-slots-list {
        max-height: none;
    }
}

/* Applied to <body> while a popup modal is open (global, unscoped — the
   scroll lock target is outside .mc-scheduler by definition). */
.mc-scroll-lock {
    overflow: hidden;
}
