:root, [data-bs-theme="light"] {
    --eana-blue: #003087;
    --eana-blue-hover: #00227a;
    --eana-blue-soft: rgba(0, 48, 135, 0.08);
    --eana-blue-glow: rgba(0, 48, 135, 0.25);
    --error-red: #c41e1e;
    --error-tint: rgba(196, 30, 30, 0.08);
    --grid-line: #b8bcc4;
    --grid-line-soft: #e3e6ec;
    --label-grey: #5a6270;
    --label-grey-soft: #8a93a3;
}

[data-bs-theme="dark"] {
    --error-red: #ff4d4d;
    --error-tint: rgba(255, 77, 77, 0.15);
    --grid-line: #334155;
    --grid-line-soft: #1e293b;
    --label-grey: #cbd5e1;
    --label-grey-soft: #94a3b8;
}

.text-eana-blue {
    color: var(--eana-blue);
}

.bg-eana-blue {
    background-color: var(--eana-blue);
}

.top-message {
    width: 794px;
    margin: 24px auto 0;
}

/* ── Sheet container — A4 portrait at 96dpi ───────────────── */
.fpl-form {
    width: 794px;
    max-width: 100%;
    margin: 24px auto;
    background: #fff;
    border: 1px solid var(--grid-line);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #000;
}

