/* ==========================================================================
   Jeb Stuart Rescue Squad — Community Room Rental
   ========================================================================== */
:root {
    --cr-red: #8b1a1a;
    --cr-red-dark: #6d1414;
    --cr-red-light: #a52222;
    --cr-navy: #16233a;
    --cr-gold: #c9a227;
    --cr-bg: #f5f6f8;
    --cr-ink: #1f2937;
    --cr-muted: #64748b;
    --cr-line: #e4e8ee;
    --cr-available: #1f9254;
    --cr-pending: #d98314;
    --cr-booked: #b42323;
    --cr-blocked: #5b6675;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--cr-bg);
    color: var(--cr-ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--cr-red); }
a:hover { color: var(--cr-red-dark); }

.cr-container { max-width: 1140px; margin: 0 auto; padding: 0 1.1rem; }
.cr-narrow { max-width: 860px; }

/* ── Top bar ───────────────────────────────────────────────────────────── */
.cr-topbar {
    background: var(--cr-navy);
    color: #cbd5e1;
    font-size: .82rem;
    padding: .45rem 0;
}
.cr-topbar a { color: #e2e8f0; text-decoration: none; }
.cr-topbar .cr-container { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ── Header ────────────────────────────────────────────────────────────── */
.cr-header {
    background: linear-gradient(135deg, var(--cr-red) 0%, var(--cr-red-dark) 100%);
    color: #fff;
    border-bottom: 4px solid var(--cr-gold);
}
.cr-header-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: 1.15rem 0; flex-wrap: wrap;
}
.cr-brand { display: flex; align-items: center; gap: .9rem; text-decoration: none; color: #fff; }
.cr-brand-mark {
    width: 52px; height: 52px; border-radius: 50%;
    background: rgba(255,255,255,.14);
    border: 2px solid rgba(255,255,255,.55);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; flex-shrink: 0;
}
.cr-brand-text h1 { margin: 0; font-size: 1.32rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.cr-brand-text p { margin: 0; font-size: .84rem; opacity: .9; }

.cr-nav { display: flex; gap: .3rem; flex-wrap: wrap; }
.cr-nav a {
    color: #fff; text-decoration: none; padding: .45rem .85rem;
    border-radius: 6px; font-size: .92rem; font-weight: 500;
    border: 1px solid transparent; white-space: nowrap;
}
.cr-nav a:hover { background: rgba(255,255,255,.14); color: #fff; }
.cr-nav a.active { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.35); }
.cr-nav a.cr-nav-cta { background: var(--cr-gold); color: #3a2c00; font-weight: 700; }
.cr-nav a.cr-nav-cta:hover { background: #dfb62f; color: #3a2c00; }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.cr-hero {
    background: linear-gradient(rgba(12,20,34,.82), rgba(12,20,34,.88)),
                url('room.jpg') center/cover no-repeat, var(--cr-navy);
    color: #fff; padding: 3.2rem 0;
}
.cr-hero h2 { margin: 0 0 .6rem; font-size: 2.1rem; line-height: 1.2; }
.cr-hero p { margin: 0 0 1.4rem; font-size: 1.05rem; opacity: .92; max-width: 640px; }
.cr-hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.cr-hero-facts { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 2rem; }
.cr-hero-fact strong { display: block; font-size: 1.5rem; color: var(--cr-gold); line-height: 1.1; }
.cr-hero-fact span { font-size: .85rem; opacity: .85; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.cr-btn {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .62rem 1.15rem; border-radius: 7px; font-weight: 600;
    text-decoration: none; border: 1px solid transparent; cursor: pointer;
    font-size: .95rem; font-family: inherit; transition: .15s ease; line-height: 1.3;
}
.cr-btn-primary { background: var(--cr-red); color: #fff; }
.cr-btn-primary:hover { background: var(--cr-red-dark); color: #fff; }
.cr-btn-gold { background: var(--cr-gold); color: #3a2c00; }
.cr-btn-gold:hover { background: #dfb62f; color: #3a2c00; }
.cr-btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.cr-btn-outline:hover { background: rgba(255,255,255,.14); color: #fff; }
.cr-btn-light { background: #fff; color: var(--cr-ink); border-color: var(--cr-line); }
.cr-btn-light:hover { background: #f1f5f9; color: var(--cr-ink); }
.cr-btn-sm { padding: .34rem .7rem; font-size: .84rem; }
.cr-btn-success { background: var(--cr-available); color: #fff; }
.cr-btn-success:hover { background: #176f41; color: #fff; }
.cr-btn-danger { background: var(--cr-booked); color: #fff; }
.cr-btn-danger:hover { background: #8f1c1c; color: #fff; }
.cr-btn[disabled], .cr-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Sections & cards ──────────────────────────────────────────────────── */
.cr-section { padding: 2.6rem 0; }
.cr-section-head { margin-bottom: 1.4rem; }
.cr-section-head h3 { margin: 0 0 .3rem; font-size: 1.5rem; color: var(--cr-navy); }
.cr-section-head p { margin: 0; color: var(--cr-muted); }

.cr-card {
    background: #fff; border: 1px solid var(--cr-line);
    border-radius: 11px; padding: 1.4rem;
    box-shadow: 0 1px 3px rgba(16,24,40,.05);
}
.cr-card + .cr-card { margin-top: 1.1rem; }
.cr-card h4 { margin: 0 0 .7rem; font-size: 1.08rem; color: var(--cr-navy); }

.cr-grid { display: grid; gap: 1.1rem; }
.cr-grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cr-grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.cr-grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* ── Pricing ───────────────────────────────────────────────────────────── */
.cr-price-card { text-align: center; border-top: 4px solid var(--cr-red); }
.cr-price-card .cr-price { font-size: 2.1rem; font-weight: 700; color: var(--cr-red); line-height: 1.1; }
.cr-price-card .cr-price small { font-size: .95rem; color: var(--cr-muted); font-weight: 500; }
.cr-price-card h4 { min-height: 2.6em; }
.cr-price-note { font-size: .86rem; color: var(--cr-muted); }

/* ── Calendar ──────────────────────────────────────────────────────────── */
.cr-cal-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.cr-cal-title { font-size: 1.28rem; font-weight: 700; color: var(--cr-navy); margin: 0; }
.cr-cal-nav { display: flex; gap: .4rem; }

.cr-legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--cr-muted); margin-bottom: 1rem; }
.cr-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.cr-dot { width: 13px; height: 13px; border-radius: 4px; display: inline-block; border: 1px solid rgba(0,0,0,.12); }
.cr-dot-available { background: #e7f6ed; border-color: var(--cr-available); }
.cr-dot-pending   { background: #fdf1de; border-color: var(--cr-pending); }
.cr-dot-booked    { background: #fae4e4; border-color: var(--cr-booked); }
.cr-dot-blocked   { background: #e8eaee; border-color: var(--cr-blocked); }

.cr-calendar { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--cr-line); border-radius: 10px; overflow: hidden; }
.cr-calendar th {
    background: var(--cr-navy); color: #fff; font-size: .78rem; text-transform: uppercase;
    letter-spacing: .05em; padding: .6rem .3rem; font-weight: 600;
}
.cr-calendar td {
    border: 1px solid var(--cr-line); vertical-align: top;
    height: 92px; width: 14.28%; padding: 0; position: relative;
}
.cr-day { display: block; height: 100%; padding: .4rem .45rem; text-decoration: none; color: inherit; }
.cr-day-num { font-weight: 700; font-size: .92rem; display: block; margin-bottom: .18rem; }
.cr-day-tag { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; display: block; }
.cr-day-note { font-size: .68rem; color: var(--cr-muted); display: block; margin-top: .1rem; line-height: 1.25; }

.cr-day-empty { background: #fafbfc; }
.cr-day-past { background: #f4f5f7; color: #aab2bd; }
.cr-day-past .cr-day-num { color: #aab2bd; }
.cr-day-closed { background: #f7f8fa; color: #9aa3af; }
.cr-day-available { background: #e7f6ed; }
.cr-day-available .cr-day-tag { color: var(--cr-available); }
.cr-day-available a.cr-day:hover { background: #d3eddf; }
.cr-day-pending { background: #fdf1de; }
.cr-day-pending .cr-day-tag { color: #8a5a06; }
.cr-day-booked { background: #fae4e4; }
.cr-day-booked .cr-day-tag { color: var(--cr-booked); }
.cr-day-blocked { background: #e8eaee; }
.cr-day-blocked .cr-day-tag { color: var(--cr-blocked); }
.cr-today { outline: 3px solid var(--cr-gold); outline-offset: -3px; }

/* ── Forms ─────────────────────────────────────────────────────────────── */
.cr-form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.cr-field { display: flex; flex-direction: column; gap: .3rem; }
.cr-field.cr-span-2 { grid-column: 1 / -1; }
.cr-field label { font-weight: 600; font-size: .88rem; color: var(--cr-navy); }
.cr-field .cr-help { font-size: .79rem; color: var(--cr-muted); font-weight: 400; }
.cr-field input, .cr-field select, .cr-field textarea {
    padding: .55rem .7rem; border: 1px solid #cbd5e1; border-radius: 7px;
    font-size: .95rem; font-family: inherit; background: #fff; color: var(--cr-ink); width: 100%;
}
.cr-field input:focus, .cr-field select:focus, .cr-field textarea:focus {
    outline: none; border-color: var(--cr-red); box-shadow: 0 0 0 3px rgba(139,26,26,.12);
}
.cr-field textarea { resize: vertical; min-height: 92px; }
.cr-required { color: var(--cr-booked); }

.cr-check { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; }
.cr-check input { width: 18px; height: 18px; margin-top: .18rem; flex-shrink: 0; }
/* Staff option lists stack several checkboxes; keep them from colliding. */
.cr-check + .cr-check { margin-top: .65rem; }

/* ── Alerts ────────────────────────────────────────────────────────────── */
.cr-alert { padding: .85rem 1.05rem; border-radius: 8px; border: 1px solid; margin-bottom: 1.1rem; font-size: .93rem; }
.cr-alert-success { background: #e8f7ef; border-color: #a9dcc0; color: #14683c; }
.cr-alert-error   { background: #fdeaea; border-color: #f0b4b4; color: #8f1c1c; }
.cr-alert-info    { background: #e8f1fb; border-color: #b6d2f0; color: #1d4e89; }
.cr-alert-warn    { background: #fdf4e3; border-color: #efd39b; color: #7a5510; }

/* ── Rules list ────────────────────────────────────────────────────────── */
.cr-rules { counter-reset: crrule; list-style: none; padding: 0; margin: 0; }
.cr-rules li {
    counter-increment: crrule; position: relative;
    padding: .7rem 0 .7rem 2.6rem; border-bottom: 1px solid var(--cr-line); font-size: .95rem;
}
.cr-rules li:last-child { border-bottom: none; }
.cr-rules li::before {
    content: counter(crrule); position: absolute; left: 0; top: .72rem;
    width: 1.75rem; height: 1.75rem; border-radius: 50%;
    background: var(--cr-red); color: #fff; font-size: .8rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.cr-prohibit { list-style: none; padding: 0; margin: 0; }
.cr-prohibit li { padding: .45rem 0 .45rem 1.8rem; position: relative; font-size: .95rem; }
.cr-prohibit li::before { content: '\2715'; position: absolute; left: .25rem; color: var(--cr-booked); font-weight: 700; }
.cr-include { list-style: none; padding: 0; margin: 0; }
.cr-include li { padding: .45rem 0 .45rem 1.8rem; position: relative; font-size: .95rem; }
.cr-include li::before { content: '\2713'; position: absolute; left: .25rem; color: var(--cr-available); font-weight: 700; }

/* ── Steps ─────────────────────────────────────────────────────────────── */
.cr-steps { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); counter-reset: crstep; }
.cr-step { background: #fff; border: 1px solid var(--cr-line); border-radius: 11px; padding: 1.2rem; position: relative; counter-increment: crstep; }
.cr-step::before {
    content: counter(crstep); position: absolute; top: -14px; left: 1.2rem;
    width: 30px; height: 30px; border-radius: 50%; background: var(--cr-navy); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem;
}
.cr-step h4 { margin: .6rem 0 .35rem; font-size: 1rem; }
.cr-step p { margin: 0; font-size: .89rem; color: var(--cr-muted); }

/* ── Tables ────────────────────────────────────────────────────────────── */
.cr-table { width: 100%; border-collapse: collapse; background: #fff; font-size: .9rem; }
.cr-table th {
    text-align: left; padding: .65rem .7rem; background: #f1f3f6;
    border-bottom: 2px solid var(--cr-line); font-size: .78rem;
    text-transform: uppercase; letter-spacing: .04em; color: #475569; white-space: nowrap;
}
.cr-table td { padding: .65rem .7rem; border-bottom: 1px solid var(--cr-line); vertical-align: middle; }
.cr-table tr:hover td { background: #fafbfc; }
.cr-table-wrap { overflow-x: auto; border: 1px solid var(--cr-line); border-radius: 10px; }

.badge {
    display: inline-block; padding: .22em .6em; font-size: .74rem; font-weight: 700;
    border-radius: 5px; color: #fff; line-height: 1.5; white-space: nowrap;
}
.bg-success { background: var(--cr-available); }
.bg-warning { background: #f0ad4e; }
.bg-danger  { background: var(--cr-booked); }
.bg-info    { background: #5bc0de; }
.bg-secondary { background: #6c757d; }
.bg-dark    { background: #343a40; }
.text-dark  { color: #212529 !important; }

/* ── Footer ────────────────────────────────────────────────────────────── */
.cr-footer { background: var(--cr-navy); color: #b6c2d4; padding: 2.2rem 0 1.4rem; margin-top: 3rem; font-size: .9rem; }
.cr-footer h5 { color: #fff; font-size: .95rem; margin: 0 0 .6rem; }
.cr-footer a { color: #d7e0ec; text-decoration: none; }
.cr-footer a:hover { color: #fff; text-decoration: underline; }
.cr-footer-grid { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cr-footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 1.6rem; padding-top: 1rem; font-size: .82rem; color: #8ea0b8; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ── Admin ─────────────────────────────────────────────────────────────── */
.cr-admin-bar { background: var(--cr-navy); color: #fff; padding: .55rem 0; font-size: .88rem; }
.cr-admin-bar .cr-container { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.cr-admin-bar a { color: #dbe3ef; text-decoration: none; padding: .25rem .6rem; border-radius: 5px; }
.cr-admin-bar a:hover, .cr-admin-bar a.active { background: rgba(255,255,255,.16); color: #fff; }
.cr-stat { background: #fff; border: 1px solid var(--cr-line); border-radius: 10px; padding: 1rem 1.15rem; border-left: 4px solid var(--cr-red); }
.cr-stat .cr-stat-num { font-size: 1.85rem; font-weight: 700; line-height: 1.1; color: var(--cr-navy); }
.cr-stat .cr-stat-label { font-size: .82rem; color: var(--cr-muted); text-transform: uppercase; letter-spacing: .04em; }
.cr-tabs { display: flex; gap: .3rem; border-bottom: 2px solid var(--cr-line); margin-bottom: 1.2rem; flex-wrap: wrap; }
.cr-tabs a { padding: .55rem 1rem; text-decoration: none; color: var(--cr-muted); font-weight: 600; font-size: .92rem; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.cr-tabs a.active { color: var(--cr-red); border-bottom-color: var(--cr-red); }
/* "+ Add Reservation" should read as the primary action in the admin nav. */
.cr-tabs a[href="new_booking.php"] { color: var(--cr-red); }

.cr-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; background: linear-gradient(135deg, var(--cr-navy) 0%, #0b1220 100%); }
.cr-login-card { background: #fff; border-radius: 13px; padding: 2rem; width: 100%; max-width: 410px; box-shadow: 0 18px 45px rgba(0,0,0,.3); }

.cr-muted { color: var(--cr-muted); }
.cr-small { font-size: .85rem; }
.cr-mt { margin-top: 1.1rem; }
.cr-mb { margin-bottom: 1.1rem; }
.cr-text-center { text-align: center; }
.cr-nowrap { white-space: nowrap; }
.cr-flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* ── Zeffy payment embed ───────────────────────────────────────────────── */
.cr-zeffy-frame {
    width: 100%;
    height: 1100px;          /* Zeffy's form is tall; give it real room */
    border: 1px solid var(--cr-line);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    position: relative;
}
/* The iframe had no size of its own and was collapsing to the browser
   default (~300x150). It must fill its container. */
.cr-zeffy-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 10px;
}
/* Let the payment page use the full width so the form isn't cramped. */
.cr-pay-wide { max-width: 1280px; }

@media (max-width: 1100px) { .cr-zeffy-frame { height: 1200px; } }
@media (max-width: 760px)  { .cr-zeffy-frame { height: 1400px; } }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
    .cr-hero h2 { font-size: 1.6rem; }
    .cr-calendar td { height: 64px; }
    .cr-day-note { display: none; }
    .cr-day-tag { font-size: .6rem; }
    .cr-header-inner { flex-direction: column; align-items: flex-start; }
    .cr-nav { width: 100%; }
}

@media print {
    .cr-topbar, .cr-nav, .cr-hero-actions, .cr-footer, .cr-admin-bar, .cr-no-print { display: none !important; }
    body { background: #fff; }
    .cr-card { break-inside: avoid; box-shadow: none; }
    a[href]::after { content: ''; }
}
