/* ==========================================================================
   Maros Appartments – Vir
   Design tokens: an Adriatic late-afternoon palette — deep channel blue,
   sun-bleached sand, and a warm sunset accent — kept out of the "cream +
   terracotta serif" template by leaning the base cooler (sea, not paper)
   and using terracotta only as one of the four apartment marker colours,
   never as the site-wide accent.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;1,9..144,500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  /* ---- Palette ---- */
  --sea-deep:    #0E4A5C;   /* headers, nav, footer */
  --sea-mid:     #1D7A8C;   /* links, secondary accents */
  --sky-tint:    #EEF4F3;   /* page background — cool, not cream */
  --sand:        #F1E6CE;   /* alternating section background */
  --sun:         #F0A63A;   /* primary CTA accent — Adriatic sunset gold */
  --sun-dark:    #C9862B;
  --ink:         #16292E;   /* body text */
  --ink-soft:    #4C6067;
  --line:        #D9E3E1;
  --white:       #FFFFFF;

  /* ---- Apartment marker colours (also defined per-element via inline style) ---- */
  --apt1: #6B8E4E;  /* garden — olive */
  --apt2: #1E8A96;  /* sea view — teal */
  --apt3: #1B4F72;  /* sea view — deep blue */
  --beach:#E07A5F;  /* beachfront — terracotta */

  /* ---- Type ---- */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 26px;
  --shadow-card: 0 10px 30px -12px rgba(14, 74, 92, 0.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--sky-tint);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 88px 0;
}
.section--alt { background: var(--sand); }

.section-head {
  max-width: 640px;
  margin: 0 auto 48px;
  text-align: center;
}
.section-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
.section-head p { color: var(--ink-soft); font-size: 1.05rem; }
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sea-mid);
  margin-bottom: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.98rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
}
.btn--primary {
  background: var(--sun);
  color: #2B1B03;
  box-shadow: 0 8px 20px -6px rgba(240, 166, 58, 0.6);
}
.btn--primary:hover { background: var(--sun-dark); transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.55);
}
.btn--ghost:hover { background: rgba(255,255,255,0.12); }
.btn--outline {
  background: transparent;
  color: var(--sea-deep);
  border: 1.5px solid var(--sea-deep);
  padding: 10px 20px;
}
.btn--outline:hover { background: var(--sea-deep); color: var(--white); }
.btn:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, button:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 2px;
}

/* ---------------------------------- Header ---------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 74, 92, 0.92);
  backdrop-filter: blur(8px);
  color: var(--white);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--white);
  text-decoration: none;
}
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: #BFDCE2; }

.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a {
  font-weight: 600;
  font-size: 0.94rem;
  text-decoration: none;
  color: #E4F1F1;
  opacity: 0.9;
}
.main-nav a:hover { opacity: 1; }
.nav-toggle { display: none; }

.lang-switch {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 4px;
}
.lang-switch button {
  border: none;
  background: transparent;
  color: #DCEFEF;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.04em;
}
.lang-switch button.is-active { background: var(--sun); color: #2B1B03; }

/* ---------------------------------- Hero ---------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #0E4A5C 0%, #146378 55%, #1D7A8C 100%);
  color: var(--white);
  padding: 84px 0 0;
}
.hero .container {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
  padding-bottom: 40px;
}
.hero-copy h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  color: var(--white);
}
.hero-copy p {
  font-size: 1.12rem;
  color: #D8ECEE;
  max-width: 46ch;
}
.hero-cta-row { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }

.hero-art { position: relative; }
.hero-art svg { width: 100%; height: auto; }

.wave-divider { display: block; width: 100%; line-height: 0; }
.wave-divider svg { width: 100%; height: 60px; }

/* ---------------------------------- Apartment cards ---------------------------------- */
.apt-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.apt-card {
  background: var(--white);
  border-radius: var(--radius-l);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border-top: 6px solid var(--apt-color, var(--sea-mid));
  display: flex;
  flex-direction: column;
}
.apt-card-media {
  height: 130px;
  background: linear-gradient(160deg, var(--apt-color) 0%, color-mix(in srgb, var(--apt-color) 55%, #0E4A5C) 100%);
  position: relative;
}
.apt-card-media svg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.5; }
.apt-card-body { padding: 22px 22px 26px; flex: 1; display: flex; flex-direction: column; }
.apt-swatch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--apt-color);
  margin-bottom: 10px;
}
.apt-swatch::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--apt-color);
}
.apt-card h3 { font-size: 1.2rem; margin-bottom: 2px; }
.apt-card .apt-tag { color: var(--ink-soft); font-size: 0.9rem; font-weight: 600; margin-bottom: 10px; }
.apt-card p.apt-desc { color: var(--ink-soft); font-size: 0.94rem; flex: 1; }
.apt-features { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.apt-feature {
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--sky-tint);
  border: 1px solid var(--line);
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--ink-soft);
}

/* ---------------------------------- Calendar ---------------------------------- */
.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.calendar-controls .field { display: flex; flex-direction: column; gap: 4px; }
.calendar-controls label { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.calendar-controls select {
  padding: 10px 14px;
  border-radius: var(--radius-s);
  border: 1.5px solid var(--line);
  background: var(--white);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
}
.year-stepper { display: flex; align-items: center; gap: 6px; }
.year-stepper button {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--white);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  color: var(--sea-deep);
}
.year-stepper button:hover { background: var(--sky-tint); }
.year-stepper span { min-width: 52px; text-align: center; font-weight: 700; font-family: var(--font-display); font-size: 1.05rem; }

