/* ===========================================================================
   Le Canton Vacation Club — Design System
   "The Concierge Desk": calm, exact, trustworthy. One red, used sparingly.
   See DESIGN.md (project root) for the full spec. Loaded after jlv.css and
   before the auto-generated config.css (config.css keeps runtime brand overrides).
   =========================================================================== */

:root {
    /* Brand red — anchored on the Swiss-flag mark in the logo */
    --lc-red: #EC2227;          /* identity / large+bold only */
    --lc-red-primary: #D11F24;  /* primary action (white text 5.3:1) */
    --lc-red-deep: #A81A1E;     /* hover / active / banner */
    --lc-red-tint: #FDEAEA;     /* selected rows, gentle emphasis */

    /* Neutrals */
    --lc-ink: #1F2733;          /* primary text (~13:1 on white) */
    --lc-ink-muted: #5A6472;    /* secondary text, labels, placeholders (~6:1) */
    --lc-page: #F4F7FB;         /* app background */
    --lc-surface: #FFFFFF;      /* cards, inputs, modals */
    --lc-surface-raised: #F2F3F6;
    --lc-border: #CED4DA;
    --lc-border-strong: #B9C0C9;
    --lc-divider: #E5E7EB;

    /* Semantic states (never used as action colors) */
    --lc-success: #1E7E45;
    --lc-success-tint: #E4F4EA;
    --lc-danger: #B3261E;
    --lc-danger-tint: #F9E4E2;
    --lc-warning: #9A6700;

    /* Radii */
    --lc-r-sm: 6px;
    --lc-r-md: 10px;
    --lc-r-pill: 999px;

    /* Spacing scale */
    --lc-s-xs: 4px;
    --lc-s-sm: 8px;
    --lc-s-md: 16px;
    --lc-s-lg: 24px;
    --lc-s-xl: 32px;

    /* Elevation */
    --lc-shadow-card: 0 4px 16px rgba(31, 39, 51, 0.06);
    --lc-shadow-float: 0 12px 32px rgba(31, 39, 51, 0.14);
    --lc-focus-ring: 0 0 0 3px rgba(209, 31, 36, 0.25);

    /* Motion */
    --lc-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --lc-dur: 150ms;

    /* Type */
    --lc-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Semantic z-index scale */
    --lc-z-dropdown: 1000;
    --lc-z-sticky: 1020;
    --lc-z-modal-backdrop: 1040;
    --lc-z-modal: 1050;
    --lc-z-toast: 1080;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
body {
    font-family: var(--lc-font);
    color: var(--lc-ink);
    background-color: var(--lc-page);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    margin-bottom: 0;
    overflow-x: clip; /* belt-and-braces; clip (not hidden) keeps sticky nav working */
}

a {
    color: var(--lc-ink);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    transition: color var(--lc-dur) var(--lc-ease);
}
a:hover, a:focus-visible { color: var(--lc-red-deep); }

hr {
    border: 0;
    border-top: 1px solid var(--lc-divider);
    opacity: 1;
    margin: var(--lc-s-lg) 0;
}

/* Unified, visible, brand-tinted focus ring (replaces the stock blue #258cfb) */
:focus-visible {
    outline: none;
}
.btn:focus-visible,
.lc-btn:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus,
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
    outline: none;
    box-shadow: var(--lc-focus-ring);
}

/* --------------------------------------------------------------------------
   Typography helpers
   -------------------------------------------------------------------------- */
.lc-page-title {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--lc-ink);
    text-wrap: balance;
    margin: 0;
}
.lc-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--lc-ink);
    margin: 0;
}
.lc-eyebrow { /* small contextual label, used sparingly — not a section scaffold */
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--lc-ink-muted);
}
.lc-muted { color: var(--lc-ink-muted); }
.lc-small { font-size: 0.8125rem; line-height: 1.4; }
.lc-amount {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--lc-ink);
    font-variant-numeric: tabular-nums;
}
.lc-num { font-variant-numeric: tabular-nums; }

