:root {
  --dark: #071b34;
  --text: #10233f;
  --muted: #667085;
  --border: #dbe7f1;
  --cyan: #12c4d6;
  --blue: #078bd3;
  --bg: #f4f8fb;
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at top left, rgba(18, 196, 214, 0.1), transparent 30%),
    linear-gradient(180deg, #f8fcff 0%, #eef5fa 100%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  width: min(1180px, calc(100% - 36px));
  margin: 18px auto 0;
  height: 74px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(12, 35, 64, 0.08);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(7, 27, 52, 0.07);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: sticky;
  top: 14px;
  z-index: 50;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--dark);
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.brand span {
  width: 40px;
  height: 40px;
  border-radius: 15px;
  color: white;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  display: grid;
  place-items: center;
  font-size: 14px;
  letter-spacing: 0;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-header nav a {
  color: var(--muted);
  font-weight: 850;
}

.site-header nav a:hover {
  color: var(--blue);
}

.nav-btn,
.primary-link {
  color: white !important;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-radius: 15px;
  padding: 12px 16px;
  font-weight: 950;
  box-shadow: 0 16px 34px rgba(7, 139, 211, 0.2);
}

main {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  min-height: 680px;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 36px;
  align-items: center;
  padding: 80px 0 56px;
}

.eyebrow {
  margin: 0;
  color: var(--blue);
  font-weight: 950;
  letter-spacing: -0.02em;
}

.hero h1,
.page-hero h1 {
  margin: 14px 0 0;
  color: var(--dark);
  font-size: clamp(46px, 7vw, 86px);
  line-height: 0.9;
  letter-spacing: -0.085em;
}

.hero-text,
.page-hero p,
.listing-preview-section p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
  font-weight: 750;
  max-width: 720px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-link,
.secondary-link {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.secondary-link {
  color: var(--dark);
  background: white;
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 12px 16px;
  font-weight: 950;
}

.hero-card {
  border-radius: 34px;
  padding: 26px;
  color: white;
  background:
    radial-gradient(circle at top right, rgba(18, 196, 214, 0.32), transparent 36%),
    linear-gradient(135deg, #071b34, #0b426d);
  box-shadow: 0 28px 80px rgba(7, 27, 52, 0.18);
}

.hero-card-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}

.hero-card-top span {
  color: #9eefff;
  font-weight: 950;
}

.hero-card-top strong {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 8px 11px;
}

.hero-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.hero-stat-grid div {
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  padding: 18px;
}

.hero-stat-grid strong {
  display: block;
  font-size: 42px;
  letter-spacing: -0.06em;
}

.hero-stat-grid span {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.hero-progress {
  height: 12px;
  border-radius: 999px;
  margin-top: 22px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.hero-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--cyan), #59e2ff);
}

.section {
  padding: 40px 0 80px;
}

.section-head {
  margin-bottom: 26px;
}

.section-head p {
  margin: 0;
  color: var(--blue);
  font-weight: 950;
}

.section-head h2,
.listing-preview-section h2 {
  margin: 8px 0 0;
  color: var(--dark);
  font-size: clamp(36px, 5vw, 58px);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature-grid article {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(12, 35, 64, 0.08);
  border-radius: 26px;
  padding: 24px;
  box-shadow: 0 18px 45px rgba(7, 27, 52, 0.06);
}

.feature-grid article span {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  font-weight: 950;
  margin-bottom: 20px;
}

.feature-grid h3 {
  margin: 0 0 8px;
  color: var(--dark);
  font-size: 22px;
  letter-spacing: -0.04em;
}

.feature-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 750;
}

.listing-preview-section {
  margin: 0 0 80px;
  border-radius: 34px;
  padding: 34px;
  color: white;
  background:
    radial-gradient(circle at top right, rgba(18, 196, 214, 0.25), transparent 34%),
    linear-gradient(135deg, #071b34, #0b426d);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.listing-preview-section h2 {
  color: white;
}

.listing-preview-section p {
  color: rgba(255, 255, 255, 0.74);
}

.page-hero {
  padding: 82px 0 30px;
}

.properties-toolbar {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 14px;
  margin-bottom: 22px;
}

.properties-toolbar input,
.properties-toolbar select {
  height: 54px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 18px;
  padding: 0 16px;
  color: var(--text);
  outline: 0;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(7, 27, 52, 0.04);
}

.properties-toolbar input:focus,
.properties-toolbar select:focus,
.apply-form input:focus,
.apply-form textarea:focus {
  border-color: rgba(7, 139, 211, 0.45);
  box-shadow: 0 0 0 4px rgba(7, 139, 211, 0.08);
}

.state-box {
  background: white;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
  color: var(--muted);
  font-weight: 850;
  box-shadow: 0 18px 45px rgba(7, 27, 52, 0.05);
}

.public-property-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin: 0 0 80px;
}

.public-property-card {
  background: white;
  border: 1px solid rgba(12, 35, 64, 0.08);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(7, 27, 52, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.public-property-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 70px rgba(7, 27, 52, 0.11);
}

.public-property-image {
  position: relative;
  height: 210px;
  background:
    radial-gradient(circle at top right, rgba(18, 196, 214, 0.16), transparent 36%),
    #edf7ff;
}

.public-property-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.public-property-image > span {
  position: absolute;
  left: 14px;
  bottom: 14px;
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 950;
}

.image-placeholder,
.detail-image-placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--blue);
  font-weight: 950;
}

.public-property-content {
  padding: 22px;
}

.public-property-content h2 {
  margin: 0;
  color: var(--dark);
  font-size: 24px;
  letter-spacing: -0.05em;
}

.property-location {
  margin: 8px 0 16px;
  color: var(--muted);
  font-weight: 800;
}

.public-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-bottom: 16px;
}

