:root {
  --navy: #14273b;
  --ink: #1c2e41;
  --muted: #536273;
  --gold: #d7b785;
  --gold-light: #f3e8d7;
  --canvas: #f8f7f3;
  --line: #dedfdc;
  --white: #fff;
  color-scheme: light;
  background: var(--canvas);
  color: var(--ink);
  font: 16px/1.5 system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; margin: 0; }
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #806333; outline-offset: 3px; }
button:not(:disabled) { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }

.shell { width: min(70rem, calc(100% - 3rem)); margin-inline: auto; }
.app-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.75rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--navy); text-decoration: none; }
.brand img { background: var(--navy); border: 4px solid var(--navy); border-radius: 2px; }
.brand span { font: 1.3rem/1 Georgia, serif; letter-spacing: .105em; white-space: nowrap; }
.brand small { display: block; margin-top: .25rem; font: 700 .62rem/1.1 system-ui, sans-serif; letter-spacing: .22em; }
.header-link, .text-button { color: var(--navy); font-size: .875rem; font-weight: 650; text-underline-offset: .2em; }
.text-button { min-height: 2.75rem; padding: .2rem 0; border: 0; background: none; text-decoration: underline; }
.header-link:hover, .text-button:hover { color: #69522d; }
.app-main { flex: 1; padding-block: clamp(1.25rem, 4dvh, 3.25rem); }
.app-footer { border-top: 1px solid var(--line); color: var(--muted); padding-block: 1rem max(1rem, env(safe-area-inset-bottom)); font-size: .875rem; }
.loading { display: grid; justify-items: start; gap: 1rem; padding: 2rem 0; }

.auth-layout {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  min-height: 32rem;
  overflow: hidden;
  border-radius: .5rem;
  background: var(--white);
  box-shadow: 0 .6rem 2.5rem #14273b12;
}
.auth-photo {
  display: grid;
  align-items: end;
  padding: clamp(1.6rem, 4.5vw, 3rem);
  background: var(--navy) linear-gradient(180deg, #14273b1c 0%, #101f31e8 96%);
  background-image: linear-gradient(180deg, #14273b1c 0%, #101f31e8 96%), url("/assets/hero.jpg");
  background-position: 56% center;
  background-size: cover;
  color: var(--white);
}
.eyebrow {
  color: #655337;
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .05em;
}
.auth-photo .eyebrow { color: #edd4ae; }
.auth-tagline, .application-heading h1 {
  margin-top: .6rem;
  font: 400 clamp(2.35rem, 4.8vw, 4.15rem)/1.03 Georgia, serif;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}
.auth-panel { display: grid; align-items: center; justify-items: center; padding: clamp(1.5rem, 4.5vw, 3.5rem); }
.auth-inner { width: min(100%, 24rem); }
.auth-inner h1, .section-heading h2, .booking-panel h2 {
  font: 400 clamp(1.65rem, 3vw, 2.2rem)/1.15 Georgia, serif;
  letter-spacing: -.025em;
}
#auth-intro { margin-top: .7rem; color: var(--muted); }
.auth-form { display: grid; margin-top: 1.6rem; }
.auth-form label { margin-bottom: .35rem; font-size: .9rem; font-weight: 650; }
.auth-form input {
  min-width: 0;
  width: 100%;
  min-height: 3rem;
  padding: .65rem .85rem;
  border: 1px solid #9ca7af;
  border-radius: .25rem;
  color: var(--ink);
  background: var(--white);
}
.phone-field { display: grid; }
.auth-form > input + label, .phone-field { margin-top: .85rem; }
.phone-field + label { margin-top: .85rem; }
.auth-form .button { margin-top: 1.1rem; }
.field-hint { color: var(--muted); font-size: .875rem; margin-top: .35rem; }
.auth-switch { margin-top: 1.15rem; display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.auth-switch span { color: var(--muted); font-size: .9rem; }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.85rem;
  padding: .55rem 1rem;
  border: 1px solid transparent;
  border-radius: .25rem;
  color: var(--navy);
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}
.button-primary { background: var(--gold); }
.button-primary:hover:not(:disabled) { background: #e5c899; }
.button-secondary { background: var(--white); border-color: #9ca7af; }
.button-secondary:hover:not(:disabled) { border-color: var(--navy); }
.button:disabled { background: #edebe7; border-color: #dedcd7; color: #55616d; }

.application-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 1.5rem; }
.account-email { color: var(--muted); overflow-wrap: anywhere; }
.app-nav { display: flex; gap: clamp(1rem, 4vw, 2rem); border-bottom: 1px solid var(--line); }
.app-nav a { padding: .7rem 0 .6rem; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 650; text-decoration: none; }
.app-nav a[aria-current] { color: var(--navy); border-color: #9c7841; }
.app-nav a:hover { color: var(--navy); }
.app-section { padding-top: 1.65rem; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: .8rem 1.5rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.catalog-date { background: var(--gold-light); color: #4e3d24; border-radius: .2rem; padding: .45rem .7rem; font-size: .875rem; }
.catalog-date time { font-weight: 700; }
.listings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
.property {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: var(--white);
}
.property:focus-within { overflow: visible; }
.property-image { display: block; width: 100%; height: min(12rem, 27dvh); object-fit: cover; border-radius: .3rem .3rem 0 0; }
.property-content { flex: 1; display: flex; flex-direction: column; align-items: start; gap: .5rem; padding: 1.15rem; overflow-wrap: anywhere; }
.property-location { color: var(--muted); font-size: .9rem; }
.property h3, .booking-item h3 { font: 400 1.45rem/1.18 Georgia, serif; }
.property-facts { color: var(--muted); font-size: .9rem; }
.property-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; width: 100%; margin-top: auto; padding-top: .45rem; }
.property-actions a { font-size: .875rem; text-underline-offset: .2em; }
.empty-state { padding: 1.25rem; background: var(--white); border: 1px solid var(--line); border-radius: .3rem; color: var(--muted); }
.bookings { display: grid; gap: .75rem; max-width: 55rem; margin: 0; padding: 0; list-style: none; }
.booking-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: .45rem 1.5rem;
  padding: 1rem 1.15rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: .3rem;
  overflow-wrap: anywhere;
}
.booking-item .property-location { margin-top: .3rem; }
.booking-item time { background: var(--gold-light); color: #4e3d24; border-radius: .2rem; padding: .35rem .55rem; font-size: .875rem; font-weight: 650; }
#retry-data { margin-top: 1rem; }

.message { color: #1e503a; background: #e8f1e9; border-radius: .25rem; padding: .65rem .85rem; margin-bottom: 1rem; }
.message.error { color: #81281c; background: #f8eae7; }
.auth-form .message { margin: .65rem 0 0; }
.pager, .month-nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .55rem;
  max-width: 32rem;
  margin-top: .8rem;
  text-align: center;
}
.pager p { font-variant-numeric: tabular-nums; font-size: .875rem; color: var(--muted); }
.month-nav p { font-size: .95rem; font-weight: 700; }
.booking-open .application-heading { display: none; }
.booking-panel {
  max-width: 32rem;
  margin-inline: auto;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: var(--white);
}
.booking-back { display: block; margin-bottom: .3rem; }
.booking-listing {
  color: var(--muted);
  margin-top: .3rem;
  overflow-wrap: anywhere;
}
.booking-panel .message,
.calendar-status { margin: .65rem 0 0; }
.booking-step { display: grid; gap: .55rem; }
.weekday-row, .calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .3rem;
  text-align: center;
}
.weekday-row { color: var(--muted); font-size: .875rem; font-weight: 650; }
.date-option, .time-option {
  min-height: 2.65rem;
  padding: .2rem;
  border: 1px solid var(--navy);
  border-radius: .25rem;
  background: var(--navy);
  color: var(--white);
  font-size: .875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.date-option:hover:not(:disabled), .time-option:hover:not(:disabled) { background: #29455f; }
.date-option:disabled, .time-option:disabled {
  background: #eeefed;
  border-color: #e0e2df;
  color: #61666b;
}
.time-option[aria-pressed="true"] {
  background: var(--gold);
  border-color: #9c7841;
  color: var(--navy);
}
.time-option[aria-pressed="true"]:hover { background: #e5c899; }
.time-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
.selected-date { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 .5rem; }
.selected-date time { font-size: .9rem; font-weight: 650; }
.booking-step > .button { justify-self: start; margin-top: .25rem; }
.booking-step .pager { margin-top: 0; }
#retry-calendar { margin-top: .65rem; }

@media (max-width: 42rem), (max-height: 43rem) {
  .shell { width: calc(100% - 1.5rem); }
  .header-inner { min-height: 3.25rem; }
  .brand img { width: 32px; height: 32px; }
  .brand span { font-size: 1.08rem; }
  .brand small { font-size: .55rem; }
  .app-main { padding-block: .65rem; }
  .app-footer { padding-block: .3rem max(.3rem, env(safe-area-inset-bottom)); font-size: .8rem; }
  .auth-layout { min-height: unset; }
  .auth-panel { padding: .9rem; }
  .auth-form { margin-top: .8rem; }
  .auth-form label { margin-bottom: .2rem; }
  .auth-form input { min-height: 2.6rem; padding: .45rem .65rem; }
  .auth-form > input + label, .phone-field, .phone-field + label { margin-top: .45rem; }
  .auth-form .button { margin-top: .65rem; }
  .auth-switch { margin-top: .3rem; }
  .application-heading { display: none; }
  .app-nav a { padding-block: .55rem .45rem; }
  .app-section { padding-top: .75rem; }
  .section-heading { gap: .35rem 1rem; margin-bottom: .65rem; }
  .catalog-date { padding: .3rem .45rem; }
  .listings { grid-template-columns: minmax(0, 28rem); }
  .property-image { height: clamp(6.5rem, min(24dvh, 37vw), 10rem); }
  .property-content { padding: .67rem .75rem; gap: .25rem; }
  .property h3, .booking-item h3 { font-size: 1.25rem; }
  .property h3, .booking-item h3, .property-location, .booking-listing {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .property-location { -webkit-line-clamp: 1; }
  .property-actions { gap: .5rem .75rem; padding-top: .35rem; }
  .booking-item { grid-template-columns: 1fr; padding: .65rem .75rem; }
  .booking-item time { justify-self: start; }
  .booking-panel { padding: .55rem .7rem .75rem; }
  .booking-back { min-height: 2.25rem; margin-bottom: .15rem; }
  .booking-step { gap: .35rem; }
  .month-nav { margin-top: .55rem; }
  .date-option { min-height: 2.1rem; }
  .time-option { min-height: 2.55rem; }
  .pager .button, .month-nav .button { min-height: 2.4rem; padding-block: .35rem; }
  .message { padding: .45rem .6rem; margin-bottom: .5rem; }
}

@media (max-width: 42rem) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-photo { min-height: 9rem; padding: 1rem; background-position: 56% 48%; }
  .auth-tagline { font-size: clamp(1.7rem, 6vw, 2.5rem); }
  .auth-panel { justify-items: stretch; }
  .auth-inner { margin-inline: auto; }
}

@media (max-width: 42rem) and (max-height: 43rem) {
  .auth-photo { display: none; }
}

@media (max-height: 32rem) {
  .app-main { padding-block: .4rem; }
  .booking-back { min-height: 1.85rem; }
  .booking-listing { -webkit-line-clamp: 1; }
  .date-option { min-height: 1.85rem; }
  .time-option { min-height: 2.15rem; }
}