/* Brand wordmark + Swiss-cross mark */
.lc-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.0625rem;
    letter-spacing: 0.01em;
    color: var(--lc-ink);
    text-decoration: none;
    white-space: nowrap;
}
.lc-brand:hover, .lc-brand:focus-visible { color: var(--lc-ink); }
.lc-brand small {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--lc-ink-muted);
    letter-spacing: 0;
}
.lc-mark { flex: 0 0 auto; display: block; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.lc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--lc-font);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    min-height: 44px;
    padding: 12px 24px;
    border: 1px solid transparent;
    border-radius: var(--lc-r-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background-color var(--lc-dur) var(--lc-ease),
                border-color var(--lc-dur) var(--lc-ease),
                color var(--lc-dur) var(--lc-ease),
                transform var(--lc-dur) var(--lc-ease);
}
.lc-btn:focus-visible { box-shadow: var(--lc-focus-ring); }
.lc-btn--sm { min-height: 36px; padding: 8px 16px; font-size: 0.875rem; }
.lc-btn[disabled], .lc-btn:disabled {
    background: var(--lc-surface-raised);
    border-color: var(--lc-border);
    color: var(--lc-ink-muted);
    cursor: not-allowed;
    transform: none;
}

.lc-btn-primary { background: var(--lc-red-primary); color: #fff; }
.lc-btn-primary:hover { background: var(--lc-red-deep); color: #fff; transform: translateY(-1px); }
.lc-btn-primary:active { background: var(--lc-red-deep); transform: translateY(0); }

.lc-btn-secondary { background: var(--lc-surface); color: var(--lc-ink); border-color: var(--lc-border); }
.lc-btn-secondary:hover { background: var(--lc-surface-raised); border-color: var(--lc-border-strong); color: var(--lc-ink); }

.lc-btn-danger { background: transparent; color: var(--lc-danger); border-color: var(--lc-danger); }
.lc-btn-danger:hover { background: var(--lc-danger-tint); color: var(--lc-danger); }

/* Bootstrap variant overrides — keep any leftover usages on-brand.
   The No-Stock-Blue Rule: btn-primary is red, not #1b6ec2. */
.btn-primary {
    --bs-btn-bg: var(--lc-red-primary);
    --bs-btn-border-color: var(--lc-red-primary);
    --bs-btn-hover-bg: var(--lc-red-deep);
    --bs-btn-hover-border-color: var(--lc-red-deep);
    --bs-btn-active-bg: var(--lc-red-deep);
    --bs-btn-active-border-color: var(--lc-red-deep);
    --bs-btn-disabled-bg: var(--lc-red-primary);
    --bs-btn-disabled-border-color: var(--lc-red-primary);
}
.btn-success { /* demote decorative green to a neutral secondary */
    --bs-btn-color: var(--lc-ink);
    --bs-btn-bg: var(--lc-surface);
    --bs-btn-border-color: var(--lc-border);
    --bs-btn-hover-color: var(--lc-ink);
    --bs-btn-hover-bg: var(--lc-surface-raised);
    --bs-btn-hover-border-color: var(--lc-border-strong);
    --bs-btn-active-color: var(--lc-ink);
    --bs-btn-active-bg: var(--lc-surface-raised);
    --bs-btn-active-border-color: var(--lc-border-strong);
}
.btn-danger { /* destructive = outline, never a filled red competing with brand */
    --bs-btn-color: var(--lc-danger);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: var(--lc-danger);
    --bs-btn-hover-color: var(--lc-danger);
    --bs-btn-hover-bg: var(--lc-danger-tint);
    --bs-btn-hover-border-color: var(--lc-danger);
    --bs-btn-active-color: var(--lc-danger);
    --bs-btn-active-bg: var(--lc-danger-tint);
    --bs-btn-active-border-color: var(--lc-danger);
}

/* --------------------------------------------------------------------------
   Cards / panels
   -------------------------------------------------------------------------- */
.lc-card {
    background: var(--lc-surface);
    border: 1px solid var(--lc-border);
    border-radius: var(--lc-r-md);
    padding: var(--lc-s-lg);
}
.lc-card--lift { box-shadow: var(--lc-shadow-card); border-color: transparent; }
.lc-panel {
    background: var(--lc-surface);
    border: 1px solid var(--lc-border);
    border-radius: var(--lc-r-md);
    overflow: hidden;
}
.lc-panel__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: var(--lc-s-md) var(--lc-s-lg);
    border-bottom: 1px solid var(--lc-divider);
    background: var(--lc-surface-raised);
}
.lc-panel__head .lc-section-title { font-size: 1rem; }
.lc-panel__body { padding: var(--lc-s-lg); }

/* Key/value summary rows (reservation details) */
.lc-kv { display: grid; grid-template-columns: minmax(96px, auto) 1fr; gap: 6px var(--lc-s-md); }
.lc-kv dt { color: var(--lc-ink-muted); font-size: 0.875rem; }
.lc-kv dd { margin: 0; font-weight: 600; color: var(--lc-ink); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.lc-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--lc-s-md); }
.lc-label, .control-label, .lc-field > label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--lc-ink);
}
.lc-hint { font-size: 0.8125rem; color: var(--lc-ink-muted); }

