/*
 * Booking flow styling, ported from the Fit4Life Node prototype
 * (fit4life-booking/public/styles.css). Everything is namespaced under
 * .f4l-booking so the generic prototype class names never collide with
 * MudBlazor. The prototype's --blue is mapped to the app's MudBlazor
 * primary (BYU-Idaho #0076b6) so cards match the brand.
 */
.f4l-booking {
    --blue: var(--mud-palette-primary);
    /* Both follow Admin > Settings > Theme colors (primary and dark) via MainLayout's MudTheme. */
    --blue-soft: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent);
    --navy: var(--mud-palette-dark, #16243d);
    --card: #eeeeee;
    --line: #e3e8f0;
    --muted: #66738a;
    --green: #1d9e6f;
    --red: #d64545;
    --radius: 14px;
}

/* Sticky Back/Next footer so the primary action stays visible without scrolling. */
.f4l-booking .wizard-nav {
    position: sticky;
    bottom: 0;
    background-color: var(--mud-palette-surface, #fff);
    padding: 12px 0;
    margin-top: 24px;
    border-top: 1px solid var(--line);
    z-index: 2;
}

/* Path bar (Book Training / Team Training) */
.f4l-booking .cat-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.f4l-booking .cat-tabs button {
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--navy);
}

.f4l-booking .cat-tabs button.active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}

/* Full-width admin-authored landing content on the home page */
.f4l-booking .landing-content {
    width: 100%;
}

.f4l-booking .landing-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}

/* Category section headers (grouped "All packages" view) */
.f4l-booking .cat-header {
    margin: 26px 0 10px;
}

.f4l-booking .cat-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.f4l-booking .cat-header p.sub {
    margin: 2px 0 12px;
    color: var(--muted);
    font-size: 0.875rem;
}

/* Card grid */
.f4l-booking .grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

/* Cards (packages, trainers, classes) */
.f4l-booking .card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    cursor: pointer;
    position: relative;
    transition: border-color .15s, transform .15s, box-shadow .15s;
}

.f4l-booking .card:hover {
    border-color: var(--blue);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(22, 36, 61, .08);
}

.f4l-booking .card.selected {
    border: 2px solid var(--blue);
    box-shadow: 0 8px 20px rgba(0, 118, 182, .15);
}

.f4l-booking .card.disabled {
    opacity: .45;
    cursor: not-allowed;
}

.f4l-booking .card.disabled:hover {
    border-color: var(--line);
    transform: none;
    box-shadow: none;
}

