/* Granvila — public booking page */
:root {
  --ink: #23261f; --muted: #75776b; --line: #e4dfd4; --bg: #faf8f4; --card: #fff;
  --accent: #3f4a33; --gold: #b8964a; --free: #ffffff; --booked: #d9d4c8; --sel: #3f4a33; --warn: #9a5a12;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif); color: var(--ink); background: var(--bg); line-height: 1.5; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--hfont, Georgia, "Times New Roman", serif); font-weight: normal; }
header.site { background: #111; padding: 18px 24px; text-align: center; }
.mark { display: inline-flex; flex-direction: column; align-items: center; color: #fff; text-decoration: none; font-family: Georgia, serif; }
.mark .w { font-size: 1.5rem; letter-spacing: .06em; } .mark .s { font-size: .62rem; letter-spacing: .3em; opacity: .8; margin-top: 2px; }
main { max-width: 1320px; margin: 0 auto; padding: 28px 20px 60px; }
.intro { text-align: center; max-width: 640px; margin: 0 auto 22px; }
.intro h1 { font-size: 2.2rem; margin: 0 0 8px; }
.intro p { color: var(--muted); margin: 0; }
.intro .hint { display: block; font-size: .9rem; margin-top: 6px; color: var(--gold); }
.notice { background: #fff8ea; border: 1px solid #ecd9ae; padding: 12px 16px; border-radius: 8px; margin: 0 auto 18px; max-width: 760px; text-align: center; }
footer.site { text-align: center; color: var(--muted); font-size: .85rem; padding: 20px; border-top: 1px solid var(--line); }

.layout { display: flex; gap: 24px; align-items: flex-start; }
.cal-area { flex: 1; min-width: 0; }
.cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.arrow { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--accent); }
.arrow:disabled { opacity: .3; cursor: default; }
.key { display: flex; gap: 16px; font-size: .82rem; color: var(--muted); }
.key span::before { content: ""; display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; border: 1px solid var(--line); }
.key .k-free::before { background: var(--free); } .key .k-booked::before { background: var(--booked); } .key .k-sel::before { background: var(--sel); border-color: var(--sel); }

.months { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
@media (min-width: 981px) { .months { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); } }
.month { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius, 12px); padding: 14px 14px 16px; }
.month h3 { text-align: center; margin: 2px 0 10px; font-size: 1.15rem; }
.dow, .grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dow span { text-align: center; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-bottom: 4px; }
.loading { color: var(--muted); padding: 40px; text-align: center; }

/* A date is split diagonally: top-left = last night (someone may be leaving), bottom-right = tonight.
   So a booked-tonight date can still be the day YOU leave, and a booked-last-night date can be the day you arrive. */
.day { --tl: var(--free); --br: var(--free); position: relative; aspect-ratio: 1 / 1; border: 1px solid var(--line); border-radius: calc(var(--radius, 12px) / 2); padding: 0; cursor: pointer;
  background: linear-gradient(to bottom right, var(--tl) 50%, var(--br) 50%); color: var(--ink); font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.day .n { font-size: .95rem; line-height: 1; }
.day small { font-size: .62rem; color: var(--muted); margin-top: 3px; }
.day.am { --tl: var(--booked); } .day.pm { --br: var(--booked); }
.day.am.pm { color: #8d897d; }
.day.closed:not(.pm) { --br: #f1eee8; }
.day.out { visibility: hidden; }
.day:disabled { cursor: default; }
.day:disabled .n { opacity: .55; }
.day:not(:disabled):hover { outline: 2px solid var(--gold); outline-offset: -1px; }
.day.sel { --tl: var(--sel); --br: var(--sel); color: #fff; border-color: var(--sel); }
.day.sel small { color: rgba(255,255,255,.75); }
.day.sel-a:not(.sel-d) { --br: var(--sel); }
.day.sel-a:not(.sel-d):not(.am) { --tl: var(--free); }
.day.sel-d { --tl: var(--sel); border-color: var(--sel); }
.day.sel-a.open { --br: var(--sel); color: var(--ink); }
.pad { aspect-ratio: 1 / 1; }

/* Panel */
.panel { position: sticky; top: 20px; width: 380px; flex-shrink: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius, 14px); padding: 22px; box-shadow: 0 10px 30px rgba(40, 40, 30, .08); }
.panel h2 { margin: 0 0 14px; font-size: 1.4rem; }
.panel .close { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 1.6rem; color: var(--muted); cursor: pointer; }
.panel label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
.panel input, .panel select, .panel textarea { font: inherit; font-size: 1rem; color: var(--ink); padding: 10px 11px; border: 1px solid #d3ccbd; border-radius: 8px; background: #fff; width: 100%; }
.panel input:focus, .panel select:focus, .panel textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.dates, .guests, .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.quote { margin: 4px 0 16px; }
.quote .stay { margin: 0 0 8px; }
.quote table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.quote td { padding: 5px 0; border-bottom: 1px solid #f0ece3; } .quote td:last-child { text-align: right; white-space: nowrap; }
.quote tr.total td { font-weight: 600; border-bottom: 0; padding-top: 8px; font-size: 1.05rem; }
.quote .due { background: #f5f2ea; padding: 10px 12px; border-radius: 8px; margin: 10px 0 6px; font-size: .92rem; }
.quote .small { font-size: .82rem; color: var(--muted); }
.msg { margin: 0 0 8px; color: var(--muted); } .msg.warn { color: var(--warn); }
.btn { display: inline-block; padding: 13px 18px; border-radius: calc(var(--radius, 12px) - 2px); border: 1px solid var(--accent); background: #fff; color: var(--accent); font: inherit; font-size: 1rem; cursor: pointer; text-decoration: none; text-align: center; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.back { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; margin-bottom: 8px; font: inherit; }
.summary { background: #f5f2ea; padding: 10px 12px; border-radius: 8px; font-size: .9rem; margin: 0 0 14px; }
fieldset.pay { border: 0; padding: 0; margin: 4px 0 12px; }
fieldset.pay legend { font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
label.opt { flex-direction: row !important; align-items: flex-start; gap: 10px !important; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--ink) !important; cursor: pointer; margin-bottom: 8px !important; }
label.opt input, label.check input { width: auto; margin-top: 3px; }
label.opt:has(input:checked) { border-color: var(--accent); background: #f6f8f2; }
label.check { flex-direction: row !important; align-items: flex-start; gap: 8px !important; color: var(--ink) !important; font-size: .88rem !important; }
.errors p { color: #a33a2b; background: #fbeeec; padding: 8px 10px; border-radius: 6px; margin: 0 0 8px; font-size: .9rem; }
.fine { font-size: .78rem; color: var(--muted); margin: 10px 0 0; }
small { font-size: .8em; }

/* Confirmation page */
.confirm { max-width: 720px; margin: 0 auto; }
.confirm .card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px 26px; margin-bottom: 18px; }
.confirm h1 { text-align: center; font-size: 2rem; margin: 0 0 6px; }
.confirm .lead { text-align: center; color: var(--muted); margin: 0 0 22px; }
.confirm table { width: 100%; border-collapse: collapse; }
.confirm td { padding: 7px 0; border-bottom: 1px solid #f0ece3; vertical-align: top; } .confirm td:last-child { text-align: right; }
.confirm .bank td:last-child { font-family: ui-monospace, Menlo, monospace; font-size: 1.02rem; }
.confirm .big { font-size: 1.6rem; font-family: Georgia, serif; text-align: center; margin: 6px 0 2px; }
.confirm .ref { display: inline-block; background: #f5f2ea; padding: 2px 8px; border-radius: 6px; font-family: ui-monospace, Menlo, monospace; }
.copy { border: 1px solid var(--line); background: #fff; border-radius: 6px; font-size: .75rem; padding: 2px 8px; margin-left: 6px; cursor: pointer; color: var(--muted); }
.status-badge { display: block; width: max-content; margin: 0 auto 10px; padding: 4px 12px; border-radius: 999px; font-size: .85rem; background: #f6efe0; color: var(--warn); }
.status-badge.ok { background: #eaf3ea; color: #2f6b3a; }

@media (max-width: 980px) {
  .layout { display: block; }
  .panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 72vh; overflow-y: auto; border-radius: 18px 18px 0 0; z-index: 20;
    box-shadow: 0 -10px 40px rgba(0,0,0,.18); padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
  body.panel-open .cal-area { padding-bottom: 60vh; }
}
@media (max-width: 520px) {
  main { padding: 18px 10px 40px; }
  .intro h1 { font-size: 1.7rem; }
  .day small { font-size: .55rem; }
  .month { padding: 10px 8px 12px; }
  .key { gap: 8px; font-size: .75rem; }
}

.center { text-align: center; }

.mark img { width: 200px; height: auto; display: block; }
@media (max-width: 520px) { .mark img { width: 160px; } }

/* Months: exactly as many columns as are shown */
.months.per-1 { grid-template-columns: minmax(0, 1fr); }
.months.per-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.months.per-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Past days stay visible (faded) so a month doesn't start with empty rows */
.day.out { visibility: visible; background: none; border-color: transparent; cursor: default; }
.day.out .n { opacity: .3; }
/* Inside the main website */
body.embed { background: transparent; }
body.embed header.site, body.embed footer.site { display: none; }
body.embed main { padding-top: 8px; }
body.embed .intro h1 { display: none; }
@media (max-width: 980px) {
  /* Inside the website the panel can't float over the phone screen: show it under the calendar instead */
  body.embed .panel { position: relative; max-height: none; border-radius: 14px; margin-top: 18px; box-shadow: 0 10px 30px rgba(40,40,30,.08); }
  body.embed.panel-open .cal-area { padding-bottom: 0; }
}

/* Card payment inside the page (Stripe embedded checkout) */
.pay-box { min-height: 420px; margin: 8px 0 14px; }
.pay-loading { color: var(--muted); text-align: center; padding: 30px 0; }
/* Booking terms / privacy shown right in the form instead of a new window */
.doc-inline { border: 1px solid var(--line); border-radius: var(--radius, 12px); overflow: hidden; margin: 0 0 12px; background: #fff; }
.doc-inline .doc-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.doc-inline .doc-head button { border: 0; background: none; font-size: 1.3rem; cursor: pointer; color: var(--muted); }
.doc-inline iframe { display: block; width: 100%; height: 460px; border: 0; }
.flash { padding: 10px 12px; border-radius: 8px; margin: 0 0 14px; font-size: .92rem; }
.flash.warn { background: #fdf6e7; color: #7a5a14; border: 1px solid #ead9ae; }
