/* =========================================================================
   HOME / RESIDENT DASHBOARD — page-specific styles
   ========================================================================= */

/* ---------- HERO ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(1100px 620px at 82% -10%, #1B3A55 0%, var(--ink-950) 55%);
  color: var(--paper-0);
  padding: var(--sp-9) 0 var(--sp-8);
}
.hero__grid-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.7;
}
.hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--sp-8);
  align-items: center;
}
.hero__eyebrow { color: var(--brass-300); }
.hero__eyebrow::before { background: var(--brass-300); }
.hero__title {
  color: var(--paper-0);
  font-size: clamp(42px, 5.6vw, 72px);
  margin-top: var(--sp-4);
  max-width: 640px;
}
.hero__title em {
  font-style: italic;
  color: var(--brass-300);
}
.hero__tagline {
  margin-top: var(--sp-4);
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--ink-200);
  max-width: 480px;
  line-height: 1.6;
}
.hero__cta-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-top: var(--sp-6);
  flex-wrap: wrap;
}
.hero__meta {
  display: flex;
  gap: var(--sp-6);
  flex-wrap: wrap;
  margin-top: var(--sp-7);
  padding-top: var(--sp-6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 560px;
}
.hero__meta-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--ink-200);
}
.hero__meta-item svg { width: 17px; height: 17px; color: var(--brass-300); flex-shrink: 0; }

/* -- portrait card -- */
.hero__portrait-card {
  position: relative;
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
  border-radius: var(--r-lg);
  border: 1px solid rgba(223, 192, 128, 0.22);
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(8px);
  text-align: center;
  overflow: hidden;
}
.hero__portrait-card .blueprint-grid--dark {
  position: absolute;
  inset: -20%;
  mask-image: radial-gradient(circle at center, black 30%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 72%);
}
.hero__portrait-content { position: relative; z-index: 1; }
.hero__greeting { font-size: 13px; color: var(--ink-200); }
.hero__resident-name {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--paper-0);
  margin-top: 2px;
}
.hero__resident-flat {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--brass-300);
  margin-top: 4px;
  text-transform: uppercase;
}

.avatar-frame {
  position: relative;
  width: 172px;
  height: 172px;
  margin: var(--sp-6) auto var(--sp-4);
}
.avatar-frame__ring {
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--brass-300), transparent 25%, var(--brass-500) 55%, transparent 85%, var(--brass-300));
  filter: blur(9px);
  opacity: 0.85;
  animation: rotateGlow 9s linear infinite;
}
@keyframes rotateGlow { to { transform: rotate(360deg); } }
.avatar-frame__photo-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-lg);
  background: var(--ink-800);
}
.avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
  clip-path: inset(0 100% 0 0);
  animation: photoWipe 1.2s var(--ease-out) forwards;
  animation-delay: 0.5s;
}
@keyframes photoWipe {
  to { clip-path: inset(0 0 0 0); opacity: 1; }
}
.hero__portrait-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-200);
}
.hero__portrait-foot svg { width: 14px; height: 14px; color: var(--sage-100); }

@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__portrait-card { max-width: 340px; margin: 0 auto; }
}