/* ── Header strip ─────────────────────────────────────────── */
.fpl-header {
    display: grid;
    grid-template-columns: 120px 1fr 180px;
    border-bottom: 1px solid var(--grid-line);
}
.fpl-header__left {
    background: var(--eana-blue);
    color: #fff;
    padding: 10px 12px;
    font-weight: bold;
    font-size: 12px;
    line-height: 1.25;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.fpl-header__left small {
    font-weight: normal;
    font-size: 10px;
    opacity: 0.85;
}
.fpl-header__title {
    text-align: center;
    padding: 8px;
    border-left: 1px solid var(--grid-line);
    border-right: 1px solid var(--grid-line);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.fpl-header__title h1 {
    margin: 0;
    font-size: 20px;
    letter-spacing: 0.08em;
/*    color: #111;*/
}
.fpl-header__title h2 {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--label-grey);
    font-weight: normal;
    font-style: italic;
}
.fpl-header__date {
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ── Generic row + cell ───────────────────────────────────── */
.fpl-row {
    display: grid;
    border-top: 1px solid var(--grid-line);
}
.fpl-cell {
    padding: 4px 8px 6px;
    border-left: 1px solid var(--grid-line);
    min-height: 48px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
.fpl-cell:first-child {
    border-left: none;
}
.fpl-cell--span {
    grid-column: 1 / -1;
    border-left: none;
}
.fpl-col--cells .fpl-cell {
    border: none;
    padding-bottom: 12px;
}
.fpl-col--cells {
    border-left: 1px solid var(--grid-line);
}

/* ── Row-specific column templates ─────────────────────────
   Widths approximate the printed CORPAC form column geometry.
   Changing one cascades to neighbours in the same row. */
.fpl-row--field378    { grid-template-columns: 110px 1fr 110px 130px; }
.fpl-row--field910    { grid-template-columns: 70px 1fr 90px 1.4fr 90px; }
.fpl-row--field13     { grid-template-columns: 1fr 140px; }
.fpl-row--field15     { grid-template-columns: 130px 110px 1fr; }
.fpl-row--field16     { grid-template-columns: 1.3fr 110px 1fr 1fr; }
.fpl-row--field18     { grid-template-columns: 1fr; }
.fpl-row--field19     { grid-template-columns: 1fr 1fr 1.5fr; }
.fpl-row--equip       { grid-template-columns: 1fr 1fr; }
.fpl-row--dinghies    { grid-template-columns: 100px 100px 130px 1fr; }
.fpl-row--appearance  { grid-template-columns: 1fr 1.3fr; }
.fpl-row--pilot       { grid-template-columns: 2.2fr 1fr 3.2fr; }
.fpl-row--signature   { grid-template-columns: 1fr; }

/* ── Banner between Field 18 and supplementary section ────── */
.fpl-banner {
    border-top: 1px solid var(--grid-line);
    background: var(--eana-blue);
    color: #fff;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.06em;
}
.fpl-banner em {
    font-style: italic;
    font-weight: normal;
    opacity: 0.85;
    margin-left: 6px;
    text-transform: none;
}

/* ── Labels (small grey, like a printed form) ─────────────── */
/* Block layout so title + <em> always stack on exactly 2 lines.
   Reserved min-height keeps every label the same vertical box,
   so inputs across a row align regardless of label text length
   or required-asterisk presence. */
.fpl-label {
    position: relative;
    font-size: 9px;
    line-height: 1.3;
    color: var(--label-grey);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
    display: block;
    min-height: 26px;
    padding-right: 14px;
    width:fit-content;
}
.fpl-label em, .em-style {
    font-style: italic;
    color: var(--label-grey-soft);
    font-size: 8px;
    font-weight: normal;
    text-transform: none;
    display: block;
    margin-top: 1px;
}
/* Asterisk pulled out of normal flow — sits at top-right of the
   label box so it never adds a third line and never bumps the
   input below. */
.fpl-label--required::after {
    content: "*";
    position: absolute;
    top: 0;
    right: 2px;
    color: var(--error-red);
    font-weight: bold;
    font-size: 12px;
    line-height: 1;
}

/* ── Inline character counter (Route, etc.) ────────────────── */
.fpl-counter {
    float: right;
    margin-left: 6px;
    font-size: 9px;
    color: var(--label-grey-soft);
    font-style: normal;
    font-weight: normal;
}
.fpl-counter.warning { color: #b78103; }
.fpl-counter.danger  { color: var(--error-red); }

/* ── Inputs (borderless, bold, paper-like) ────────────────── */
.fpl-input {
    border: none;
    background: transparent;
    width: 100%;
    font-family: inherit;
    font-weight: bold;
    font-size: 13px;
    padding: 4px 2px;
    letter-spacing: 0.04em;
/*    color: #000;*/
    box-sizing: border-box;
}
.fpl-input::placeholder {
    color: #b9bdc6;
    font-weight: normal;
    font-style: italic;
}
.fpl-input:focus, .auth-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--eana-blue-glow);
    background: var(--eana-blue-soft);
    border-radius: 2px;
}
.fpl-input--select {
    appearance: auto;
}
.fpl-input--date,
.fpl-input--time {
    font-weight: bold;
}
.fpl-textarea {
    resize: vertical;
    min-height: 38px;
    font-weight: normal;
    line-height: 1.4;
}
.fpl-static {
    font-weight: bold;
    font-size: 12px;
    padding: 4px 0;
    color: #333;
}
.fpl-cell--static {
    background: #fafbfd;
}

/* ── Checkbox groups (emergency, survival, life jackets) ──── */
.fpl-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    align-items: center;
    padding-top: 2px;
}

/* ── Letter-coded checkbox (CORPAC-style boxed letter) ─────
   Pattern: visually-hidden native <input> + adjacent <label> sibling
   styled as the bordered square. Clicking the label toggles the input
   via for=; CSS sibling selector (input:checked + label) draws the X.
   Native input stays focusable for keyboard a11y. */
.fpl-letter-check {
    display: inline-block;
    position: relative;
    line-height: 0;
}
.fpl-letter-check__input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}
.fpl-letter-check__box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1.5px solid #000;
    background: #fff;
    color: #000;
    font-family: inherit;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background 100ms;
}
.fpl-letter-check__box:hover {
    background: var(--eana-blue-soft);
}
.fpl-letter-check__input:checked + .fpl-letter-check__box::after {
    content: "✕";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--eana-blue);
    font-size: 26px;
    font-weight: bold;
    line-height: 1;
    pointer-events: none;
}
.fpl-letter-check__input:focus-visible + .fpl-letter-check__box {
    outline: 2px solid var(--eana-blue);
    outline-offset: 2px;
}

/* ── Validation messages — larger, red-tinted ─────────────── */
.fpl-error {
    display: block;
    color: var(--error-red);
    font-size: 11px;
    line-height: 1.3;
    margin-top: 3px;
    font-weight: 600;
    min-height: 0;
}
.fpl-error:empty { display: none; }

input.input-validation-error,
select.input-validation-error,
textarea.input-validation-error {
    background: var(--error-tint);
    box-shadow: inset 0 -2px 0 var(--error-red);
    border-radius: 2px;
}

/* ── Signature pad ────────────────────────────────────────── */
.fpl-signature {
    position: relative;
    border: 1.5px dashed var(--grid-line);
    background: #fff;
    border-radius: 4px;
    max-width: 248px;
    max-height: none;
    aspect-ratio: 3/1;
    margin: 8px 0 6px;
    overflow: hidden;
}
.fpl-signature__canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
    touch-action: none;
}
.fpl-signature__hint {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--label-grey-soft);
    /*    font-size: 13px;*/
    /*    font-style: italic;*/
    pointer-events: none;
    text-align: center;
}

