/* ===========================================================================
   hski reservation form
   ---------------------------------------------------------------------------
   Written for this form, not inherited from the WordPress plugin it replaces.
   The plugin's stylesheet is gone; what survives it are the visual values below,
   read off main.css so the page still looks like the one clients know:

     #1a4f81  the form title            #e54100  primary action, active step
     #fb5022  section headings          #f84100  primary action, hover
     #fa501f  help icon                 #0cd227  add-a-person
     #646464  labels, field text        #b7b7b7  inactive step, rules
     #949494  select borders            #e80000  errors
     Lato, 11px base, 34px buttons in uppercase, 720px page, 45px step bubbles.

   Mobile first: the single-column stack is the base, and the two-column layout
   with right-aligned labels arrives at 640px. Layout is flex and grid - the
   original floated everything, which is why its mobile view had to be undone
   rule by rule instead of simply not applying yet.
   =========================================================================== */

:root {
    --brand: #e54100;
    --brand-hover: #f84100;
    --accent: #fb5022;
    --help: #fa501f;
    --title: #1a4f81;
    --text: #646464;
    --muted: #b7b7b7;
    --muted-strong: #b0b0b0;
    --field-border: #949494;
    --error: #e80000;
    --error-bg: #fbdddd;
    --add: #0cd227;
    --ink: #333;
    --rule: #ddd;

    --font: 'Lato', 'Trebuchet MS', Verdana, sans-serif;
    --fs-base: 11px;
    --fs-section: 14px;
    --fs-title: 20px;
    --fs-button: 12px;

    --gap: 12px;
    --label-col: 38%;
    --control-col: 31%;
    --control-max: 265px;
    --page: 720px;
    --radius: 3px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background: #fff;
    color: var(--ink);
    font-family: var(--font);
    font-size: var(--fs-base);
    line-height: 1.5;
}

[hidden], .is-hidden { display: none !important; }

/* --------------------------------------------------------------- the page */

.rf {
    position: relative;
    max-width: var(--page);
    margin: 0 auto 24px;
    padding: 16px;
}

.rf__title {
    margin: 4px 0 24px;
    color: var(--title);
    font-size: var(--fs-title);
    font-weight: 300;
}

.rf__title-sub { text-transform: uppercase; font-weight: 400; }

.rf__lang {
    position: absolute;
    top: 12px;
    right: 12px;
    min-width: 36px;
    padding: 5px 10px;
    border: 1px solid var(--muted);
    border-radius: var(--radius);
    background: #fff;
    color: #707070;
    font: 600 var(--fs-base)/1 var(--font);
    cursor: pointer;
}
.rf__lang:hover { border-color: var(--brand); color: var(--brand); }

/* ------------------------------------------------------------- step meter */

.rf-steps { margin: 0 0 20px; }

/* Bubbles and captions share one four-column grid: a caption sits under the
   bubble it names, at every width. The connector is drawn between two centres
   as a pseudo-element, so it never has to be measured against the bubbles. */
.rf-steps__track,
.rf-steps__captions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.rf-steps__cell {
    position: relative;
    display: grid;
    place-items: center;
}
.rf-steps__cell[data-line]::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 50%;
    left: -50%;
    z-index: 0;
    height: 7px;
    margin: -3px 26px 0;
    border-radius: 3px;
    background: var(--muted);
}
.rf-steps__cell[data-line].is-done::before { background: var(--brand); }