/* ---------- STATS ---------- */
.stats { padding: var(--sp-7) 0 var(--sp-8); background: var(--paper-0); }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}
.stat-card {
  position: relative;
  padding: var(--sp-6) var(--sp-5);
  border-radius: var(--r-md);
  border: 1px solid var(--paper-100);
  background: var(--paper-0);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.stat-card::before,
.stat-card::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-top: 1.5px solid var(--brass-300);
  border-right: 1.5px solid var(--brass-300);
  top: 14px;
  right: 14px;
  opacity: 0.6;
}
.stat-card::after {
  top: auto; right: auto; bottom: 14px; left: 14px;
  border-top: none; border-right: none;
  border-bottom: 1.5px solid var(--brass-300);
  border-left: 1.5px solid var(--brass-300);
}
.stat-card__icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--paper-50);
  color: var(--ink-700);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--sp-4);
}
.stat-card__icon svg { width: 19px; height: 19px; }
.stat-card__value {
  font-family: var(--font-mono);
  font-size: clamp(30px, 3.6vw, 42px);
  font-weight: 600;
  color: var(--ink-950);
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat-card__label {
  margin-top: var(--sp-2);
  font-size: 13.5px;
  color: var(--ink-600);
}

@media (max-width: 860px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats-grid { grid-template-columns: 1fr; } }

/* ---------- SERVICES TEASER ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}
.service-card {
  padding: var(--sp-6) var(--sp-5);
  border-radius: var(--r-md);
  border: 1px solid var(--paper-100);
  background: var(--paper-0);
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--brass-300);
}
.service-card__icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--ink-950);
  color: var(--brass-300);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--sp-4);
  transition: transform var(--dur-fast) var(--ease-out);
}
.service-card__icon svg { width: 22px; height: 22px; }
.service-card:hover .service-card__icon { transform: scale(1.08) rotate(-4deg); }
.service-card h3 { font-size: 18px; margin-bottom: 6px; }
.service-card p { font-size: 13.5px; color: var(--ink-600); line-height: 1.6; }

@media (max-width: 960px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .services-grid { grid-template-columns: 1fr; } }

/* ---------- UTILITY BILLS ---------- */
.bills-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.bill-row {
  display: grid;
  grid-template-columns: 44px 1.7fr 1fr 1fr auto;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  border: 1px solid var(--paper-100);
  background: var(--paper-0);
  transition: box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.bill-row:hover { box-shadow: var(--shadow-sm); transform: translateX(3px); }
.bill-row__icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--paper-50);
  color: var(--ink-700);
  display: flex; align-items: center; justify-content: center;
}
.bill-row__icon svg { width: 20px; height: 20px; }
.bill-row__name { font-weight: 600; font-size: 15px; color: var(--ink-950); }
.bill-row__category { font-size: 12.5px; color: var(--ink-400); margin-top: 2px; }
.bill-row__amount { font-family: var(--font-mono); font-weight: 600; font-size: 15px; }
.bill-row__due-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-400); }
.bill-row__due-date { font-size: 13.5px; color: var(--ink-800); margin-top: 1px; }

@media (max-width: 760px) {
  .bill-row { grid-template-columns: 40px 1fr; grid-template-areas: "icon name" "icon amount" "icon due" "icon status"; row-gap: 6px; }
  .bill-row__icon { grid-area: icon; }
  .bill-row__name-wrap { grid-area: name; }
}

/* ---------- COLLECTIONS ---------- */
.collection-summary {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
  padding: var(--sp-5);
  border-radius: var(--r-md);
  background: var(--paper-50);
  border: 1px solid var(--paper-100);
}
.collection-summary__figures { display: flex; gap: var(--sp-6); flex-wrap: wrap; }
.collection-summary__figure .value { font-family: var(--font-mono); font-size: 22px; font-weight: 600; color: var(--ink-950); }
.collection-summary__figure .label { font-size: 12px; color: var(--ink-600); margin-top: 2px; }
.progress-bar { flex: 1; min-width: 180px; height: 10px; border-radius: var(--r-pill); background: var(--paper-100); overflow: hidden; }
.progress-bar__fill {
  height: 100%;
  width: 0%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--brass-500), var(--brass-600));
  transition: width 1.4s var(--ease-out);
}
.progress-bar__pct { font-family: var(--font-mono); font-size: 13px; color: var(--brass-600); font-weight: 600; }

/* ---------- COMMITTEE / DIRECTORY ---------- */
.committee-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}
.committee-card {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  padding: var(--sp-5);
  border-radius: var(--r-md);
  border: 1px solid var(--paper-100);
  background: var(--paper-0);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.committee-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.committee-card__avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--ink-950);
  color: var(--brass-300);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  flex-shrink: 0;
}
.committee-card__name { font-weight: 700; font-size: 15px; color: var(--ink-950); }
.committee-card__role {
  font-size: 11.5px; color: var(--brass-600);
  margin-top: 2px; font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.03em;
}
.committee-card__phone {
  margin-top: 8px; font-size: 13.5px; color: var(--ink-600);
  display: flex; align-items: center; gap: 6px;
}
.committee-card__phone a { font-family: var(--font-mono); transition: color var(--dur-fast); }
.committee-card__phone a:hover { color: var(--brass-600); }
.committee-card__phone svg { width: 14px; height: 14px; color: var(--ink-400); flex-shrink: 0; }

@media (max-width: 860px) { .committee-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .committee-grid { grid-template-columns: 1fr; } }

/* ---------- WATER SCHEDULE ---------- */
@media (max-width: 900px) { .water-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 560px) { .water-grid { grid-template-columns: repeat(2, 1fr); } }
/* .water-grid/.water-day base rules now live in main.css as a shared component */

