/* Shared design system for the Hostel module (public + student-facing pages).
   Teal -> Emerald gradient ("home/building" feel), distinct from Mess
   (orange-red) and Library (indigo-blue-purple). Mirrors mess.css structure
   with a hostel- prefix. */

:root {
  --hostel-teal: #0d9488;
  --hostel-primary: #0f766e;
  --hostel-emerald: #059669;
  --hostel-amber: #d97706;
  --hostel-red: #dc2626;
  --hostel-ink: #0b2b28;
  --hostel-muted: #7a938f;
  --hostel-bg: #f2fbf9;
  --hostel-card-radius: 20px;
}

* { font-family: 'Inter', sans-serif; }
h1, h2, h3, h4, h5, .hostel-brand-text, .hostel-btn-primary { font-family: 'Poppins', sans-serif; }

/* ---------- Auth / registration pages ---------- */
.hostel-auth-body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: linear-gradient(135deg, #134e4a 0%, #0f766e 35%, #0d9488 70%, #059669 100%);
  background-attachment: fixed;
}

.hostel-auth-shell { width: 100%; max-width: 430px; }
.hostel-auth-shell.hostel-auth-wide { max-width: 760px; }

.hostel-brand-row { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 18px; }
.hostel-brand-mark {
  width: 52px; height: 52px; border-radius: 16px;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: #fff; backdrop-filter: blur(6px);
}
.hostel-brand-logo {
  width: 52px; height: 52px; border-radius: 16px; object-fit: contain;
  background: rgba(255,255,255,.9); border: 1px solid rgba(255,255,255,.35);
  padding: 4px; flex-shrink: 0;
}
.hostel-brand-text { color: #fff; font-weight: 800; font-size: 1.4rem; letter-spacing: .04em; line-height: 1.1; text-align: left; }
.hostel-brand-text small { display: block; font-size: .65rem; font-weight: 600; letter-spacing: .14em; color: rgba(255,255,255,.75); }

.hostel-auth-card {
  background: #fff;
  border-radius: var(--hostel-card-radius);
  padding: clamp(24px, 4vw, 36px);
  box-shadow: 0 24px 60px rgba(10,60,55,.35);
  animation: hostelPop .35s ease-out;
}
@keyframes hostelPop { 0% { opacity: 0; transform: scale(.96); } 100% { opacity: 1; transform: scale(1); } }

.hostel-input-icon { position: relative; }
.hostel-input-icon > i:first-child { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--hostel-primary); z-index: 2; }
.hostel-input-icon .form-control, .hostel-input-icon .form-select { padding-left: 2.4rem; border-radius: 12px; border: 1.5px solid #cdeae5; background: #f7fdfc; }
.hostel-input-icon .form-control:focus, .hostel-input-icon .form-select:focus { border-color: var(--hostel-primary); box-shadow: 0 0 0 4px rgba(15,118,110,.12); background: #fff; }
.hostel-input-icon input[type="password"], .hostel-input-icon input[type="text"].hostel-password-revealed { padding-right: 2.4rem; }
.hostel-input-icon .password-toggle-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%); z-index: 2;
  border: none; background: none; color: #7a938f; padding: .2rem; line-height: 1; cursor: pointer;
}
.hostel-input-icon .password-toggle-btn:hover { color: var(--hostel-primary); }

.hostel-btn-primary {
  background: linear-gradient(120deg, var(--hostel-teal), var(--hostel-primary) 55%, var(--hostel-emerald));
  background-size: 200% 200%;
  border: none; color: #fff; font-weight: 700;
  padding: .75rem 1rem; border-radius: 12px;
  box-shadow: 0 10px 24px rgba(15,118,110,.35);
  transition: transform .15s, box-shadow .15s, background-position .4s;
}
.hostel-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(15,118,110,.45); background-position: 100% 0; color: #fff; }
.hostel-btn-primary:disabled { opacity: .7; transform: none; cursor: not-allowed; }

.hostel-link { color: var(--hostel-primary); text-decoration: none; font-weight: 600; font-size: .9rem; }
.hostel-link:hover { text-decoration: underline; color: var(--hostel-emerald); }