.f4l-booking .card .badge {
    position: absolute;
    top: -10px;
    left: 14px;
    background: var(--blue);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.f4l-booking .card h3 {
    margin: 4px 0 6px;
    font-size: 1rem;
}

.f4l-booking .card .pill {
    display: inline-block;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.f4l-booking .card .price {
    font-size: 1.875rem;
    font-weight: 800;
}

.f4l-booking .card .price small {
    font-size: 0.8125rem;
    color: var(--muted);
    font-weight: 500;
}

.f4l-booking .card .price s {
    font-size: 1rem;
    color: var(--muted);
    font-weight: 500;
    margin-right: 8px;
}

.f4l-booking .card p.desc {
    color: var(--muted);
    font-size: 0.8125rem;
    line-height: 1.45;
    margin: 8px 0;
}

.f4l-booking .card ul {
    margin: 8px 0 0;
    padding: 0 0 0 2px;
    list-style: none;
}

.f4l-booking .card ul li {
    font-size: 0.78125rem;
    color: var(--navy);
    padding: 3px 0;
}

.f4l-booking .card ul li::before {
    content: "\2713  ";
    color: var(--green);
    font-weight: 700;
}

.f4l-booking .card .meta {
    font-size: 0.78125rem;
    color: var(--muted);
    margin-top: 6px;
}

.f4l-booking .card .spots {
    font-size: 0.78125rem;
    font-weight: 700;
    color: var(--green);
    margin-top: 6px;
}

.f4l-booking .card .spots.full {
    color: var(--red);
}

/* Hero (booking-method) screen, ported from the fit4life-prototype hero */
.f4l-booking .hero {
    display: grid;
    grid-template-columns: minmax(0, 55%) minmax(0, 45%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 480px;
}

.f4l-booking .hero-copy {
    display: grid;
    place-items: center;
    padding: 48px 32px;
    text-align: center;
}

.f4l-booking .hero-copy h1 {
    margin: 0;
    font-size: clamp(1.75rem, 3vw, 2.75rem);
    letter-spacing: .03em;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--navy);
}

.f4l-booking .hero-copy .rule {
    height: 4px;
    background: var(--line);
    width: 76%;
    margin: 28px auto;
}

.f4l-booking .hero-copy h2 {
    margin: 0;
    font-weight: 300;
    color: var(--muted);
    line-height: 1.1;
    font-size: clamp(1.375rem, 2.2vw, 2.125rem);
}

.f4l-booking .hero-copy img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}

.f4l-booking .hero-image {
    background: linear-gradient(to right, rgba(0, 0, 0, .1), rgba(0, 0, 0, .2)),
        url("img/training-hero.png") center / cover no-repeat;
    min-height: 300px;
}

/* Big choice pills (booking method / training type) */
.f4l-booking .choice-row {
    display: flex;
    justify-content: center;
    gap: clamp(16px, 3vw, 48px);
    margin-top: 40px;
    flex-wrap: wrap;
}

.f4l-booking .choice-pill {
    min-width: 220px;
    padding: 18px 30px;
    border-radius: 999px;
    border: 2px solid var(--blue);
    background: var(--blue);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.f4l-booking .choice-pill:hover {
    transform: translateY(-1px);
    background: var(--navy);
    border-color: var(--navy);
    box-shadow: 0 8px 20px rgba(22, 36, 61, .12);
}

/* The chosen pill goes darker so it stays distinguishable from the blue siblings. */
.f4l-booking .choice-pill.selected,
.f4l-booking .choice-pill.selected:hover {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.f4l-booking .training-type-row {
    margin-top: 24px;
}

.f4l-booking .training-type-row .choice-pill {
    min-width: 260px;
}

@media (max-width: 900px) {
    .f4l-booking .hero {
        grid-template-columns: 1fr;
    }

    .f4l-booking .hero-image {
        order: -1;
        min-height: 200px;
    }

    .f4l-booking .choice-pill,
    .f4l-booking .training-type-row .choice-pill {
        min-width: 100%;
        font-size: 1.125rem;
        padding: 14px 22px;
    }
}

/* Trainer cards: compact so more trainers fit without scrolling; the bio opens inline. */
.f4l-booking .trainer-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.f4l-booking .trainer-card {
    cursor: default;
    padding: 14px;
}

.f4l-booking .trainer-card.expanded {
    grid-column: 1 / -1;
}

.f4l-booking .trainer-card .trainer-head {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.f4l-booking .trainer-card.expanded .trainer-head {
    flex-direction: row;
    gap: 14px;
}

.f4l-booking .trainer-card .trainer-meta h3 {
    margin-top: 0;
}

.f4l-booking .trainer-card .rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 0.8125rem;
    color: var(--muted);
}

.f4l-booking .trainer-card .trainer-reviews {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.f4l-booking .trainer-card .trainer-reviews figure {
    margin: 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--blue-soft);
}

.f4l-booking .trainer-card .trainer-reviews blockquote {
    margin: 4px 0 2px;
    font-size: 0.875rem;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.f4l-booking .trainer-card .trainer-reviews figcaption {
    font-size: 0.75rem;
    color: var(--muted);
}

.f4l-booking .trainer-card .more {
    display: block;
    margin-top: 6px;
    color: var(--blue);
    font-size: 0.8125rem;
    font-weight: 600;
}

.f4l-booking .trainer-card p.desc {
    white-space: pre-line;
}

/* Trainer photos */
.f4l-booking .tphoto {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin-bottom: 10px;
    border: 2px solid var(--line);
    background: var(--blue-soft);
}

.f4l-booking .tphoto.initials {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.375rem;
    color: var(--blue);
}

/* ---- Raw-HTML source editing (email templates, landing page content) ----------------------
   The selector targets the inner element, not the wrapper: Class on a MudTextField lands on the
   outer div. This also restyles the existing landing-content field on Admin → Settings, which
   already carried this class but had no rule anywhere. */
.f4l-html-source textarea {
    font-family: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    tab-size: 2;
}

/* Waiver terms (/waiver/{id}). Admin-authored HTML of unknown length, so cap it and scroll
   internally rather than pushing the checkbox and Submit button below the fold. */
.f4l-waiver-terms {
    max-height: 420px;
    overflow-y: auto;
}

/* Sandboxed email preview. Fixed height with internal scrolling: a sandboxed iframe cannot
   measure and report its own content height, because that would need the scripting the sandbox
   deliberately forbids. */
.f4l-email-preview {
    width: 100%;
    height: 620px;
    border: 1px solid #e2e6ea;
    border-radius: 4px;
    background: #ffffff;
    display: block;
}

/* ---------------------------------------------------------------------------
   Tier quiz (/quiz). Reuses the .card / .pill / .price / --blue vocabulary the
   booking flow already defines above, so a recommended package renders through
   the same PackageCard component the Package step uses.
   --------------------------------------------------------------------------- */

/* Progress bar. The fill is an <i> so the width can be set inline from the
   component without a per-percentage CSS class. */
.f4l-booking .quiz-progress {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.f4l-booking .quiz-progress .bar {
    flex: 1;
    height: 8px;
    background: var(--line);
    border-radius: 999px;
    overflow: hidden;
}

.f4l-booking .quiz-progress .bar i {
    display: block;
    height: 100%;
    background: var(--blue);
    border-radius: 999px;
    transition: width .35s ease;
}

.f4l-booking .quiz-progress .count {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Question card. */
.f4l-booking .quiz-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px;
    /* Explicit: the card must read left-aligned regardless of any centering inherited from the
       page chrome or the BYU-I header/footer stylesheets. */
    text-align: left;
}

.f4l-booking .quiz-card .qnum {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: 8px;
}

.f4l-booking .quiz-card h3 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    line-height: 1.2;
    color: var(--navy);
}

.f4l-booking .quiz-card p.hint {
    margin: 0 0 24px;
    color: var(--muted);
    line-height: 1.5;
}

/* Answer buttons: full-width rows, styled like the cards rather than MudBlazor. */
.f4l-booking .quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.f4l-booking .quiz-option {
    display: flex;
    align-items: flex-start;
    /* flex-start, and text-align:left below, override the centering a <button> gets by default. */
    justify-content: flex-start;
    gap: 14px;
    width: 100%;
    text-align: left;
    font: inherit;
    color: var(--navy);
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, transform .12s ease;
}

.f4l-booking .quiz-option:hover {
    border-color: var(--blue);
    background: var(--blue-soft);
    transform: translateY(-1px);
}

.f4l-booking .quiz-option.selected {
    border: 2px solid var(--blue);
    background: var(--blue-soft);
}

/* Radio affordance, filled on hover and when this answer is the stored one. */
.f4l-booking .quiz-option .ring {
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    border: 2px solid #c6d0db;
    border-radius: 50%;
    position: relative;
    transition: border-color .15s ease;
}

.f4l-booking .quiz-option .ring::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--blue);
    transform: scale(0);
    transition: transform .15s ease;
}

.f4l-booking .quiz-option:hover .ring,
.f4l-booking .quiz-option.selected .ring {
    border-color: var(--blue);
}

.f4l-booking .quiz-option.selected .ring::after,
.f4l-booking .quiz-option:hover .ring::after {
    transform: scale(1);
}

/* Takes the remaining width so the label starts hard against the radio rather than shrinking to
   fit and floating. min-width:0 lets long answers wrap instead of stretching the row. */
.f4l-booking .quiz-option .opt-body {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

.f4l-booking .quiz-option .opt-title {
    display: block;
    text-align: left;
    font-weight: 600;
    line-height: 1.35;
}

.f4l-booking .quiz-option .opt-sub {
    display: block;
    text-align: left;
    margin-top: 2px;
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.45;
}

/* Results. */
.f4l-booking .quiz-result-label {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: 10px;
}

.f4l-booking .quiz-result-label.muted {
    color: var(--muted);
}

/* One card per result, so it reads as a recommendation rather than a chooser grid. */
.f4l-booking .quiz-result-card {
    max-width: 460px;
}

.f4l-booking .quiz-reasons {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.f4l-booking .quiz-reasons li {
    position: relative;
    padding-left: 28px;
    line-height: 1.5;
}

.f4l-booking .quiz-reasons li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    display: grid;
    place-items: center;
}

@media (max-width: 600px) {
    .f4l-booking .quiz-card {
        padding: 22px;
    }

    .f4l-booking .quiz-card h3 {
        font-size: 1.25rem;
    }
}