/* ---------- COMPLAINT FORM ---------- */
.complaint-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--sp-6);
  align-items: start;
}
.form-card {
  padding: var(--sp-7);
  border-radius: var(--r-lg);
  border: 1px solid var(--paper-100);
  background: var(--paper-0);
  box-shadow: var(--shadow-sm);
}

.priority-group { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.priority-pill {
  flex: 1; min-width: 84px; height: 46px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--paper-100);
  background: var(--paper-50);
  font-size: 13.5px; font-weight: 600;
  color: var(--ink-600);
  transition: all var(--dur-fast) var(--ease-out);
}
.priority-pill:hover { border-color: var(--ink-200); }
.priority-pill[aria-pressed="true"].priority-pill--low { background: var(--sage-100); color: var(--sage-600); border-color: var(--sage-600); }
.priority-pill[aria-pressed="true"].priority-pill--medium { background: var(--steel-100); color: var(--steel-600); border-color: var(--steel-600); }
.priority-pill[aria-pressed="true"].priority-pill--high { background: var(--amber-100); color: var(--amber-600); border-color: var(--amber-600); }
.priority-pill[aria-pressed="true"].priority-pill--urgent { background: var(--rust-100); color: var(--rust-600); border-color: var(--rust-600); }

.cc-toggle {
  background: none; border: none; padding: 0;
  font-size: 13px; font-weight: 600; color: var(--brass-600);
  display: inline-flex; align-items: center; gap: 5px;
}
.cc-toggle svg { width: 14px; height: 14px; transition: transform var(--dur-fast) var(--ease-out); }
.cc-toggle[aria-expanded="true"] svg { transform: rotate(45deg); }
.cc-field { display: none; margin-top: var(--sp-3); }
.cc-field.is-visible { display: flex; animation: fieldOpen var(--dur-med) var(--ease-out); }

.form-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin-top: var(--sp-5); }
.form-foot__note { font-size: 12.5px; color: var(--ink-400); max-width: 320px; }

.process-card {
  position: relative;
  background: var(--ink-950);
  color: var(--paper-0);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  overflow: hidden;
}
.process-card .blueprint-grid--dark { position: absolute; inset: 0; }
.process-card__inner { position: relative; z-index: 1; }
.process-card h3 { color: var(--paper-0); font-size: 19px; margin-bottom: var(--sp-4); }
.process-step { display: flex; gap: var(--sp-4); padding: var(--sp-4) 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.process-step:last-of-type { border-bottom: none; }
.process-step__num { font-family: var(--font-mono); font-size: 13px; color: var(--brass-300); width: 22px; flex-shrink: 0; }
.process-step strong { display: block; font-size: 14px; color: var(--paper-0); margin-bottom: 2px; }
.process-step p { font-size: 13px; color: var(--ink-200); line-height: 1.6; }
.process-card__emergency {
  margin-top: var(--sp-5); padding-top: var(--sp-5);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex; align-items: center; gap: var(--sp-3);
}
.process-card__emergency svg { width: 20px; height: 20px; color: var(--brass-300); flex-shrink: 0; }
.process-card__emergency .label { font-size: 11.5px; color: var(--ink-200); }
.process-card__emergency .value { font-family: var(--font-mono); font-size: 15px; color: var(--paper-0); font-weight: 600; }

.ticket-success {
  display: none;
  padding: var(--sp-7);
  border-radius: var(--r-lg);
  background: var(--sage-100);
  border: 1px solid rgba(63, 102, 82, 0.25);
  text-align: center;
}
.ticket-success.is-visible { display: block; animation: successIn var(--dur-slow) var(--ease-out); }
.ticket-success__icon {
  width: 56px; height: 56px; margin: 0 auto var(--sp-4);
  border-radius: 50%; background: var(--sage-600); color: var(--paper-0);
  display: flex; align-items: center; justify-content: center;
}
.ticket-success__icon svg { width: 26px; height: 26px; }
.ticket-success h3 { font-size: 21px; }
.ticket-success p { color: var(--ink-600); margin-top: var(--sp-2); font-size: 14.5px; }
.ticket-success__id {
  font-family: var(--font-mono); font-size: 24px; font-weight: 700;
  color: var(--sage-600); margin: var(--sp-4) 0;
  letter-spacing: 0.02em;
}

@media (max-width: 900px) {
  .complaint-layout { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
}
