/* HomiFund shared responsive styles
   NOTE: layout itself is done with Tailwind utilities in the views.
   This file only holds cross-page helpers + small-screen safety nets.
   It must never set layout on bare element selectors (main, section, ...)
   because that silently fights the utility classes. */

:root {
  --hf-surface: #f7f9fb;
  --hf-surface-low: #f2f4f6;
  --hf-surface-lowest: #ffffff;
  --hf-outline: #c5c5d3;
  --hf-primary: #00236f;
  --hf-text: #191c1e;
  --hf-text-muted: #444651;
  --hf-header-height: 64px;
  --hf-sidebar-width: 240px;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

img,
video,
canvas,
svg {
  max-width: 100%;
}

button,
a {
  touch-action: manipulation;
}

/* ---------------------------------------------------------------- tables */
.hf-table-scroll,
.table-scroll {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.hf-table-hint {
  display: none;
  margin-top: 0.5rem;
  color: var(--hf-text-muted);
  font-size: 0.75rem;
  line-height: 1rem;
}

/* -------------------------------------------------------------- steppers */
.hf-stepper-scroll {
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}

.hf-stepper-scroll::-webkit-scrollbar {
  display: none;
}

.hf-stepper-track {
  min-width: 560px;
}

/* ------------------------------------------------------- image galleries */
.hf-gallery-grid {
  display: grid;
}

/* --------------------------------------------------- small-screen tuning */
@media (max-width: 1023px) {
  /* keep any element that participates in a flex/grid row shrinkable */
  .hf-mobile-stack,
  .hf-mobile-stack > * {
    min-width: 0;
  }
}

@media (max-width: 767px) {
  .hf-table-hint {
    display: block;
  }

  .hf-stepper-track {
    min-width: 520px;
  }
}

@media (max-width: 639px) {
  .hf-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .hf-gallery-hero {
    height: 240px !important;
  }

  .hf-mobile-full,
  .hf-mobile-full > * {
    width: 100% !important;
  }

  .hf-mobile-wrap {
    flex-wrap: wrap !important;
  }
}

/* ================================================================
   Component classes the templates reference but that were never
   defined anywhere. Without these, several elements rendered with
   no background at all (e.g. white text on a white page).
   Colours are taken from the design tokens in the Tailwind config,
   and from the one inline gradient that survived in
   views/user/renter/HomiScore.ejs, so the intent is preserved.
   Any explicit Tailwind bg-* utility on the same element still wins.
   ================================================================ */

:root {
  --hf-primary-gradient: linear-gradient(135deg, #00236f 0%, #1e3a8a 100%);
}

/* --- HomiScore hero card (renter dashboard / messages / notifications) --- */
.homiscore-gradient {
  background: var(--hf-primary-gradient);
  color: #ffffff;
}

/* --- "LEVEL 4" trust badge (renters page) --- */
.verified-badge {
  background: var(--hf-primary-gradient);
  color: #ffffff;
}

/* --- translucent panels --- */
.glass-card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.glass-accordion {
  background: var(--hf-surface-lowest);
  border: 1px solid rgba(197, 197, 211, 0.7);
}

/* --- decorative section backgrounds (kept light: dark text sits on them) --- */
.hero-mesh {
  background:
    radial-gradient(60% 60% at 12% 8%, rgba(220, 225, 255, 0.75) 0%, rgba(220, 225, 255, 0) 60%),
    radial-gradient(55% 55% at 88% 12%, rgba(213, 228, 248, 0.7) 0%, rgba(213, 228, 248, 0) 60%),
    var(--hf-surface);
}

.gradient-bg {
  background: linear-gradient(135deg, rgba(220, 225, 255, 0.55) 0%, rgba(213, 228, 248, 0.55) 100%);
}

/* --- gradient headline (solid fallback so it can never render invisible) --- */
.brand-gradient-text {
  color: var(--hf-primary);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand-gradient-text {
    background: linear-gradient(90deg, #00236f 0%, #1e3a8a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

/* --- HomiScore ring around the score dial --- */
.score-ring {
  background: var(--hf-primary-gradient);
}

/* --- elevation helpers --- */
.card-shadow,
.verification-card {
  box-shadow: 0 4px 14px rgba(0, 35, 111, 0.06);
}

.soft-card-shadow,
.feature-card,
.ui-element {
  box-shadow: 0 6px 20px rgba(0, 35, 111, 0.07);
}

.login-card-shadow,
.pricing-card-shadow {
  box-shadow: 0 10px 30px rgba(0, 35, 111, 0.08);
}

/* --- role selection: the chosen card has to be visibly chosen --- */
.role-card-hover {
  background: var(--hf-surface-lowest);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.role-card-hover:hover {
  border-color: var(--hf-primary);
  box-shadow: 0 8px 24px rgba(0, 35, 111, 0.1);
}

.role-card-selected {
  border-color: var(--hf-primary) !important;
  background: rgba(220, 225, 255, 0.5);
  box-shadow: 0 0 0 2px var(--hf-primary);
}

/* --- calendar --- */
.calendar-day {
  min-height: 92px;
}

.calendar-day-muted {
  color: var(--hf-text-muted);
  background: var(--hf-surface-low);
}

.event-pill {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- form controls: use the brand navy, not the browser default blue --- */
.toggle {
  accent-color: var(--hf-primary);
  width: 2.25rem;
  height: 1.25rem;
}

.drag-drop-area {
  border: 2px dashed rgba(197, 197, 211, 0.9);
  background: var(--hf-surface-low);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.drag-drop-area:hover {
  border-color: var(--hf-primary);
  background: rgba(220, 225, 255, 0.35);
}

.focused-input:focus,
.search-focus:focus {
  outline: none;
  border-color: var(--hf-primary);
  box-shadow: 0 0 0 3px rgba(0, 35, 111, 0.12);
}

.placeholder-outline::placeholder {
  color: var(--hf-text-muted);
}

/* --- FAQ accordion: without this every answer stayed open --- */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.accordion-item.active .accordion-content {
  max-height: 40rem;
}

.accordion-item .chevron {
  transition: transform 0.3s ease;
}

.accordion-item.active .chevron {
  transform: rotate(180deg);
}

/* --- misc panels referenced by the templates --- */
.action-modal-card {
  background: var(--hf-surface-lowest);
  box-shadow: 0 20px 50px rgba(2, 6, 23, 0.18);
}

.toast {
  background: var(--hf-inverse-surface, #2d3133);
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.25);
}

.sensitive-metric {
  transition: background 0.2s ease;
}

.custom-scrollbar {
  scrollbar-width: thin;
}

.premium-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.premium-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 35, 111, 0.12);
}

.step-transition {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* --- file input is replaced by the styled "Upload photo" label next to it,
       so keep it reachable by keyboard but out of the layout --- */
.profile-photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.profile-photo-label {
  cursor: pointer;
}