.hostel-req { color: #ef4444; }

/* ---------- App shell (header + bottom nav + content) ---------- */
body.hostel-app-body {
  background: var(--hostel-bg);
  min-height: 100vh;
  margin: 0;
  padding-bottom: 90px;
}

.hostel-card {
  background: #fff; border-radius: var(--hostel-card-radius);
  box-shadow: 0 8px 24px rgba(10,60,55,.08); border: 1px solid rgba(10,60,55,.05);
}

.hostel-app-header {
  background: linear-gradient(120deg, var(--hostel-teal), var(--hostel-primary) 60%, var(--hostel-emerald));
  color: #fff;
  padding: 14px 16px 20px;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 10px 28px rgba(15,118,110,.28);
  position: sticky; top: 0; z-index: 1030;
}
.hostel-header-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hostel-profile-link { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.hostel-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: 'Poppins', sans-serif;
}
.hostel-header-icons { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.hostel-header-icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; text-decoration: none; transition: background .15s;
}
.hostel-header-icon-btn:hover { background: rgba(255,255,255,.3); color: #fff; }
.hostel-header-icon-badge {
  position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--hostel-red); color: #fff;
  font-size: .62rem; font-weight: 800; line-height: 17px; text-align: center;
  box-shadow: 0 0 0 2px var(--hostel-primary);
}
.hostel-profile-link .hostel-greet-name { font-weight: 700; font-family: 'Poppins', sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.hostel-profile-link .hostel-greet-sub { font-size: .68rem; opacity: .8; }
.hostel-back-link { color: #fff; text-decoration: none; font-size: 1.3rem; }
.hostel-header-title { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 1.1rem; }

.hostel-app-content { max-width: 720px; margin: 0 auto; padding: 16px; }

.hostel-bottom-nav {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1050;
  background: rgba(255,255,255,.88); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 14px 36px rgba(10,60,55,.2);
  display: flex; gap: 4px; border-radius: 22px; padding: 6px;
  border: 1px solid rgba(205,234,229,.8);
}
.hostel-bottom-nav-link {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  padding: .5rem 0; color: #7a938f; text-decoration: none; font-size: .64rem; font-weight: 700;
  border-radius: 16px; transition: color .2s, background .2s, box-shadow .2s;
}
.hostel-bottom-nav-link i { font-size: 1.25rem; transition: transform .2s; }
.hostel-bottom-nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, var(--hostel-teal), var(--hostel-primary));
  box-shadow: 0 8px 18px rgba(15,118,110,.35);
}
.hostel-bottom-nav-link.active i { transform: translateY(-1px) scale(1.08); }
.hostel-bottom-nav-link:not(.active):hover { color: var(--hostel-primary); background: var(--hostel-bg); }

/* ---------- Home dashboard stat cards ---------- */
.hostel-stat-grid { margin-top: 12px; }
.hostel-stat-card {
  background: #fff; border-radius: 16px; padding: 14px; box-shadow: 0 6px 18px rgba(10,60,55,.08);
  height: 100%;
}
.hostel-stat-icon {
  width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: rgba(13,148,136,.12); color: var(--hostel-primary); font-size: 1.1rem; margin-bottom: 8px;
}
.hostel-stat-value { font-weight: 700; font-size: 1.1rem; color: var(--hostel-ink); }
.hostel-stat-label { font-size: .75rem; color: var(--hostel-muted); }

/* ---------- Fee alert hero card ---------- */
.hostel-fee-alert-card {
  position: relative; overflow: hidden;
  border-radius: var(--hostel-card-radius);
  background: linear-gradient(120deg, var(--hostel-primary), var(--hostel-teal));
  color: #fff;
  padding: 18px;
  display: flex; align-items: center; gap: 16px;
}
.hostel-fee-alert-card.is-overdue { background: linear-gradient(120deg, #b91c1c, var(--hostel-red)); }
.hostel-fee-alert-blob {
  position: absolute; right: -30px; top: -30px; width: 130px; height: 130px;
  border-radius: 50%; background: rgba(255,255,255,.12);
}
.hostel-fee-alert-number-wrap { text-align: center; position: relative; z-index: 1; min-width: 64px; }
.hostel-fee-alert-number { font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 1.9rem; line-height: 1; }
.hostel-fee-alert-label { font-size: .65rem; opacity: .85; }
.hostel-fee-alert-body { position: relative; z-index: 1; flex: 1; min-width: 0; }
.hostel-fee-alert-sub { font-size: .8rem; opacity: .9; }
.hostel-fee-alert-progress { height: 6px; border-radius: 999px; background: rgba(255,255,255,.25); margin: 6px 0; overflow: hidden; }
.hostel-fee-alert-progress-bar { height: 100%; border-radius: 999px; background: #fff; }

/* ---------- Profile page (mirrors mess-profile-hero / mess-info-row) ---------- */
.hostel-profile-hero {
  position: relative; overflow: hidden; text-align: center; border-radius: 22px; padding: 30px 20px;
  background: linear-gradient(135deg, var(--hostel-teal), var(--hostel-primary) 55%, var(--hostel-emerald));
  color: #fff; box-shadow: 0 14px 34px rgba(15,118,110,.3);
}
.hostel-profile-hero-blob { position: absolute; border-radius: 50%; background: rgba(255,255,255,.12); }
.hostel-profile-hero-blob-1 { width: 130px; height: 130px; top: -50px; right: -30px; }
.hostel-profile-hero-blob-2 { width: 90px; height: 90px; bottom: -40px; left: -20px; background: rgba(0,0,0,.08); }
.hostel-profile-hero-avatar {
  position: relative; width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 10px;
  background: rgba(255,255,255,.22); border: 2px solid rgba(255,255,255,.55);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; font-weight: 800; font-family: 'Poppins', sans-serif;
}
.hostel-profile-status-pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700;
  padding: .3rem .7rem; border-radius: 999px; background: rgba(255,255,255,.18); color: #fff;
}
.hostel-profile-status-pill i { font-size: .5rem; color: #f1f5f9; }
.hostel-profile-status-pill.is-active i { color: #4ade80; }

.hostel-info-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eef5f4; }
.hostel-info-row:last-child { border-bottom: none; padding-bottom: 2px; }
.hostel-info-icon {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: var(--hostel-bg); color: var(--hostel-primary); box-shadow: inset 0 0 0 1.5px #cdeae5;
  display: flex; align-items: center; justify-content: center;
}
.hostel-info-label { font-size: .68rem; color: var(--hostel-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.hostel-info-value { font-weight: 700; color: var(--hostel-ink); }

.hostel-payment-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--hostel-bg); border-radius: 14px; padding: 10px 14px;
}
.hostel-payment-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: #fff; color: var(--hostel-primary); box-shadow: inset 0 0 0 1.5px #cdeae5;
  display: flex; align-items: center; justify-content: center;
}
.hostel-pay-status { font-size: .72rem; font-weight: 700; padding: .3rem .65rem; border-radius: 999px; white-space: nowrap; }
.hostel-pay-status-pending { background: #fef3c7; color: #92400e; }
.hostel-pay-status-paid { background: #dcfce7; color: #15803d; }
.hostel-pay-status-failed { background: #fee2e2; color: #b91c1c; }
.hostel-pay-status-refunded { background: #f1f5f9; color: #475569; }

/* ---------- Hostel Rules ---------- */
.hostel-rule-row {
  display: flex; align-items: flex-start; gap: 12px;
  border-radius: 14px; padding: 10px 14px;
}
.hostel-rule-num {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  color: #fff; font-size: .85rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,.18);
}
.hostel-rule-text { font-size: .85rem; color: var(--hostel-ink); line-height: 1.5; padding-top: 2px; }

/* Cycles the same 6-hue palette used by the complaint category icons, so
   each rule reads with its own identity instead of one repeated color. */
.hostel-rule-row:nth-of-type(6n+1) .hostel-rule-num { background: linear-gradient(135deg, var(--hostel-teal), var(--hostel-primary)); }
.hostel-rule-row:nth-of-type(6n+2) .hostel-rule-num { background: linear-gradient(135deg, #f59e0b, #d97706); }
.hostel-rule-row:nth-of-type(6n+3) .hostel-rule-num { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.hostel-rule-row:nth-of-type(6n+4) .hostel-rule-num { background: linear-gradient(135deg, #a855f7, #7e22ce); }
.hostel-rule-row:nth-of-type(6n+5) .hostel-rule-num { background: linear-gradient(135deg, #6366f1, #4338ca); }
.hostel-rule-row:nth-of-type(6n+0) .hostel-rule-num { background: linear-gradient(135deg, #f43f5e, #be123c); }

/* ---------- Complaint category icon badges ---------- */
.hostel-category-icon {
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.1rem;
  box-shadow: 0 6px 14px rgba(0,0,0,.14);
}
.hostel-category-room { background: linear-gradient(135deg, var(--hostel-teal), var(--hostel-primary)); }
.hostel-category-electricity { background: linear-gradient(135deg, #f59e0b, #d97706); }
.hostel-category-water { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.hostel-category-cleaning { background: linear-gradient(135deg, #a855f7, #7e22ce); }
.hostel-category-wifi { background: linear-gradient(135deg, #6366f1, #4338ca); }
.hostel-category-other { background: linear-gradient(135deg, #64748b, #475569); }

.hostel-status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; font-weight: 700; padding: .32rem .65rem; border-radius: 999px; white-space: nowrap; }
.hostel-status-pending { background: #fef3c7; color: #92400e; }
.hostel-status-in_progress { background: #dbeafe; color: #1d4ed8; }
.hostel-status-resolved { background: #dcfce7; color: #15803d; }

/* ---------- Complaint form: category chips, photo, voice (mirrors mess's complaint-* classes) ---------- */
.hostel-category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hostel-category-chip {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px;
  border-radius: 12px; border: 1.5px solid #cdeae5; background: #f7fdfc; color: var(--hostel-ink);
  font-size: .68rem; font-weight: 600; text-align: center; line-height: 1.15;
  transition: border-color .15s, background .15s, color .15s;
}
.hostel-category-chip i { font-size: 1.05rem; color: var(--hostel-primary); }
.hostel-category-chip:hover { border-color: var(--hostel-primary); }
.hostel-category-chip.active {
  background: linear-gradient(120deg, var(--hostel-teal), var(--hostel-primary) 60%, var(--hostel-emerald));
  border-color: transparent; color: #fff;
}
.hostel-category-chip.active i { color: #fff; }

.hostel-photo-dropzone {
  border: 2px dashed #cdeae5; border-radius: 16px; background: #f7fdfc;
  min-height: 100px; display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--hostel-muted); cursor: pointer; overflow: hidden;
  transition: border-color .15s, background .15s;
}
.hostel-photo-dropzone:hover { border-color: var(--hostel-primary); background: #fff; }
.hostel-photo-dropzone img { max-width: 100%; max-height: 180px; display: block; }
.hostel-photo-thumb { max-height: 130px; border-radius: 12px; border: 1px solid #cdeae5; display: block; }

.hostel-complaint-reply {
  background: var(--hostel-bg); border-radius: 12px; padding: 10px 12px; font-size: .85rem;
  border-left: 3px solid var(--hostel-primary); margin-top: 6px;
}

.hostel-record-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px; border-radius: 14px; border: 1.5px dashed #cdeae5;
  background: #f7fdfc; color: var(--hostel-primary); font-weight: 700; font-size: .85rem;
  transition: border-color .15s, background .15s;
}
.hostel-record-btn:hover { border-color: var(--hostel-primary); }
.hostel-record-btn.recording {
  border-style: solid; border-color: var(--hostel-red); background: #fef2f2; color: var(--hostel-red);
  animation: hostelRecordPulse 1.4s ease-in-out infinite;
}
@keyframes hostelRecordPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.25); } 50% { box-shadow: 0 0 0 8px rgba(220,38,38,0); } }
.hostel-audio-preview { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.hostel-audio-preview audio { flex: 1; height: 36px; }

/* ---------- Room type / room picker cards (mirrors mess-pick-card) ---------- */
.hostel-pick-card {
  background: #fff; border: 2px solid #cdeae5; border-radius: 16px;
  padding: 16px; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s;
  height: 100%;
}
.hostel-pick-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,118,110,.12); }
.hostel-pick-card.selected { border-color: var(--hostel-primary); background: #f0fdfa; box-shadow: 0 10px 24px rgba(15,118,110,.18); }
.hostel-pick-card.disabled { opacity: .5; cursor: not-allowed; }
.hostel-pick-card .hostel-pick-check { display: none; color: var(--hostel-primary); }
.hostel-pick-card.selected .hostel-pick-check { display: inline; }
.hostel-step-title { font-weight: 700; font-size: 1rem; margin: 22px 0 12px; display: flex; align-items: center; gap: 8px; }
.hostel-step-title .badge { background: var(--hostel-primary); }
.hostel-price-tag { font-size: 1.5rem; font-weight: 800; color: var(--hostel-primary); }
.hostel-summary-bar {
  position: sticky; bottom: 0; background: #fff; border-radius: 16px;
  box-shadow: 0 -8px 30px rgba(10,60,55,.12); padding: 16px 20px; margin-top: 24px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.hostel-room-type-card {
  border-radius: 18px; background: #fff; box-shadow: 0 8px 24px rgba(15,118,110,.08);
  padding: 16px; height: 100%; display: flex; flex-direction: column; gap: 10px;
}
.hostel-room-type-card .price { font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 1.4rem; color: var(--hostel-primary); }

.hostel-list-link {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px;
  text-decoration: none; color: var(--hostel-ink); border-bottom: 1px solid #eef5f4;
}
.hostel-list-link:last-child { border-bottom: none; }
.hostel-list-link .icon {
  width: 38px; height: 38px; border-radius: 11px; background: rgba(13,148,136,.12);
  color: var(--hostel-primary); display: flex; align-items: center; justify-content: center;
}

/* ---------- Expiry-warning modals (mirrors mess-expiry-modal-icon) ---------- */
.hostel-expiry-modal-icon {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--hostel-teal), var(--hostel-primary));
  color: #fff; font-size: 1.5rem; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 22px rgba(15,118,110,.3);
}
.hostel-expiry-modal-icon-urgent { background: linear-gradient(135deg, #f59e0b, #dc2626); box-shadow: 0 10px 22px rgba(220,38,38,.3); }

/* ---------- Success / confirmation modal (mirrors mess-success-modal) ---------- */
.hostel-success-modal { border: none; border-radius: 24px; overflow: hidden; }
.hostel-success-banner {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--hostel-teal), var(--hostel-primary) 55%, var(--hostel-emerald));
  color: #fff; text-align: center; padding: 34px 20px 42px;
}
.hostel-success-blob { position: absolute; border-radius: 50%; background: rgba(255,255,255,.14); }
.hostel-success-blob-1 { width: 140px; height: 140px; top: -60px; right: -40px; }
.hostel-success-blob-2 { width: 90px; height: 90px; bottom: -40px; left: -20px; background: rgba(5,150,105,.25); }
.hostel-success-check {
  position: relative; width: 64px; height: 64px; border-radius: 50%; background: #fff; color: var(--hostel-primary);
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
  margin: 0 auto 14px; box-shadow: 0 10px 24px rgba(0,0,0,.18);
}
.hostel-success-info { display: flex; flex-direction: column; gap: 10px; }
.hostel-success-row {
  display: flex; align-items: center; gap: 12px; background: var(--hostel-bg);
  border-radius: 14px; padding: 10px 14px;
}
.hostel-success-text small { display: block; color: var(--hostel-muted); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.hostel-success-text strong { font-size: 1rem; color: var(--hostel-ink); word-break: break-all; }
.hostel-success-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.15rem;
}
.hostel-success-icon-teal { background: linear-gradient(135deg, var(--hostel-teal), var(--hostel-primary)); }
.hostel-success-icon-red { background: linear-gradient(135deg, var(--hostel-primary), var(--hostel-red)); }
.hostel-success-icon-green { background: linear-gradient(135deg, var(--hostel-emerald), var(--hostel-teal)); }

::placeholder { color: #a9c4bf; opacity: 1; }