/* ── Buttons ──────────────────────────────────────────────── */
.fpl-btn {
    display: inline-block;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 120ms, box-shadow 120ms;
}
.fpl-btn--ghost {
    background: #fff;
    color: var(--label-grey);
    border-color: var(--grid-line);
}
.fpl-btn--ghost:hover {
    background: #f5f6f8;
}
.fpl-btn--primary {
    background: var(--eana-blue);
    color: #fff;
    font-size: 14px;
    letter-spacing: 0.04em;
    padding: 12px 28px;
}
.fpl-btn--primary:hover {
    background: var(--eana-blue-hover);
    box-shadow: 0 4px 12px var(--eana-blue-glow);
}

/* ── Submit / footer strip ────────────────────────────────── */
.fpl-actions {
    border-top: 1px solid var(--grid-line);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #fafbfd;
}
.fpl-actions__note {
    margin: 0;
    color: var(--label-grey);
    font-size: 11px;
    font-style: italic;
}

.fpl-actions__note button {
    font-size: 11px;
    font-style: italic;
}

/* ── Field 18 helper trigger + modal ──────────────────────────
   The "?" button floats in the top-right of the Field 18 cell so it
   sits next to the label without disturbing the existing flex stack
   inside .fpl-cell--span. The dialog uses native <dialog> for free
   ESC-handling, focus-trap and ::backdrop styling. */
.fpl-row--field18 .fpl-cell--span { position: relative; }

.fpl-helper-trigger {
    position: absolute;
    top: 6px;
    right: 32px;
    appearance: none;
    border: 1px solid var(--eana-blue);
    background: #fff;
    color: var(--eana-blue);
    font: inherit;
    font-size: 11px;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: background 100ms, color 100ms;
    z-index: 1;
}
.fpl-helper-trigger:hover {
    background: var(--eana-blue);
    color: #fff;
}
.fpl-helper-trigger:focus-visible {
    outline: 2px solid var(--eana-blue-glow);
    outline-offset: 2px;
}

dialog.fpl-helper {
    width: 720px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 64px);
    padding: 0;
    border: 1px solid var(--grid-line);
    border-radius: 6px;
    background: #fff;
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    overflow: hidden;
}
dialog.fpl-helper::backdrop {
    background: rgba(0, 0, 0, 0.45);
}
.fpl-helper__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--eana-blue);
    color: #fff;
    padding: 10px 14px;
    gap: 12px;
}
.fpl-helper__title {
    margin: 0;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.fpl-helper__title em {
    font-style: italic;
    font-weight: normal;
    opacity: 0.85;
    margin-left: 8px;
    text-transform: none;
    letter-spacing: 0;
    font-size: 11px;
}
.fpl-helper__close {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.5);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
}
.fpl-helper__close:hover { background: rgba(255,255,255,0.15); }
.fpl-helper__tabs {
    display: flex;
    border-bottom: 1px solid var(--grid-line);
    background: #fafbfd;
    padding: 0 8px;
}
.fpl-helper__tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 16px;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    color: var(--label-grey);
    cursor: pointer;
    letter-spacing: 0.04em;
}
.fpl-helper__tab:hover { color: var(--eana-blue); }
.fpl-helper__tab[aria-selected="true"] {
    color: var(--eana-blue);
    border-bottom-color: var(--eana-blue);
    background: #fff;
}
.fpl-helper__search-wrap {
    padding: 10px 14px;
    border-bottom: 1px solid var(--grid-line-soft);
}
.fpl-helper__search {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--grid-line);
    border-radius: 4px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 13px;
}
.fpl-helper__search:focus {
    outline: none;
    border-color: var(--eana-blue);
    box-shadow: 0 0 0 2px var(--eana-blue-glow);
}
.fpl-helper__panels {
    overflow-y: auto;
    max-height: calc(100vh - 280px);
    padding: 12px 14px 16px;
}
.fpl-helper__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 8px;
}
.fpl-helper__card {
    border: 1px solid var(--grid-line);
    border-radius: 4px;
    padding: 8px 10px;
    background: #fff;
    cursor: pointer;
    transition: background 100ms, border-color 100ms;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.fpl-helper__card:hover {
    background: var(--eana-blue-soft);
    border-color: var(--eana-blue);
}
.fpl-helper__card:focus-visible {
    outline: 2px solid var(--eana-blue);
    outline-offset: 1px;
}
.fpl-helper__card.is-added {
    background: #f0f4fa;
    border-color: var(--eana-blue);
}
.fpl-helper__card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}
.fpl-helper__code {
    font-weight: bold;
    color: var(--eana-blue);
    font-size: 13px;
    letter-spacing: 0.04em;
}
.fpl-helper__badge {
    background: var(--eana-blue);
    color: #fff;
    font-size: 9px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.fpl-helper__desc {
    margin: 0;
    color: #222;
    font-size: 11px;
    line-height: 1.35;
}
.fpl-helper__eet {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    cursor: default;
}
.fpl-helper__time {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--grid-line);
    border-radius: 3px;
    padding: 4px 6px;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.06em;
}
.fpl-helper__time.is-invalid {
    border-color: var(--error-red);
    background: var(--error-tint);
}
.fpl-helper__time:focus {
    outline: none;
    border-color: var(--eana-blue);
    box-shadow: 0 0 0 2px var(--eana-blue-glow);
}
.fpl-helper__add-btn {
    border: 1px solid var(--eana-blue);
    background: var(--eana-blue);
    color: #fff;
    padding: 4px 10px;
    border-radius: 3px;
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
}
.fpl-helper__add-btn:hover { background: var(--eana-blue-hover); }
.fpl-helper__empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--label-grey);
    font-style: italic;
    padding: 20px;
    margin: 0;
}