.public-facts div {
  background: #f8fbfe;
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 11px;
}

.public-facts span,
.detail-facts span,
.detail-info-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  margin-bottom: 5px;
}

.public-facts strong,
.detail-facts strong,
.detail-info-grid strong {
  display: block;
  color: var(--dark);
}

.public-description {
  min-height: 78px;
  color: #4b5f78;
  line-height: 1.55;
  font-weight: 750;
}

.public-property-content a {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  color: white;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-radius: 16px;
  font-weight: 950;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
  margin: 42px 0 90px;
}

.detail-main {
  display: grid;
  gap: 20px;
}

.detail-image {
  height: 420px;
  border-radius: 34px;
  overflow: hidden;
  background: #edf7ff;
  box-shadow: 0 22px 60px rgba(7, 27, 52, 0.08);
}

.detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-card,
.apply-card {
  background: white;
  border: 1px solid rgba(12, 35, 64, 0.08);
  border-radius: 28px;
  padding: 26px;
  box-shadow: 0 18px 45px rgba(7, 27, 52, 0.06);
}

.detail-card h1 {
  margin: 10px 0 0;
  color: var(--dark);
  font-size: clamp(38px, 5vw, 62px);
  line-height: 0.94;
  letter-spacing: -0.08em;
}

.detail-address {
  color: var(--muted);
  font-weight: 850;
  margin: 14px 0 20px;
}

.detail-facts,
.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
}

.detail-facts div,
.detail-info-grid div {
  background: #f8fbfe;
  border: 1px solid var(--border);
  border-radius: 17px;
  padding: 14px;
}

.detail-card h2,
.apply-card h2 {
  margin: 0 0 12px;
  color: var(--dark);
  font-size: 30px;
  letter-spacing: -0.055em;
}

.detail-text {
  color: #4b5f78;
  line-height: 1.7;
  font-weight: 750;
}

.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

.feature-tags span {
  background: #edf7ff;
  color: var(--blue);
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 950;
}

.apply-card {
  position: sticky;
  top: 110px;
}

.apply-card > div > span {
  display: block;
  color: var(--muted);
  line-height: 1.55;
  font-weight: 750;
}

.apply-form {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.apply-form label {
  display: grid;
  gap: 7px;
  color: var(--dark);
  font-weight: 900;
  font-size: 13px;
}

.apply-form input,
.apply-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: #f8fbfe;
  border-radius: 15px;
  padding: 13px 14px;
  outline: 0;
  color: var(--text);
  font-weight: 800;
}

.apply-form button {
  min-height: 52px;
  border: 0;
  border-radius: 17px;
  color: white;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 18px 34px rgba(7, 139, 211, 0.2);
}

.apply-form button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.success-box {
  background: #e6f8ef;
  border: 1px solid rgba(22, 134, 83, 0.16);
  border-radius: 20px;
  padding: 18px;
  color: #168653;
}

.success-box h3 {
  margin: 0 0 6px;
}

.success-box p {
  margin: 0;
  font-weight: 800;
}

footer {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto 22px;
  padding: 24px 0;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--border);
}

footer strong {
  color: var(--dark);
}

@media (max-width: 980px) {
  .site-header {
    height: auto;
    padding: 14px;
    flex-direction: column;
    align-items: flex-start;
  }

  .site-header nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 56px;
  }

  .feature-grid,
  .public-property-grid {
    grid-template-columns: 1fr;
  }

  .listing-preview-section {
    flex-direction: column;
    align-items: flex-start;
  }

  .properties-toolbar {
    grid-template-columns: 1fr;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .apply-card {
    position: static;
  }

  .detail-image {
    height: 280px;
  }

  .detail-facts,
  .detail-info-grid,
  .public-facts {
    grid-template-columns: 1fr;
  }

  footer {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  main,
  .site-header,
  footer {
    width: min(100% - 24px, 1180px);
  }

  .brand {
    font-size: 20px;
  }

  .site-header nav a {
    white-space: nowrap;
  }

  .hero h1,
  .page-hero h1 {
    font-size: 48px;
  }

  .hero-stat-grid {
    grid-template-columns: 1fr;
  }

  .detail-card,
  .apply-card,
  .listing-preview-section {
    padding: 22px;
    border-radius: 24px;
  }
}

/* =========================================================
   PUBLIC PROPERTY DETAIL GALLERY
========================================================= */

.detail-gallery {
  display: grid;
  gap: 14px;
}

.gallery-main-image {
  position: relative;
  height: 460px;
  border-radius: 34px;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(18, 196, 214, 0.16), transparent 36%),
    #edf7ff;
  box-shadow: 0 22px 60px rgba(7, 27, 52, 0.08);
}

