/* ═══════════════════════════════════════
   Shepherdsville Hostel Registration – Form CSS
═══════════════════════════════════════ */

#fhr-wrap {
  max-width: 820px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #222;
}

.fhr-title {
  font-size: 2em;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 8px;
  word-break: normal;
  overflow-wrap: break-word;
}

.fhr-subtitle {
  color: #666;
  line-height: 1.45;
  margin: 0 0 32px;
}

@media (max-width: 600px) {
  .fhr-title    { font-size: 1.45em; line-height: 1.3; }
  .fhr-subtitle { font-size: .95em; margin-bottom: 24px; }
}

/* ── sections ── */
.fhr-section {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 24px 28px;
  margin-bottom: 28px;
  background: #fafafa;
}

.fhr-section legend {
  font-weight: 700;
  font-size: .92em;
  padding: 6px 18px;
  color: #fff;
  background: #c0392b;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .06em;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

/* ── fields ── */
.fhr-field {
  margin-bottom: 18px;
}

.fhr-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: .93em;
}

.fhr-field input[type="text"],
.fhr-field input[type="email"],
.fhr-field input[type="tel"],
.fhr-field input[type="date"],
.fhr-field select,
.fhr-field textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: .95em;
  background: #fff;
  transition: border-color .2s;
  box-sizing: border-box;
}

.fhr-field input:focus,
.fhr-field select:focus,
.fhr-field textarea:focus {
  outline: none;
  border-color: #c0392b;
  box-shadow: 0 0 0 3px rgba(192,57,43,.12);
}

.fhr-field input[type="file"] {
  padding: 8px 0;
}

.fhr-field.fhr-checkbox label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 400;
  font-size: .9em;
  line-height: 1.5;
  cursor: pointer;
}

.fhr-field.fhr-checkbox input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: #c0392b;
}

.fhr-hint {
  font-size: .82em;
  color: #888;
  margin: 2px 0 6px;
}

