/*
 * Denver Pop Tops — application styles.
 * Airy, upbeat, professional. Mobile-first.
 */

:root {
  --bg:        #fbfbf9;
  --surface:   #ffffff;
  --ink:       #1d2733;
  --ink-soft:  #55616e;
  --muted:     #8a94a0;
  --line:      #e7e9e4;
  --brand:     #1f7a8c;   /* denver sky teal-blue */
  --brand-dk:  #16606f;
  --accent:    #f2a541;   /* warm upbeat sun */
  --danger:    #c0392b;
  --ok-bg:     #e7f4ef;
  --ok-ink:    #1a6b52;
  --alert-bg:  #fceceb;
  --alert-ink: #a5342a;
  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 1px 2px rgba(29,39,51,.04), 0 8px 24px rgba(29,39,51,.06);
  --shadow-lg: 0 12px 40px rgba(29,39,51,.12);
  --maxw:      1120px;
  --font:      ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1 0 auto; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dk); }

h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }

img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -.02em;
}
.brand:hover { color: var(--ink); }
.brand__mark { color: var(--brand); font-size: 1.3rem; line-height: 1; }
.brand__badge {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--brand-dk);
  background: var(--ok-bg);
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 4px;
}
.site-nav, .admin-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.site-nav__link, .admin-nav__link {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: .95rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.site-nav__link:hover, .admin-nav__link:hover { color: var(--ink); background: #f2f3ef; }
.site-nav__link--button, .admin-nav__link--button {
  border: 0; background: none; cursor: pointer;
  font-family: inherit;
}
form { margin: 0; }

/* ---------- Flash ---------- */
.flash { padding: 10px 0; font-weight: 600; font-size: .95rem; }
.flash--notice { background: var(--ok-bg); color: var(--ok-ink); }
.flash--alert  { background: var(--alert-bg); color: var(--alert-ink); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, #eaf4f5 0%, #fbfbf9 70%);
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--line);
}
.hero__title { font-size: clamp(1.8rem, 5vw, 2.9rem); margin: 0 0 12px; max-width: 16ch; }
.hero__subtitle { font-size: clamp(1rem, 2.5vw, 1.2rem); color: var(--ink-soft); margin: 0; max-width: 46ch; }

/* ---------- Gallery ---------- */
.gallery-section { padding: 36px 20px 64px; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 24px;
}
.property-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  color: var(--ink);
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex;
  flex-direction: column;
}
.property-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--ink); }
.property-card__media { position: relative; aspect-ratio: 4 / 3; background: #eef0ec; }
.property-card__image { width: 100%; height: 100%; object-fit: cover; }
.property-card__count {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(29,39,51,.72); color: #fff;
  font-size: .78rem; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
}
.property-card__body { padding: 14px 16px 18px; }
.property-card__address { font-size: 1.05rem; margin: 0 0 4px; }
.property-card__meta { color: var(--muted); font-size: .9rem; margin: 0; }

/* ---------- Photo placeholder ---------- */
.photo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(135deg, #eef0ec, #eef0ec 12px, #e9ebe6 12px, #e9ebe6 24px);
  aspect-ratio: 4 / 3;
}
.photo-placeholder__mark { font-size: 2.4rem; color: #b9c1b8; }

/* ---------- Property detail ---------- */
.detail { padding: 28px 20px 64px; max-width: 900px; }
.detail__back { font-weight: 600; font-size: .95rem; display: inline-block; margin-bottom: 18px; }
.detail__header { margin-bottom: 24px; }
.detail__title { font-size: clamp(1.5rem, 4vw, 2.2rem); margin: 0 0 6px; }
.detail__meta { color: var(--ink-soft); margin: 0; font-size: 1.05rem; }
.detail__gallery { display: grid; gap: 16px; margin-bottom: 28px; }
.detail__figure { margin: 0; }
.detail__image { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.detail__caption { color: var(--muted); font-size: .9rem; margin-top: 8px; }
.detail__placeholder { border-radius: var(--radius); overflow: hidden; margin-bottom: 28px; }
.detail__description { font-size: 1.08rem; color: var(--ink-soft); margin-bottom: 28px; }
.detail__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px 32px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin: 0;
}
.detail__fact dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 2px; }
.detail__fact dd { margin: 0; font-weight: 600; font-size: 1.05rem; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 64px 20px; color: var(--ink-soft); }
.empty-state__mark { font-size: 3rem; color: #c6cdc4; margin: 0 0 8px; }
.empty-state h2 { margin: 0 0 6px; color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 28px 0;
  color: var(--ink-soft);
  font-size: .92rem;
}
.site-footer p { margin: 0; }
.site-footer__muted { color: var(--muted); }

/* ---------- Admin ---------- */
.admin-header { background: var(--ink); color: #fff; }
.admin-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; flex-wrap: wrap; }
.admin-header .brand, .admin-header .brand:hover { color: #fff; }
.admin-header .brand__mark { color: var(--accent); }
.admin-header .brand__badge { background: rgba(255,255,255,.15); color: #fff; }
.admin-nav__link { color: #c9d0d8; }
.admin-nav__link:hover { color: #fff; background: rgba(255,255,255,.1); }
.admin-main { padding: 32px 0 64px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: 1.6rem; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; font-weight: 600; font-size: .95rem;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .12s ease, border-color .12s ease;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dk); color: #fff; }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: #f2f3ef; color: var(--ink); }

/* Stat grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px;
}
.stat__value { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }
.stat__label { color: var(--muted); font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* Panels + tables */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.panel__title { margin: 0 0 14px; font-size: 1.15rem; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; padding: 0 12px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table__num { text-align: right; }
.table__actions { text-align: right; white-space: nowrap; display: flex; gap: 12px; justify-content: flex-end; align-items: center; }
.link-danger { color: var(--danger); background: none; border: 0; cursor: pointer; font: inherit; font-weight: 600; padding: 0; }
.link-danger:hover { text-decoration: underline; }
.muted { color: var(--muted); }

/* Forms */
.form { max-width: 640px; }
.form__row { margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.form__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 20px; }
.form label { font-weight: 600; font-size: .92rem; }
.form input[type="text"], .form input[type="email"], .form input[type="password"], .form textarea, .form select {
  font-family: inherit; font-size: 1rem;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); width: 100%;
}
.form input:focus, .form textarea:focus, .form select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,122,140,.15);
}
.form__hint, .form__row .form__hint { color: var(--muted); font-size: .85rem; margin: 0; }
.form__actions { display: flex; gap: 10px; margin-top: 8px; }
.form__errors {
  background: var(--alert-bg); color: var(--alert-ink);
  border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 20px;
}
.form__errors ul { margin: 8px 0 0; padding-left: 18px; }
.form__warning {
  background: var(--alert-bg); color: var(--alert-ink);
  border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 20px;
  display: grid; gap: 10px; justify-items: start;
}
.form__warning p { margin: 0; }
.form__check { display: flex; align-items: center; gap: 8px; }

/* Photo manager */
.photo-manager { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.photo-manager__item { position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.photo-manager__image { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-manager__remove {
  position: absolute; top: 6px; right: 6px;
  background: rgba(255,255,255,.92); color: var(--danger);
  padding: 4px 9px; border-radius: 999px; font-size: .8rem; box-shadow: var(--shadow);
}
.photo-manager__remove:hover { text-decoration: none; background: #fff; }

/* Auth (sign-in) */
.auth-card {
  max-width: 400px; margin: 56px auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; box-shadow: var(--shadow);
}
.auth-card h1 { margin: 0 0 20px; font-size: 1.4rem; text-align: center; }