.fpl-helper__currentValueWrapper {
    padding: 10px 12px;
    display: flex;
    flex-direction: row;
    gap: 5px;
    border-bottom: 1px solid var(--grid-line);
    margin-bottom: 1px;
    align-items: start;
}

.fpl-helper__currentValue {
    background: var(--eana-blue-soft);
    border: 1px solid var(--eana-blue-glow);
    border-radius: 3px;
    padding: 10px;
    field-sizing: content; /* auto adjust height based on content */
}

.fpl-helper__rem-btn {
    border: 1px solid var(--error-red);
    background: var(--error-red);
    color: #fff;
    padding: 4px 10px;
    border-radius: 3px;
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
}

.no-scroll {
    overflow: hidden;
}


/* Autocomplete scrollable dropdown list */
.ui-autocomplete {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden; /* Prevents horizontal scrolling */
}

/* Disable cursor hover effect for "No results" feedback */
.ui-menu-item.no-results {
    pointer-events: none;
    cursor: default;
    color: var(--label-grey) !important;
}

    .ui-menu-item.no-results .ui-state-active,
    .ui-menu-item.no-results .ui-state-active:hover {
        background: transparent !important;
        border: 1px solid transparent !important;
        color: var(--label-grey) !important; /* Keep it grayed out */
        font-weight: normal !important;
        margin: 0 !important;
    }

/* Custom ICAO suggestions dropdown style */
.ui-menu-item {
    background-color: var(--eana-blue-soft) !important;
}

.ui-autocomplete .ui-menu-item .ui-state-active {
    background-color: var(--eana-blue-glow) !important;
    border: 1px solid var(--eana-blue-glow) !important;
    color: var(--eana-blue);
}

.form-check-input:checked {
    background-color: var(--eana-blue);
    border-color: var(--eana-blue-glow);
}

/* Optional: Change the glow/outline color when focused or clicked */
.form-check-input:focus {
    border-color: var(--eana-blue-glow);
    box-shadow: 0 0 0 0.1rem var(--eana-blue-glow);
}

.btn-primary {
    border-color: transparent;
    background: var(--eana-blue);
}
.btn-primary:hover {
    background: var(--eana-blue-hover);
    border-color: var(--eana-blue-hover);
    box-shadow: 0 4px 12px var(--eana-blue-glow);
}

.btn-outline-primary {
    background-color: transparent;
    border-color: var(--eana-blue);
    color: var(--eana-blue);
}

.btn-outline-primary:hover {
    background-color: var(--eana-blue);
    border-color: var(--eana-blue);
    color: #ffffff;
}

.z-100 {
    z-index: 100;
}

.circle-btn {
    color: whitesmoke;
    width: 45px;
    aspect-ratio: 1/1;
    background-color: var(--eana-blue);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
}

.circle-btn:hover, .circle-btn.show {
    color: white;
    background-color: var(--eana-blue-hover);
}