.rf-steps__bubble {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 3px solid var(--muted);
    border-radius: 50%;
    background: #fff;
    color: var(--muted);
    font-size: var(--fs-base);
    font-weight: 600;
}
.rf-steps__bubble.is-done {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.rf-steps__captions {
    gap: 4px;
    margin-top: 8px;
    color: #707070;
    font-size: 9px;
    letter-spacing: -0.1px;
    text-align: center;
}

.rf__lede { margin: 0 0 20px; color: var(--ink); }

/* ----------------------------------------------------------------- blocks */

.rf-section { margin: 0 0 22px; }

.rf-section__title {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 12px;
    color: var(--accent);
    font-size: var(--fs-section);
    font-weight: 700;
}

/* ----------------------------------------------------------------- fields */

.rf-field { margin: 0 0 10px; }

.rf-field__label {
    display: block;
    margin: 0 0 4px;
    color: var(--text);
}

.rf-field__control {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

input[type="text"],
input[type="tel"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid var(--text);
    border-radius: 0;
    background: #fff;
    color: var(--text);
    font-family: inherit;
    font-size: var(--fs-base);
}
select { border-color: var(--field-border); }
textarea { min-height: 90px; resize: vertical; }

input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

/* A control that is narrower than the row it sits in. */
.rf-field__control > .is-narrow { width: auto; flex: 0 0 auto; }

.rf-phone__prefix { width: 56px; flex: 0 0 auto; text-align: center; }
.rf-phone__number { flex: 1 1 auto; min-width: 0; }

/* radios and checkboxes ---------------------------------------------------- */

.rf-choice {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
    color: var(--text);
}
.rf-choice input { width: auto; flex: 0 0 auto; margin: 0; }
.rf-choice label { cursor: pointer; }

.rf-choice-group {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0 0 10px;
}
.rf-choice-group > span { display: flex; align-items: center; gap: 6px; color: var(--text); }
.rf-choice-group input { width: auto; margin: 0; }

/* A radio pair that sits in a field's control column - course variant, lunch. */
.rf-radios { gap: 18px; }
.rf-radios > span { display: flex; align-items: center; gap: 6px; color: var(--text); }
.rf-radios input { width: auto; flex: 0 0 auto; margin: 0; }
.rf-radios label { cursor: pointer; }

/* Used both as a span inside consent copy and as a real button next to the
   level select, so the button chrome is reset rather than assumed away. */
.rf-link {
    padding: 0;
    border: none;
    background: none;
    color: var(--brand);
    font: inherit;
    text-align: left;
    text-decoration: underline;
    cursor: pointer;
}

/* ------------------------------------------------------------------ errors
   The tint covers the whole row, label included; the message is a sibling of
   the row rather than part of it, so it reads on white underneath - which is
   how the original marks a field. On a consent line there is room beside the
   text, so the message stays inline and inside the tint. */

.rf-field.has-error,
.rf-choice.has-error,
.rf-choice-group.has-error { background: var(--error-bg); }

.rf-field__error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 3px 0 8px;
    color: var(--error);
}
.rf-field__error::before {
    content: "";
    width: 0; height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 7px solid var(--error);
}
.rf-choice .rf-field__error { margin: 0 0 0 10px; }

input.has-error, select.has-error, textarea.has-error { border-color: var(--error); }

.rf__notice {
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid #f5c6cb;
    background: var(--error-bg);
    color: #8a1f1f;
}

/* -------------------------------------------------------------------- help */

.rf-help { position: relative; display: inline-flex; }

.rf-help__icon {
    display: grid;
    place-items: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--help);
    color: #fff;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    cursor: help;
}

.rf-help__text {
    position: absolute;
    top: -4px;
    left: 22px;
    z-index: 30;
    display: none;
    width: min(240px, 70vw);
    padding: 10px;
    border: 1px solid var(--accent);
    border-radius: 5px;
    background: #fff;
    color: var(--text);
    font-weight: 400;
    line-height: 1.45;
}
.rf-help:hover .rf-help__text,
.rf-help:focus-within .rf-help__text { display: block; }

/* On a narrow screen the bubble opens inward so it cannot leave the page. */
@media (max-width: 520px) {
    .rf-help__text { left: auto; right: 0; top: 20px; }
}

/* ------------------------------------------------------------ participants */

.rf-participant { padding: 0 0 4px; }
.rf-participant + .rf-participant {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--rule);
}

.rf-participant__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
}
.rf-participant__head .rf-section__title { margin: 0; flex: 1 1 auto; }

.rf-remove {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border: none;
    background: none;
    color: var(--brand);
    font: inherit;
    cursor: pointer;
}
.rf-remove__x { display: grid; place-items: center; width: 16px; height: 16px; font-size: 17px; line-height: 1; }

.rf-add {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 0;
    padding: 0;
    border: none;
    background: none;
    color: var(--text);
    font: inherit;
    cursor: pointer;
}
.rf-add__icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 2px solid var(--add);
    border-radius: 50%;
    color: var(--add);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}