/* Style Bootstrap controls to the system (covers .form-control + rendered <select>) */
.form-control, .form-select, .lc-input {
    font-family: var(--lc-font);
    font-size: 1rem;
    color: var(--lc-ink);
    background-color: var(--lc-surface);
    border: 1px solid var(--lc-border);
    border-radius: var(--lc-r-sm);
    padding: 8px 12px;
    transition: border-color var(--lc-dur) var(--lc-ease), box-shadow var(--lc-dur) var(--lc-ease);
}
.form-control::placeholder, .lc-input::placeholder { color: var(--lc-ink-muted); opacity: 1; }
.form-control:focus, .form-select:focus, .lc-input:focus {
    border-color: var(--lc-red-primary);
    box-shadow: var(--lc-focus-ring);
}
.form-control:disabled, .form-control[disabled],
.form-select:disabled, .lc-input:disabled {
    background-color: var(--lc-surface-raised);
    color: var(--lc-ink-muted);
}
.input-group-text {
    background: var(--lc-surface-raised);
    border: 1px solid var(--lc-border);
    color: var(--lc-ink);
    font-weight: 600;
    border-radius: var(--lc-r-sm);
}
.form-check-input:checked { background-color: var(--lc-red-primary); border-color: var(--lc-red-primary); }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.lc-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.lc-table thead th {
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--lc-ink-muted);
    text-transform: none;
    padding: 10px 12px;
    border-bottom: 1px solid var(--lc-border);
    white-space: nowrap;
}
.lc-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--lc-divider);
    color: var(--lc-ink);
    vertical-align: middle;
}
.lc-table tbody tr:hover { background: var(--lc-surface-raised); }
.lc-table .lc-td-num { text-align: right; font-variant-numeric: tabular-nums; }
.lc-table-wrap { overflow-x: auto; border: 1px solid var(--lc-border); border-radius: var(--lc-r-md); }

/* Status chips */
.lc-chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.75rem; font-weight: 600; line-height: 1;
    padding: 4px 10px; border-radius: var(--lc-r-pill);
    background: var(--lc-surface-raised); color: var(--lc-ink);
    border: 1px solid var(--lc-border);
}
.lc-chip--ok { background: var(--lc-success-tint); color: var(--lc-success); border-color: transparent; }
.lc-chip--paid { background: var(--lc-success-tint); color: var(--lc-success); border-color: transparent; }
.lc-chip--cancel { background: var(--lc-danger-tint); color: var(--lc-danger); border-color: transparent; }

/* --------------------------------------------------------------------------
   Admin top navigation
   -------------------------------------------------------------------------- */
