:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #14213d;
  --brand: #005f73;
  --brand-alt: #0a9396;
  --danger: #ae2012;
  --muted: #6b7280;
  --border: #d9e2ec;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(150deg, #edf2f7 0%, #f8fafc 50%, #edf6f9 100%);
  color: var(--ink);
}

.site-header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-alt) 100%);
  color: white;
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.site-header h1 {
  margin: 0;
  font-size: 1.4rem;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.site-header a,
.link-button {
  color: white;
  text-decoration: none;
  font-weight: 600;
}

.container {
  width: min(1200px, 95vw);
  margin: 1rem auto 3rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(20, 33, 61, 0.06);
}

.card.narrow {
  max-width: 420px;
  margin-inline: auto;
}

.grid.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.house-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #eef3f7;
  border-radius: 8px;
}

.house-card-layout {
  display: flex;
  gap: 1rem;
}

.house-card-details,
.house-card-media {
  width: 50%;
}

.house-card-details h3 {
  margin-top: 0;
}

.house-card-media {
  min-height: 300px;
  display: flex;
  align-items: stretch;
}

.house-image-placeholder {
  width: 100%;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-weight: 600;
}

.actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  align-items: center;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

legend {
  padding: 0 0.4rem;
  font-weight: 700;
}

label {
  display: grid;
  gap: 0.35rem;
}

/* Keep checkbox questions aligned in a single row. */
label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

input,
textarea,
select,
button,
.button,
.link-button {
  font: inherit;
}

input,
textarea,
select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  width: 100%;
}

input[type="checkbox"] {
  width: auto;
  margin-right: 0;
}

button,
.button {
  border: none;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  background: var(--brand);
  color: white;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  display: inline-block;
}

button.secondary,
.button.secondary {
  background: #64748b;
}

button.danger {
  background: var(--danger);
}

.inline-form {
  margin: 0;
}

.link-button {
  background: transparent;
  padding: 0;
}

.form-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.flash-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.flash {
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  margin-bottom: 0.5rem;
}

.flash.success {
  background: #dcfce7;
  color: #166534;
}

.flash.error {
  background: #fee2e2;
  color: #991b1b;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.readiness-table td:nth-child(2),
.readiness-table td:nth-child(3),
.readiness-table td:nth-child(4) {
  text-align: center;
}

.readiness-table textarea {
  min-width: 220px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 0.6rem 0.5rem;
  vertical-align: top;
}

th {
  background: #f8fafc;
}

@media (max-width: 700px) {
  .house-card-layout {
    flex-direction: column-reverse;
  }

  .house-card-details,
  .house-card-media {
    width: 100%;
  }

  .house-card-media {
    min-height: 220px;
  }

  th:nth-child(4),
  td:nth-child(4),
  th:nth-child(5),
  td:nth-child(5),
  th:nth-child(6),
  td:nth-child(6) {
    display: none;
  }
}