.rf-add:hover .rf-add__icon { background: var(--add); color: #fff; }

/* date of birth ------------------------------------------------------------ */

.rf-dob { display: flex; align-items: center; gap: 4px; }
.rf-dob input { width: 44px; flex: 0 0 auto; text-align: center; }
.rf-dob input.rf-dob__year { width: 62px; }
.rf-dob__sep { color: var(--text); }

.rf-calendar {
    flex: 0 0 auto;
    padding: 3px 7px;
    border: 1px solid var(--text);
    background: #fff;
    font-size: 13px;
    line-height: 1.2;
    cursor: pointer;
}

/* ------------------------------------------------------------- price grid */

.rf-grid { overflow-x: auto; margin: 0 0 12px; }
.rf-grid table { width: 100%; border-collapse: collapse; }
.rf-grid th, .rf-grid td {
    padding: 8px 6px;
    border: 1px solid var(--rule);
    text-align: center;
}
.rf-grid th { color: var(--text); font-weight: 600; }
.rf-grid th .rf-help { margin-left: 4px; vertical-align: middle; }
.rf-grid td.is-pick { cursor: pointer; }
.rf-grid td.is-pick:hover { background: #f6efeb; }
.rf-grid td.is-suggested { background: #e8f6e8; }
.rf-grid td.is-chosen { background: var(--brand); color: #fff; font-weight: 700; }

/* sessions ---------------------------------------------------------------- */

.rf-sessions { margin: 0 0 12px; }
.rf-session {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0 0 6px;
}
.rf-session input { width: 116px; flex: 0 0 auto; }
.rf-session select { width: auto; flex: 0 0 auto; }

.rf-btn-quiet {
    padding: 5px 10px;
    border: 1px solid var(--muted);
    background: #f7f7f7;
    color: var(--ink);
    font: inherit;
    cursor: pointer;
}

/* ------------------------------------------------------------------ summary */

.rf-summary + .rf-summary { margin-top: 16px; }
.rf-summary__rule {
    margin: 0 0 14px;
    padding: 7px 0;
    border-top: 1px solid #909090;
    border-bottom: 1px solid #909090;
    font-size: 15px;
}
.rf-summary__row { display: flex; gap: 8px; padding: 3px 0; }
.rf-summary__key { flex: 0 0 var(--label-col); font-weight: 700; color: var(--ink); }
.rf-summary__value { color: var(--text); }

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

.rf-btn {
    padding: 0 16px;
    border: none;
    background: var(--brand);
    color: #fff;
    font: 500 var(--fs-button)/34px var(--font);
    text-transform: uppercase;
    cursor: pointer;
}
.rf-btn:hover { background: var(--brand-hover); }
.rf-btn[disabled] { opacity: .6; cursor: progress; }

.rf-btn--ghost {
    border: 2px solid var(--muted-strong);
    background: #fff;
    color: var(--muted-strong);
    line-height: 30px;
}
.rf-btn--ghost:hover { background: #fff; border-color: var(--brand); color: var(--brand); }

.rf-nav {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
}
.rf-nav__spacer { flex: 1 1 auto; }

.rf-hint { color: #909090; font-size: 10px; }
.rf-field--tall .rf-field__label { padding-top: 2px; }

.rf-done { padding: 48px 16px; text-align: center; }
.rf-done h2 { margin: 0 0 10px; color: var(--brand); font-size: var(--fs-section); }
.rf-done p { margin: 0 0 20px; color: var(--text); }

/* ------------------------------------------------------------------- popups */

.rf-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(0, 0, 0, .45);
}

.rf-popup {
    position: fixed;
    z-index: 1100;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    width: min(640px, 94vw);
    max-height: 88vh;
    padding: 20px;
    border: 1px solid #ccc;
    background: #fff;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .3);
}
.rf-popup--wide { width: min(880px, 96vw); height: 88vh; }
.rf-popup--video { width: min(880px, 96vw); padding: 36px 12px 12px; }

.rf-popup__title { margin: 0 0 14px; font-size: 19px; font-weight: 700; color: #000; }

.rf-popup__close {
    position: absolute;
    top: 6px;
    right: 10px;
    padding: 6px 10px;
    border: none;
    background: none;
    color: #444;
    font: 700 15px var(--font);
    cursor: pointer;
}

/* One scrollbar: a body holding an iframe does not scroll, the iframe does. */
.rf-popup__body { overflow: auto; flex: 1 1 auto; min-height: 0; }
.rf-popup__body--frame { overflow: hidden; }
.rf-popup__body--frame iframe { display: block; width: 100%; height: 100%; border: none; }

.rf-video { position: relative; padding-top: 56.25%; overflow: hidden; }
.rf-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }

/* levels ------------------------------------------------------------------- */

.rf-levels { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; }
.rf-levels td { border: 1px solid #bbb; padding: 0; }
.rf-levels td:first-child { width: 52px; text-align: center; }
.rf-levels td:last-child { background: var(--level, #fdfdfd); }
.rf-levels tr[data-level="1"] { --level: #eaeaea; }
.rf-levels tr[data-level="2"] { --level: #fdfdfd; }
.rf-levels tr[data-level="3"] { --level: #70bd41; }
.rf-levels tr[data-level="4"] { --level: #51a6f7; }
.rf-levels tr[data-level="5"] { --level: #c72406; }
.rf-levels tr[data-level="6"] { --level: #000202; }
.rf-levels tr[data-level="7"] { --level: #914609; }
.rf-levels tr[data-level="8"] { --level: #a27512; }
/* Black, red and brown need light text to stay readable. */
.rf-levels tr[data-level="5"] td:last-child button,
.rf-levels tr[data-level="6"] td:last-child button,
.rf-levels tr[data-level="7"] td:last-child button { color: #fff; }
.rf-levels tr[data-level="5"] td:last-child button:hover,
.rf-levels tr[data-level="6"] td:last-child button:hover,
.rf-levels tr[data-level="7"] td:last-child button:hover { color: #ffd9cc; }
.rf-levels button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border: none;
    background: none;
    color: #000;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.rf-levels button:hover { color: var(--brand); }
.rf-levels__play {
    width: 0; height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 13px solid var(--brand);
}

/* --------------------------------------------------------------- datepicker */

.rf-dp {
    position: absolute;
    z-index: 1200;
    width: 236px;
    padding: 8px;
    border: 1px solid var(--muted);
    background: #fff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .2);
    font-size: 12px;
}
.rf-dp__head { display: flex; gap: 4px; margin-bottom: 6px; }
.rf-dp__head select { font-size: 12px; }
.rf-dp table { width: 100%; border-collapse: collapse; }
.rf-dp th { padding: 2px 0; color: #909090; font-size: 10px; font-weight: 600; }
.rf-dp td { padding: 0; }
.rf-dp__day {
    width: 100%;
    padding: 5px 0;
    border: none;
    background: none;
    color: #444;
    font: inherit;
    cursor: pointer;
}
.rf-dp__day:hover:not(:disabled) { background: #f6efeb; }
.rf-dp__day:disabled { color: #ccc; cursor: default; }

/* ===========================================================================
   From 640px up: the desktop the plugin was drawn for - framed page, generous
   padding, and the label/control pair side by side.
   =========================================================================== */

@media (min-width: 640px) {
    .rf {
        margin-top: 24px;
        padding: 40px;
        border: 1px solid #000;
    }

    .rf__title { font-size: 22px; margin-bottom: 32px; }
    .rf-steps { width: 92%; margin: 0 auto 24px; }
    .rf-steps__bubble { width: 45px; height: 45px; font-size: 12px; }
    .rf-steps__captions { font-size: 11px; letter-spacing: 0; margin-top: 10px; }

    .rf-field {
        display: grid;
        grid-template-columns: var(--label-col) 1fr;
        align-items: start;
        column-gap: 10px;
        margin-bottom: 8px;
    }
    .rf-field__label {
        margin: 0;
        padding-top: 4px;
        text-align: right;
    }
    .rf-field__control > input,
    .rf-field__control > select,
    .rf-field__control > .rf-control { width: 100%; max-width: var(--control-max); }
    .rf-field__control > textarea { width: 100%; max-width: 330px; }
    .rf-field__error { grid-column: 2; }

    /* Rows whose control is a whole block of its own get the full width. */
    .rf-field--wide { grid-template-columns: 1fr; }
    .rf-field--wide .rf-field__label { text-align: left; padding-top: 0; margin-bottom: 6px; }

    .rf-choice { padding-left: calc(var(--label-col) + 10px); }
    .rf-choice-group { padding-left: calc(var(--label-col) + 10px); }

    .rf-phone__number { flex: 0 0 auto; width: calc(var(--control-col) - 62px); }

    .rf-summary__row { padding: 4px 0; }
}