.dropdown-item:hover {
    background-color: var(--eana-blue-soft);
}

.dropdown-item:active {
    background-color: var(--eana-blue);
    font-weight: 700;
}

/* override <a> tag default text style to maintain btn style consistency */
a.fpl-btn {
    text-decoration: none;
}

a.fpl-btn:hover {
    color: white;
}

/* ──────────────────────────────────────────────────────────────
   Dashboard (saved templates list)
   ────────────────────────────────────────────────────────────── */
.fpl-dashboard {
    max-width: 960px;
    margin: 24px auto;
    padding: 0 16px;
    font-family: Arial, sans-serif;
    color: #333;
}

.fpl-dashboard__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.fpl-dashboard__title {
    color: var(--eana-blue);
    margin: 0;
    font-size: 22px;
    letter-spacing: 0.02em;
}

.fpl-dashboard__empty {
    text-align: center;
    padding: 64px 16px;
    background: #fff;
    border: 1px dashed #c9d2e0;
    border-radius: 8px;
    color: #5d6b80;
}

.fpl-dashboard__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.fpl-dashboard__card {
    background: #fff;
    border: 1px solid #d4dae5;
    border-radius: 8px;
    padding: 16px 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.fpl-dashboard__card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.fpl-dashboard__card-title {
    color: var(--eana-blue);
    margin: 0;
    font-size: 17px;
}

.fpl-dashboard__card-meta {
    color: #6b7280;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.fpl-dashboard__meta {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 12px;
    row-gap: 4px;
    margin: 10px 0 14px;
    font-size: 13px;
}

    .fpl-dashboard__meta dt {
        color: #6b7280;
        font-weight: 600;
    }

    .fpl-dashboard__meta dd {
        margin: 0;
        color: #333;
    }

.fpl-dashboard__meta-sep {
    color: #9aa3b2;
    margin: 0 4px;
}

.fpl-dashboard__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.fpl-dashboard__delete-form {
    display: inline;
    margin: 0;
}

/* Danger button variant — destructive actions only (Delete). Mirrors
   .fpl-btn--primary's shape, swaps the palette for red. */
.fpl-btn--danger {
    background: #c0392b;
    color: #fff;
    border: 1px solid #c0392b;
    padding: 8px 14px;
    font-weight: bold;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
}

    .fpl-btn--danger:hover {
        background: #a93223;
        border-color: #a93223;
    }

/* Flash / toast banners (TempData["SuccessMessage"|"ErrorMessage"]). Distinct
   from .fpl-banner, which is a slim section-divider inside the form. */
.fpl-flash {
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 14px;
    border: 1px solid transparent;
}

.fpl-flash--success {
    background: #e6f4ea;
    border-color: #34a853;
    color: #1e4620;
}

.fpl-flash--error {
    background: #fce8e6;
    border-color: #d93025;
    color: #5b1414;
}

/* ──────────────────────────────────────────────────────────────
   Save-as-template block on CreateFlightPlan.cshtml — signed-in only.
   Mirrors .fpl-actions but adds a label + input + ghost-button row.
   ────────────────────────────────────────────────────────────── */
.fpl-actions--save-template {
    background: #f4f7fc;
    border: 1px solid #d4dae5;
    border-radius: 6px;
    padding: 14px 16px;
    margin-top: 12px;
}

.fpl-actions__save-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.fpl-actions__save-label {
    margin: 0;
    white-space: nowrap;
    flex: 1 1 100%; /* expand the label to take up the first row */
}

.fpl-actions__save-input {
    flex: 1 1 220px;
    min-width: 200px;
}

.user-header {
    min-height: 120px !important; /* override adminlte */
}

#pdfLoadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

#pdfLoadingOverlay.d-none {
    display: none !important;
}