.req { color: #c0392b; }

/* ── 2-column row ── */
.fhr-row {
  display: flex;
  gap: 16px;
}
.fhr-row .fhr-field { flex: 1; margin-bottom: 18px; }
.fhr-row .fhr-field--wide { flex: 2; }
@media (max-width: 600px) { .fhr-row { flex-direction: column; } }

/* ── availability badge ── */
.fhr-beds-left {
  font-size: .85em;
  font-weight: 600;
  margin-top: 6px;
  padding: 5px 10px;
  border-radius: 4px;
  display: inline-block;
}
.fhr-beds-left.available  { background: #e6f4ea; color: #1e7e34; }
.fhr-beds-left.low        { background: #fff3cd; color: #856404; }
.fhr-beds-left.full       { background: #f8d7da; color: #721c24; }

/* ── select option states ── */
option.fhr-full    { color: #999; }
option.fhr-low     { color: #856404; }

/* ── signature ── */
#fhr-sig-container {
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  display: inline-block;
  padding: 0;
  overflow: hidden;
}

#fhr-sig-canvas {
  display: block;
  width: 540px;
  height: 160px;
  max-width: 100%;
  cursor: crosshair;
  touch-action: none;
}

#fhr-sig-clear {
  margin: 8px 10px;
}

/* ── buttons ── */
.fhr-btn-primary {
  background: #c0392b;
  color: #fff;
  border: none;
  padding: 13px 36px;
  border-radius: 7px;
  font-size: 1em;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
}
.fhr-btn-primary:hover { background: #a93226; }
.fhr-btn-primary:disabled { background: #ccc; cursor: not-allowed; }

.fhr-btn-secondary {
  background: #eee;
  color: #333;
  border: 1px solid #ccc;
  padding: 6px 16px;
  border-radius: 5px;
  font-size: .85em;
  cursor: pointer;
}
.fhr-btn-secondary:hover { background: #ddd; }

/* ── spinner ── */
.fhr-spinner {
  display: inline-block;
  width: 24px; height: 24px;
  border: 3px solid #ddd;
  border-top-color: #c0392b;
  border-radius: 50%;
  animation: fhr-spin .7s linear infinite;
  vertical-align: middle;
  margin-left: 12px;
}
@keyframes fhr-spin { to { transform: rotate(360deg); } }

/* ── notices ── */
.fhr-notice {
  padding: 13px 18px;
  border-radius: 7px;
  margin-bottom: 20px;
  font-weight: 600;
}
.fhr-notice.error   { background: #f8d7da; color: #721c24; border-left: 4px solid #c0392b; }
.fhr-notice.success { background: #e6f4ea; color: #1e7e34; border-left: 4px solid #28a745; }

/* ── success box ── */
.fhr-success-box {
  background: #e6f4ea;
  border: 1px solid #28a745;
  border-radius: 10px;
  padding: 28px 32px;
  text-align: center;
  color: #1e7e34;
}
.fhr-success-box h3 { margin: 0 0 10px; font-size: 1.4em; }

.fhr-submit-wrap {
  text-align: center;
  margin: 10px 0 32px;
}

/* ═══════════════════════════════════════
   FLOOR MAP
═══════════════════════════════════════ */

#fhr-floor-map-wrap {
  margin-top: 20px;
  border-top: 2px dashed #e0e0e0;
  padding-top: 18px;
}

.fhr-floor-map-intro {
  font-size: .93em;
  color: #444;
  margin-bottom: 12px;
}

/* ── Legend ── */
.fhr-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: .82em;
  color: #555;
  margin-bottom: 18px;
  align-items: center;
}

.fhr-legend-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 4px;
}
.fhr-legend-dot.available     { background: #28a745; }
.fhr-legend-dot.partial       { background: #ffc107; }
.fhr-legend-dot.full          { background: #dc3545; }
.fhr-legend-dot.gender_locked { background: #aaa; }
.fhr-legend-dot.selected      { background: #0073aa; border: 2px solid #004f7a; }

/* ── Floor rows ── */
.fhr-floor-row {
  margin-bottom: 18px;
}

.fhr-floor-label {
  display: inline-block;
  font-size: .72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #999;
  margin-bottom: 10px;
  padding: 2px 10px 2px 0;
  border-left: 3px solid #c0392b;
  padding-left: 10px;
}

.fhr-floor-rooms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
}

/* ── Individual room tile ── */
.fhr-room-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  min-height: 72px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .12s, box-shadow .12s, border-color .12s;
  user-select: none;
  overflow: hidden;
}

.fhr-room-tile .fhr-room-num {
  font-size: 1.05em;
  line-height: 1.1;
  letter-spacing: .01em;
}

.fhr-room-tile .fhr-room-gender {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: .8em;
  font-weight: 700;
  line-height: 1;
  opacity: .7;
}

/* Belt-and-braces: hide legacy "Available" status text emitted by older cached form.js */
.fhr-room-tile .fhr-room-beds { display: none !important; }

.fhr-room-tile .fhr-room-ac {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: .75em;
  line-height: 1;
  opacity: .8;
}

/* Checkmark — hidden by default, shown when selected */
.fhr-room-tile .fhr-room-check {
  position: absolute;
  bottom: 4px;
  right: 5px;
  width: 18px;
  height: 18px;
  background: #c0392b;
  color: #fff;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: .72em;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

/* Default (legacy) status colours kept for backward compatibility */
.fhr-room-tile.available { background: #d4edda; color: #155724; }
.fhr-room-tile.partial   { background: #fff3cd; color: #856404; }
.fhr-room-tile.full      { background: #f8d7da; color: #721c24; cursor: not-allowed; }
.fhr-room-tile.gender_locked,
.fhr-room-tile.inactive  { background: #e9ecef; color: #6c757d; cursor: not-allowed; }

/* Selected state — keep gender color, add bold outline + checkmark */
.fhr-room-tile.selected {
  border-color: #c0392b !important;
  border-width: 3px;
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(192, 57, 43, 0.22);
  z-index: 2;
}
.fhr-room-tile.selected .fhr-room-check { display: inline-flex; }

/* Subtle hover lift (only on selectable tiles) */
.fhr-room-tile:not(.fhr-disabled):not(.full):not(.inactive):not(.gender_locked):hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(0,0,0,.08);
}

/* Mobile tweaks */
@media (max-width: 480px) {
  .fhr-floor-rooms { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
  .fhr-room-tile   { min-height: 64px; border-radius: 9px; }
  .fhr-room-tile .fhr-room-num { font-size: .95em; }
}

/* ── Selected room display strip ── */
.fhr-selected-room-display {
  margin-top: 14px;
  padding: 12px 18px;
  background: #fff5f3;
  border: 1px solid #f0d4ce;
  border-radius: 7px;
  font-size: .95em;
  color: #a93324;
  font-weight: 600;
}

/* ── Loading state ── */
#fhr-floor-map-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .9em;
  color: #666;
  padding: 12px 0;
}

/* ═══════════════════════════════════════
   ADMIN FLOOR MAP CONTROLS
═══════════════════════════════════════ */
.fhr-admin-map-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1d2327;
  color: #fff;
  padding: 10px 16px;
  border-radius: 7px 7px 0 0;
  margin-bottom: 0;
  font-size: .85em;
}
.fhr-admin-map-bar span { opacity: .7; }
.fhr-admin-add-btn {
  background: #00a32a;
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 5px;
  font-size: .85em;
  font-weight: 700;
  cursor: pointer;
}
.fhr-admin-add-btn:hover { background: #008a20; }

/* Admin tile overlays */
.fhr-room-tile .fhr-admin-tile-btns {
  display: none;
  position: absolute;
  bottom: 2px;
  left: 0; right: 0;
  justify-content: center;
  gap: 4px;
}
.fhr-room-tile:hover .fhr-admin-tile-btns { display: flex; }
.fhr-tile-edit-btn,
.fhr-tile-del-btn {
  border: none;
  border-radius: 3px;
  padding: 2px 7px;
  font-size: .65em;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.6;
}
.fhr-tile-edit-btn { background: #0073aa; color: #fff; }
.fhr-tile-del-btn  { background: #d63638; color: #fff; }

/* Admin modal */
.fhr-admin-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 99999;
  align-items: center;
  justify-content: center;
}
.fhr-admin-modal-overlay.open { display: flex; }
.fhr-admin-modal {
  background: #fff;
  border-radius: 10px;
  padding: 28px 32px;
  max-width: 440px;
  width: 92%;
  box-shadow: 0 8px 40px rgba(0,0,0,.25);
}
.fhr-admin-modal h3 { margin: 0 0 18px; font-size: 1.1em; }
.fhr-admin-modal label { display:block; font-weight:600; font-size:.88em; margin-bottom:4px; margin-top:12px; }
.fhr-admin-modal input[type=text],
.fhr-admin-modal input[type=number],
.fhr-admin-modal select {
  width: 100%; padding: 8px 10px; border: 1px solid #ccc;
  border-radius: 5px; box-sizing: border-box; font-size:.92em;
}
.fhr-admin-modal .fhr-modal-actions { display:flex; gap:10px; margin-top:20px; }
.fhr-admin-modal .fhr-modal-save { background:#c0392b;color:#fff;border:none;padding:9px 22px;border-radius:5px;font-weight:700;cursor:pointer; }
.fhr-admin-modal .fhr-modal-save:hover { background:#a93226; }
.fhr-admin-modal .fhr-modal-cancel { background:#eee;color:#333;border:1px solid #ccc;padding:9px 18px;border-radius:5px;cursor:pointer; }

/* ═══════════════════════════════════════
   PRICE CARD
═══════════════════════════════════════ */
.fhr-price-card {
  margin-top: 14px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
  border: 2px solid #c0392b;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fhr-price-label {
  font-size: .78em;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.fhr-price-value {
  font-size: 1.6em;
  font-weight: 800;
  color: #c0392b;
  line-height: 1.1;
}
.fhr-price-notes {
  font-size: .85em;
  color: #666;
  font-style: italic;
}
.fhr-price-notes:empty { display: none; }

/* ═══════════════════════════════════════════
   FLOOR MAP — gender-aware tiles + legend
═══════════════════════════════════════════ */

/* ───── Floor map legend — clean uniform swatches ───── */
.fhr-map-legend {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
    background: #f8f9fa;
    border: 1px solid #e1e4e7;
    border-radius: 8px;
    font-size: .85em;
}
@media (max-width: 480px) {
    .fhr-map-legend { grid-template-columns: repeat(2, 1fr); }
}
.fhr-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #444;
    line-height: 1;
}
.fhr-legend-swatch {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 5px;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    box-sizing: border-box;
}
.fhr-legend-label {
    font-weight: 500;
    white-space: nowrap;
}
.fhr-legend-swatch.fhr-neutral   { background: #d4edda; border: 1px solid #7bc98e; color: #1e7e34; }
.fhr-legend-swatch.fhr-female    { background: #f8b8d4; border: 1px solid #e98ab8; color: #7a1f48; }
.fhr-legend-swatch.fhr-male      { background: #9ec1f0; border: 1px solid #5a8ad8; color: #15306e; }
.fhr-legend-swatch.fhr-partial   { background: #fff3cd; border: 1px solid #ffe187; color: #856404; }
.fhr-legend-swatch.fhr-disabled  { background: #d6d6d6; border: 1px solid #aaa;    color: #555;    text-decoration: line-through; }

/* Tile gender base colours (selected state handled by .fhr-room-tile.selected above) */
.fhr-room-tile.fhr-female {
    background: #fde2ef;
    border-color: #f5b5d3;
    color: #7a1f48;
}
.fhr-room-tile.fhr-male {
    background: #c6d9fb;
    border-color: #6f9be8;
    color: #15306e;
}
.fhr-room-tile.fhr-neutral {
    background: #e3f6e8;
    border-color: #9bd6ab;
    color: #1e7e34;
}

/* ── Occupancy + gender COMBINED ──
   A partially-taken room shows a split tile: yellow half = someone is
   already in it, coloured half = who it's locked to (blue male / pink
   female). One glance gives both facts. */
.fhr-room-tile.partial.fhr-male,
.fhr-room-tile.reserved_partial.fhr-male {
    background: linear-gradient(135deg, #fff3cd 50%, #c6d9fb 50%);
    border-color: #6f9be8;
    color: #15306e;
}
.fhr-room-tile.partial.fhr-female,
.fhr-room-tile.reserved_partial.fhr-female {
    background: linear-gradient(135deg, #fff3cd 50%, #fde2ef 50%);
    border-color: #f5b5d3;
    color: #7a1f48;
}
.fhr-room-tile.partial.fhr-neutral,
.fhr-room-tile.reserved_partial.fhr-neutral {
    background: #fff3cd;
    border-color: #ffe187;
    color: #856404;
}

/* Legend swatches for the combined states */
.fhr-legend-swatch.fhr-partial.fhr-male   { background: linear-gradient(135deg, #fff3cd 50%, #c6d9fb 50%); border: 1px solid #6f9be8; color: #15306e; }
.fhr-legend-swatch.fhr-partial.fhr-female { background: linear-gradient(135deg, #fff3cd 50%, #fde2ef 50%); border: 1px solid #f5b5d3; color: #7a1f48; }

/* Disabled (opposite-gender) tiles */
.fhr-room-tile.fhr-disabled {
    background: #f0f0f0 !important;
    border-color: #ccc !important;
    color: #888 !important;
    opacity: .55;
    cursor: not-allowed;
    position: relative;
}
.fhr-room-tile.fhr-disabled::after {
    content: '⛔';
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: .9em;
    opacity: .8;
}
.fhr-room-tile.fhr-disabled:hover {
    transform: none !important;
}


/* ── WhatsApp Channel follow button ── */
.fhr-wa-channel {
    background: #e7f7ee;
    border: 1px solid #25D366;
    border-radius: 10px;
    padding: 16px 18px;
    margin: 18px 0;
    text-align: center;
}
.fhr-wa-channel-msg {
    display: block;
    color: #075E54;
    font-weight: 600;
    font-size: .95em;
    margin-bottom: 10px;
}
.fhr-wa-channel-btn {
    display: inline-flex;
    align-items: center;
    background: #25D366;
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
    padding: 10px 22px;
    border-radius: 7px;
    font-size: .95em;
    transition: background .15s ease, transform .15s ease;
}
.fhr-wa-channel-btn:hover {
    background: #1da851;
    transform: translateY(-1px);
    color: #fff !important;
}