.gallery-main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-count {
  position: absolute;
  right: 18px;
  bottom: 18px;
  min-width: 70px;
  height: 40px;
  border-radius: 999px;
  color: var(--dark);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(12, 35, 64, 0.08);
  backdrop-filter: blur(16px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 950;
  box-shadow: 0 12px 30px rgba(7, 27, 52, 0.12);
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.gallery-thumb {
  height: 92px;
  border: 2px solid transparent;
  background: white;
  border-radius: 18px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(7, 27, 52, 0.06);
  opacity: 0.72;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.gallery-thumb:hover,
.gallery-thumb.active {
  opacity: 1;
  transform: translateY(-2px);
  border-color: var(--blue);
  box-shadow: 0 16px 34px rgba(7, 139, 211, 0.14);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* alte detail-image bleibt kompatibel, wird aber von neuer Galerie ersetzt */
.detail-image {
  display: none;
}

@media (max-width: 980px) {
  .gallery-main-image {
    height: 360px;
    border-radius: 28px;
  }

  .gallery-thumbs {
    grid-template-columns: repeat(4, 1fr);
  }

  .gallery-thumb {
    height: 82px;
  }
}

@media (max-width: 560px) {
  .gallery-main-image {
    height: 270px;
    border-radius: 24px;
  }

  .gallery-thumbs {
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
  }

  .gallery-thumb {
    height: 74px;
    border-radius: 14px;
  }

  .gallery-count {
    right: 12px;
    bottom: 12px;
    height: 36px;
    min-width: 62px;
    font-size: 13px;
  }
}

/* =========================================================
   DETAIL PAGE LAYOUT FIX - PROFESSIONAL REAL ESTATE VIEW
========================================================= */

.detail-layout {
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 34px;
  align-items: start;
  margin-top: 42px;
}

.detail-main {
  min-width: 0;
}

.apply-card {
  width: 100%;
  max-width: 390px;
  overflow: hidden;
}

.detail-gallery {
  width: 100%;
  max-width: 100%;
}

.gallery-main-image {
  width: 100%;
  height: 520px;
  border-radius: 34px;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(18, 196, 214, 0.14), transparent 34%),
    #edf7ff;
}

.gallery-main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.gallery-thumbs {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.gallery-thumb {
  height: 92px;
}

/* Bewerbungsbox schöner und kompakter */
.apply-card {
  border-radius: 30px;
  padding: 24px;
  position: sticky;
  top: 110px;
}

.apply-card h2 {
  font-size: 31px;
  line-height: 1.05;
  margin-bottom: 14px;
}

.apply-card > div > span {
  font-size: 15px;
}

.apply-form {
  gap: 11px;
}

.apply-form label {
  gap: 6px;
}

.apply-form input,
.apply-form textarea {
  min-height: 46px;
  padding: 12px 14px;
}

.apply-form textarea {
  min-height: 105px;
}

/* Header nicht zu breit auf Desktop */
.site-header {
  max-width: 1180px;
}

/* Bei sehr breiten Screens bleibt alles sauber mittig */
main {
  max-width: 1180px;
}

/* Große Bilder nicht über die Seite laufen lassen */
.detail-card,
.detail-gallery,
.gallery-main-image {
  max-width: 100%;
}

/* Falls Bild extrem groß/Logo ist, nicht komplett übertreiben */
.gallery-main-image.contain-mode img {
  object-fit: contain;
  background: #071b34;
}

@media (max-width: 1100px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .apply-card {
    position: static;
    max-width: none;
  }

  .gallery-main-image {
    height: 430px;
  }
}

@media (max-width: 720px) {
  .detail-layout {
    margin-top: 26px;
    gap: 20px;
  }

  .gallery-main-image {
    height: 300px;
    border-radius: 24px;
  }

  .gallery-thumbs {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery-thumb {
    height: 76px;
  }

  .apply-card {
    padding: 22px;
    border-radius: 24px;
  }

  .apply-card h2 {
    font-size: 28px;
  }
}

@media (max-width: 460px) {
  .gallery-main-image {
    height: 245px;
  }

  .gallery-thumbs {
    grid-template-columns: repeat(2, 1fr);
  }
}

.success-upload-link {
  margin-top: 14px;
  min-height: 48px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white !important;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-radius: 15px;
  font-weight: 950;
  box-shadow: 0 16px 34px rgba(7, 139, 211, 0.2);
}

.success-box p {
  line-height: 1.55;
}