.lc-nav {
    background: var(--lc-surface);
    border-bottom: 1px solid var(--lc-divider);
    box-shadow: var(--lc-shadow-card);
    position: sticky;
    top: 0;
    z-index: var(--lc-z-sticky);
}
.lc-nav .navbar-nav .nav-link {
    color: var(--lc-ink);
    font-weight: 500;
    border-radius: var(--lc-r-sm);
    padding: 8px 12px;
    transition: background-color var(--lc-dur) var(--lc-ease), color var(--lc-dur) var(--lc-ease);
}
.lc-nav .navbar-nav .nav-link:hover { background: var(--lc-surface-raised); color: var(--lc-red-deep); }
.lc-nav .navbar-nav .nav-link.active,
.lc-nav .navbar-nav .show > .nav-link { color: var(--lc-red-deep); background: var(--lc-red-tint); }
.lc-nav .dropdown-menu {
    border: 1px solid var(--lc-border);
    border-radius: var(--lc-r-md);
    box-shadow: var(--lc-shadow-float);
    padding: 6px;
}
.lc-nav .dropdown-item { border-radius: var(--lc-r-sm); padding: 8px 12px; color: var(--lc-ink); }
.lc-nav .dropdown-item:hover { background: var(--lc-surface-raised); color: var(--lc-red-deep); }
.lc-nav .dropdown-item.disabled { color: var(--lc-ink-muted); }

/* --------------------------------------------------------------------------
   Guest banner (shared with payment pages — kept conservative)
   -------------------------------------------------------------------------- */
.corbanner {
    background-color: var(--lc-red-deep); /* config.css may override at runtime */
}
.lc-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
}
.lc-banner img { max-width: 360px; width: auto; height: auto; }

/* --------------------------------------------------------------------------
   Modals
   -------------------------------------------------------------------------- */
.modal-content { border: none; border-radius: var(--lc-r-md); box-shadow: var(--lc-shadow-float); }
.modal-header { border-bottom: 1px solid var(--lc-divider); padding: var(--lc-s-md) var(--lc-s-lg); }
.modal-title { font-size: 1.125rem; font-weight: 600; color: var(--lc-ink); }
.modal-body { padding: var(--lc-s-lg); color: var(--lc-ink); }
.modal-footer { border-top: 1px solid var(--lc-divider); padding: var(--lc-s-md) var(--lc-s-lg); }

/* Processing spinner modal */
#mdprocessando .modal-body { padding: var(--lc-s-xl); }
#mdprocessando .fa-spinner { color: var(--lc-red-primary); }

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */
.lc-container { max-width: 1080px; margin-inline: auto; padding-inline: var(--lc-s-md); }
.lc-stack > * + * { margin-top: var(--lc-s-md); }
.lc-toolbar { display: flex; flex-wrap: wrap; gap: var(--lc-s-md); align-items: flex-end; }
.lc-page-head {
    display: flex; flex-wrap: wrap; gap: var(--lc-s-md);
    align-items: center; justify-content: space-between;
    margin: var(--lc-s-lg) 0 var(--lc-s-md);
}

/* Footer (override the legacy absolute positioning from site.css/jlv.css) */
.footer {
    position: static;
    width: auto;
    line-height: 1.4;
    white-space: normal;
    color: var(--lc-ink-muted);
    font-size: 0.8125rem;
    border-top: 1px solid var(--lc-divider);
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Empty / status states
   -------------------------------------------------------------------------- */
.lc-empty {
    text-align: center;
    padding: var(--lc-s-xl) var(--lc-s-md);
    max-width: 480px;
    margin-inline: auto;
}
.lc-empty__icon {
    width: 56px; height: 56px; margin: 0 auto var(--lc-s-md);
    display: grid; place-items: center;
    border-radius: var(--lc-r-pill);
    background: var(--lc-red-tint); color: var(--lc-red-deep);
    font-size: 1.5rem;
}
.lc-empty h1, .lc-empty h2 { font-size: 1.375rem; font-weight: 600; color: var(--lc-ink); margin: 0 0 var(--lc-s-sm); }
.lc-empty p { color: var(--lc-ink-muted); margin: 0 auto var(--lc-s-lg); max-width: 42ch; }

/* --------------------------------------------------------------------------
   Motion preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
    .lc-btn-primary:hover { transform: none; }
}