/* ── Mobile: abandon A4 metaphor, stack rows ──────────────── */
@media (max-width: 768px) {
    .fpl-form {
        width: 100%;
        margin: 0;
        border: none;
        box-shadow: none;
    }
    .fpl-header {
        grid-template-columns: 1fr;
    }
    .fpl-header__title,
    .fpl-header__date {
        border-left: none;
        border-right: none;
        border-top: 1px solid var(--grid-line);
    }

    /* every multi-column row collapses to one column */
    .fpl-row,
    .fpl-row--field378,
    .fpl-row--field910,
    .fpl-row--field13,
    .fpl-row--field15,
    .fpl-row--field16,
    .fpl-row--field19,
    .fpl-row--equip,
    .fpl-row--dinghies,
    .fpl-row--appearance,
    .fpl-row--pilot {
        grid-template-columns: 1fr;
    }
    .fpl-cell {
        border-left: none;
        border-top: 1px solid var(--grid-line-soft);
        padding: 12px 14px;
        min-height: 56px;          /* ≥ 44px touch target */
    }
    .fpl-cell:first-child {
        border-top: none;
    }
    .fpl-col--cells .fpl-cell {
        border-top: 1px solid var(--grid-line-soft);
    }

    .fpl-col--cells {
        display: grid;
        border-left: none;
    }
    .fpl-input,
    .fpl-input--select {
        font-size: 16px; /* prevent iOS zoom-on-focus */
        padding: 10px 6px;
        min-height: 44px; /* touch target */
    }
    .fpl-letter-check__box {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    .fpl-letter-check__input:checked + .fpl-letter-check__box::after {
        font-size: 32px;
    }
    .fpl-checks {
        gap: 8px 10px;
    }
    .fpl-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .fpl-btn--primary {
        width: 100%;
        padding: 14px;
        font-size: 16px;
    }

    /* Helper modal becomes a full-screen sheet so the cards have room
       to breathe and no iOS zoom-on-focus (16px+ inputs). */
    dialog.fpl-helper {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
        border: none;
    }
    .fpl-helper__panels {
        max-height: calc(100vh - 240px);
    }
    .fpl-helper__search,
    .fpl-helper__time,
    .fpl-helper__desc {
        font-size: 16px;
    }
    .fpl-helper__list {
        grid-template-columns: 1fr;
    }
    .fpl-helper__tab {
        flex: 1;
        text-align: center;
        padding: 14px 8px;
        font-size: 14px;
    }
    .fpl-helper__close {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }

    .fpl-signature {
        max-width: 100%;
        max-height: 254px;
    }

    /* moved max-width 600px style here */
    .fpl-dashboard .fpl-btn,
    .fpl-dashboard__actions .fpl-btn,
    .fpl-dashboard__actions .fpl-dashboard__delete-form,
    .fpl-dashboard__actions .fpl-dashboard__delete-form .fpl-btn {
        flex: 1 1 auto;
        width: 100%;
        text-align: center;
    }

    .fpl-actions__save-row {
        flex-direction: column;
        align-items: stretch;
    }

    .fpl-actions__save-input {
        flex: 1 1 100%; /* prevent the input grow tall in small screen view */
    }

    .border-end-md {
        border-right: none;
    }
}

[data-bs-theme="dark"] .fpl-form {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .fpl-cell--static {
    background-color: #0A1225 !important;
}

[data-bs-theme="dark"] .fpl-static {
    color: #E8EEF4;
}

[data-bs-theme="dark"] ::placeholder {
    color: var(--label-grey) !important;
    opacity: 0.7 !important; /* Ensures proper visibility balance against dark inputs */
}


[data-bs-theme="dark"] .fpl-dashboard__card-title {
    color: #8FB6FF;
}

[data-bs-theme="dark"] .fpl-letter-check__box,
[data-bs-theme="dark"] .fpl-helper-trigger,
[data-bs-theme="dark"] .fpl-helper__card,
[data-bs-theme="dark"] .fpl-dashboard__card {
    background-color: #0f172a;
    color: #f8fafc;
    border: 1px solid #334155;
}

[data-bs-theme="dark"] dialog.fpl-helper,
[data-bs-theme="dark"] .fpl-helper__tabs,
[data-bs-theme="dark"] .fpl-actions,
[data-bs-theme="dark"] .fpl-btn--ghost {
    background-color: #0f172a;
}

[data-bs-theme="dark"] .fpl-helper__card.is-added,
[data-bs-theme="dark"] .fpl-btn--ghost:hover{
    background-color: #141E36;
}

[data-bs-theme="dark"] .fpl-helper__tab[aria-selected="true"] {
    background-color: #0f172a;
}

[data-bs-theme="dark"] .fpl-helper__desc,
[data-bs-theme="dark"] .fpl-dashboard__meta dd {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .fpl-actions--save-template {
    background-color: #141E36;
    border: 1px solid var(--grid-line);
}

[data-bs-theme="dark"] .fpl-dashboard__empty {
    background-color: #0f172a;
    color: #f8fafc;
    border-color: #334155;
}

[data-bs-theme="dark"] .fpl-input option {
    background-color: #141E36;
}