.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-bottom: 34px;
  font-size: 0.86rem;
  color: var(--ink-soft);
  flex-wrap: wrap;
}
.legend-chip { display: inline-flex; align-items: center; gap: 7px; }
.legend-swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.legend-swatch.is-free { background: var(--white); border: 1.5px solid var(--line); }
.legend-swatch.is-booked { background: repeating-linear-gradient(45deg, var(--sea-mid), var(--sea-mid) 3px, #ffffff55 3px, #ffffff55 6px); }

.month-calendars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.mini-cal {
  background: var(--white);
  border-radius: var(--radius-m);
  padding: 16px;
  box-shadow: var(--shadow-card);
  border-top: 5px solid var(--apt-color, var(--sea-mid));
}
.mini-cal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.mini-cal-head .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--apt-color); flex-shrink: 0; }
.mini-cal-head h4 { font-size: 0.94rem; margin: 0; font-family: var(--font-body); font-weight: 700; }
.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.mini-cal-grid .dow {
  font-size: 0.62rem;
  font-weight: 700;
  text-align: center;
  color: var(--ink-soft);
  padding-bottom: 4px;
}
.mini-cal-grid .day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 6px;
  background: var(--sky-tint);
  color: var(--ink);
}
.mini-cal-grid .day.is-empty { background: transparent; }
.mini-cal-grid .day.is-booked {
  background: var(--apt-color);
  color: #fff;
  position: relative;
}
.mini-cal-grid .day.is-past { opacity: 0.45; }

/* ---------------------------------- Booking form ---------------------------------- */
.booking-panel {
  background: var(--white);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-card);
  padding: 40px;
  max-width: 760px;
  margin: 0 auto;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.form-grid .full { grid-column: 1 / -1; }
.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-s);
  border: 1.5px solid var(--line);
  font-family: var(--font-body);
  font-size: 0.96rem;
  background: var(--sky-tint);
}
.field textarea { resize: vertical; min-height: 90px; }
.form-footer { margin-top: 26px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form-message { font-size: 0.92rem; font-weight: 600; }
.form-message.is-success { color: #2E7D32; }
.form-message.is-error { color: #C0392B; }

/* ---------------------------------- Contact ---------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 760px;
  margin: 0 auto;
}
.contact-card {
  background: var(--white);
  border-radius: var(--radius-m);
  padding: 24px;
  box-shadow: var(--shadow-card);
}
.contact-card .label { font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--sea-mid); margin-bottom: 6px; }
.contact-card .value { font-weight: 700; font-size: 1.05rem; }

/* ---------------------------------- Footer ---------------------------------- */
.site-footer {
  background: var(--sea-deep);
  color: #BFDCE2;
  padding: 40px 0;
  font-size: 0.88rem;
}
.site-footer .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.site-footer a { color: #E4F1F1; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---------------------------------- Admin ---------------------------------- */
.admin-shell { min-height: 100vh; display: flex; flex-direction: column; }
.admin-login-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #0E4A5C, #1D7A8C);
  padding: 24px;
}
.admin-login-card {
  background: var(--white);
  border-radius: var(--radius-l);
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-card);
}
.admin-topbar {
  background: var(--sea-deep);
  color: var(--white);
  padding: 18px 0;
}
.admin-topbar .container { display: flex; justify-content: space-between; align-items: center; }
.admin-main { padding: 40px 0; flex: 1; }
.admin-filters { display: flex; gap: 14px; align-items: flex-end; margin-bottom: 24px; flex-wrap: wrap; }

.admin-table-wrap {
  background: var(--white);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.admin-table th, table.admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.admin-table th { background: var(--sky-tint); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
.apt-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 0.8rem;
}
.apt-pill::before { content:""; width: 9px; height: 9px; border-radius: 50%; background: var(--pill-color); }
.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}
.status-pill.confirmed { background: #E4F3E1; color: #2E7D32; }
.status-pill.cancelled { background: #FBE4E1; color: #C0392B; }
.row-actions { display: flex; gap: 8px; }
.row-actions button {
  border: none; background: none; cursor: pointer;
  font-weight: 700; font-size: 0.82rem;
  color: var(--sea-mid);
  padding: 4px 6px;
}
.row-actions button.danger { color: #C0392B; }
.edit-row td { background: #FBF8F0; }
.edit-row input, .edit-row select { padding: 6px 8px; font-size: 0.85rem; border-radius: 6px; border: 1px solid var(--line); width: 100%; }

/* ---------------------------------- Responsive ---------------------------------- */
@media (max-width: 980px) {
  .apt-grid, .month-calendars { grid-template-columns: repeat(2, 1fr); }
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero-copy p { margin-left: auto; margin-right: auto; }
  .hero-cta-row { justify-content: center; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .main-nav { position: fixed; inset: 76px 0 0 0; background: var(--sea-deep); flex-direction: column; padding: 30px 24px; gap: 20px; transform: translateX(100%); transition: transform 0.25s ease; }
  .main-nav.is-open { transform: translateX(0); }
  .nav-toggle { display: inline-flex; background: none; border: none; color: var(--white); font-size: 1.6rem; cursor: pointer; }
  .section { padding: 60px 0; }
  .apt-grid, .month-calendars { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .booking-panel { padding: 26px; }
  table.admin-table { font-size: 0.8rem; }
  .admin-table-wrap { overflow-x: auto; }
}
