/* Beats Working owner login and owner portal. Loaded on /login/ and /owner-portal/ only.
   Uses the site tokens from site.css. Radius by role as everywhere else:
   photos 20px, cards 16px, panels 24px, inputs 12px, buttons and the tab control pill.
   The portal is a working screen, so motion stays at colour and focus changes. */

:root {
  --error: #b42318;      /* 6.5:1 on white */
  --error-50: #fef3f2;
}
/* Elements below set display (grid, flex), which would beat the hidden attribute the script uses. */
.login-page [hidden], .portal [hidden] { display: none !important; }

/* ---------- Login ---------- */
.login-page { background: var(--surface); padding-block: 48px 72px; }
.login-grid { display: grid; gap: 32px; align-items: stretch; }
@media (min-width: 1024px) {
  .login-page { padding-block: 64px 96px; }
  .login-grid { grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 48px; }
}
.login-panel { background: var(--white); border-radius: var(--r-panel); padding: 32px 24px; box-shadow: 0 1px 2px rgb(19 32 42 / .06); width: 100%; max-width: 480px; margin-inline: auto; }
@media (min-width: 768px) { .login-panel { padding: 48px 44px; } }
.login-panel h1 { font-size: clamp(2.25rem, 1.8rem + 1.6vw, 3rem); }
.login-lead { margin-top: 12px; color: var(--ink-2); font-size: var(--fs-18); }

.login-msg { display: flex; gap: 10px; align-items: flex-start; margin-top: 24px; padding: 12px 14px; border-radius: var(--r-input); background: var(--teal-50); color: var(--teal-800); font-weight: 500; }
.login-msg .icon { font-size: 1.25rem; margin-top: 2px; }
.login-msg.is-error { background: var(--error-50); color: var(--error); }

.login-form { display: grid; gap: 20px; margin-top: 28px; }
.field { display: grid; gap: 8px; }
.field label { font-weight: 600; font-size: var(--fs-14); }
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field-link { font-size: var(--fs-14); font-weight: 600; color: var(--teal-700); text-decoration: none; }
.field-link:hover { text-decoration: underline; }
.field input {
  width: 100%; min-height: 52px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: var(--r-input);
  background: var(--white); font-size: var(--fs-16); transition: border-color .2s, box-shadow .2s;
}
.field input:hover { border-color: #c7d1d8; }
.field input:focus { outline: none; border-color: var(--teal-700); box-shadow: 0 0 0 4px rgb(0 117 106 / .15); }
.field input[aria-invalid="true"] { border-color: var(--error); }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 56px; }
.pass-toggle { position: absolute; right: 4px; top: 50%; translate: 0 -50%; width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; border-radius: var(--r-input); color: var(--ink-2); cursor: pointer; font-size: 1.25rem; }
.pass-toggle:hover { color: var(--ink); }
.pass-toggle .icon + .icon, .pass-toggle[aria-pressed="true"] .icon:first-child { display: none; }
.pass-toggle[aria-pressed="true"] .icon + .icon { display: block; }
.check { display: flex; gap: 10px; align-items: center; font-size: var(--fs-14); color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--teal-700); margin: 0; }
.login-submit { width: 100%; min-height: 52px; margin-top: 4px; font-size: var(--fs-16); }
.login-help { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); font-size: var(--fs-14); color: var(--ink-3); }

.login-photos { display: none; }
@media (min-width: 1024px) {
  /* contain: size so the photos take the form's height instead of setting it. */
  .login-photos { display: grid; gap: 16px; grid-template-rows: 1fr 1fr; contain: size; }
  .login-photos.count-1 { grid-template-rows: 1fr; }
  .login-photo { position: relative; min-height: 0; }
  .login-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-photo); }
}

/* ---------- Portal shell ---------- */
.portal { padding-bottom: 96px; }
.staff-bar { background: var(--slate-900); color: #fff; font-size: var(--fs-14); }
.staff-bar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-block: 10px; }
.staff-bar p { flex: 1 1 280px; }
.staff-bar .icon { font-size: 1.1rem; color: var(--teal-300); }
.staff-bar a { color: var(--teal-300); font-weight: 600; text-decoration: none; }
.staff-bar a:hover { text-decoration: underline; }

.portal-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 24px; padding-block: 40px 28px; }
.portal-head h1 { font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.5rem); }
.portal-sub { margin-top: 8px; color: var(--ink-2); font-size: var(--fs-18); }
@media (min-width: 1024px) { .portal-head { padding-block: 56px 36px; } }

/* Tabs: one pill track. Scrolls sideways on phones rather than wrapping into rows. */
.portal-tabs { position: sticky; top: var(--header-h); z-index: 20; background: rgb(255 255 255 / .95); backdrop-filter: blur(8px); padding-block: 8px; margin-bottom: 24px; }
.admin-bar .portal-tabs { top: calc(var(--header-h) + var(--wp-admin--admin-bar--height, 32px)); }
.portal-tablist { display: flex; gap: 4px; padding: 4px; background: var(--surface); border-radius: var(--r-pill); overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.portal-tablist::-webkit-scrollbar { display: none; }
.portal-tablist [role="tab"] {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 0; border-radius: var(--r-pill); background: none; color: var(--ink-2); font-weight: 600; font-size: var(--fs-14);
  cursor: pointer; scroll-snap-align: start; transition: background-color .2s, color .2s, box-shadow .2s;
}
.portal-tablist [role="tab"] .icon { font-size: 1.15rem; }
.portal-tablist [role="tab"]:hover { color: var(--ink); }
.portal-tablist [role="tab"][aria-selected="true"] { background: var(--white); color: var(--teal-800); box-shadow: 0 1px 2px rgb(19 32 42 / .1), 0 2px 8px rgb(19 32 42 / .06); }
.tab-count { min-width: 22px; padding: 0 6px; border-radius: var(--r-pill); background: var(--white); color: var(--ink-3); font-size: var(--fs-12); line-height: 20px; text-align: center; }
[aria-selected="true"] .tab-count { background: var(--teal-50); color: var(--teal-800); }
@media (min-width: 1024px) { .portal-tablist { display: inline-flex; } }

/* Without JS every panel shows, stacked, with its own heading. With JS only the chosen one. */
.portal-panel { padding-block: 8px 48px; }
.panel-title { font-size: var(--fs-32); margin-bottom: 24px; }
.js .portal-tabs:not([hidden]) ~ .portal-panel[hidden] { display: none; }
.js .portal-tabs:not([hidden]) ~ .portal-panel .panel-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.panel-note { margin-top: 28px; font-size: var(--fs-14); color: var(--ink-3); max-width: 65ch; }
.portal-empty { padding: 24px; border-radius: var(--r-card); background: var(--surface); color: var(--ink-2); }

/* ---------- Overview ---------- */
.home-tiles { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.home-tile { display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; background: var(--white); }
.home-tile-img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.home-tile-body { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.home-tile h3 { font-size: var(--fs-24); }
.home-tile-next { display: grid; gap: 2px; color: var(--ink-2); font-size: var(--fs-14); }
.home-tile-next span { font-weight: 600; color: var(--ink-3); }
.home-tile-next strong { font-family: var(--font-display); font-size: var(--fs-20); font-weight: 600; color: var(--ink); }
.home-tile-meta { color: var(--ink-2); font-size: var(--fs-14); }
.home-tile-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: auto; padding-top: 4px; }
.home-tile-links a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--teal-700); font-weight: 600; font-size: var(--fs-14); text-decoration: none; }
.home-tile-links a:hover { text-decoration: underline; }
/* Most owners have one home: give it the full row, photo beside the details. */
@media (min-width: 768px) {
  .home-tiles:has(> .home-tile:only-child) { grid-template-columns: minmax(0, 960px); }
  .home-tile:only-child { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: none; }
  .home-tile:only-child .home-tile-img { height: 100%; aspect-ratio: auto; min-height: 280px; }
  .home-tile:only-child .home-tile-body { padding: 28px 32px; }
}

.recent { margin-top: 48px; }
.recent h3, .file-group { font-size: var(--fs-20); margin-bottom: 8px; }
.file-group { margin-top: 32px; }
.file-group:first-child, .file-search + .file-group { margin-top: 0; }

/* ---------- File rows ---------- */
.file-list { border-top: 1px solid var(--line); }
.file { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.file-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-50); color: var(--teal-800); font-size: 1.25rem; }
.file-text { display: grid; gap: 2px; min-width: 0; }
.file-name { font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
a.file-name:hover { color: var(--teal-700); text-decoration: underline; }
.file-meta { font-size: var(--fs-14); color: var(--ink-3); }
.file.is-expired .file-icon { background: var(--surface); color: var(--ink-3); }
.file.is-expired .file-meta { color: var(--error); }
.file-dl { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; padding: 0 16px; border-radius: var(--r-pill); color: var(--teal-700); font-weight: 600; font-size: var(--fs-14); text-decoration: none; box-shadow: inset 0 0 0 1.5px var(--line); transition: background-color .2s, box-shadow .2s; }
.file-dl:hover { background: var(--teal-50); box-shadow: inset 0 0 0 1.5px var(--teal-700); }
.file-dl .icon { font-size: 1.15rem; }
@media (max-width: 599px) {
  .file-dl { padding: 0; }
  .file-dl span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
/* Expenses: one accordion per year. */
.year-acc { border-bottom: 1px solid var(--line); }
.year-acc:first-of-type { border-top: 1px solid var(--line); }
.year-acc summary { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; min-height: 72px; padding-block: 14px; cursor: pointer; list-style: none; }
.year-acc summary::-webkit-details-marker { display: none; }
.year-acc summary:hover .year-acc-title { color: var(--teal-700); }
.year-acc-title { font-family: var(--font-display); font-size: var(--fs-24); font-weight: 600; transition: color .2s; }
.year-acc-meta { font-size: var(--fs-14); color: var(--ink-3); }
.year-acc-caret { margin-left: auto; font-size: 1.25rem; color: var(--ink-2); transition: rotate .2s var(--ease-out); }
.year-acc[open] .year-acc-caret { rotate: 180deg; }
.year-acc .file-list { margin-bottom: 16px; }
.year-acc .file:last-child { border-bottom: 0; }
.file-group + .year-acc { border-top: 1px solid var(--line); }

.file-search { margin-bottom: 20px; max-width: 420px; }
.file-search input { width: 100%; min-height: 48px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: var(--r-input); }
.file-search input:focus { outline: none; border-color: var(--teal-700); box-shadow: 0 0 0 4px rgb(0 117 106 / .15); }

/* ---------- Owner calendar ---------- */
.owner-cal + .owner-cal { margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--line); }
.owner-cal-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.owner-cal-head h3 { font-size: var(--fs-24); }
.owner-cal-sync { font-size: var(--fs-14); color: var(--ink-3); }

.owner-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 16px 0 20px; font-size: var(--fs-14); color: var(--ink-2); }
.owner-legend li { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 16px; height: 16px; border-radius: 5px; flex: none; }
.sw-stay { background: var(--teal-700); }
.sw-block { background: repeating-linear-gradient(135deg, var(--slate-50) 0 3px, #cfd8de 3px 5px); }
.sw-open { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--line); }

.oc-scroller { position: relative; }
.js .oc-scroller:has(.oc-arrow:not([hidden])) { padding-top: 52px; } /* arrows get their own row, clear of the legend */
/* Whole months only: one on phones, two on tablets, three on desktop. */
.oc-months { --n: 1; --gap: 32px; display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - var(--gap) * (var(--n) - 1)) / var(--n)); gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.oc-months::-webkit-scrollbar { display: none; }
@media (min-width: 640px) { .oc-months { --n: 2; } }
@media (min-width: 1024px) { .oc-months { --n: 3; --gap: 48px; } }
.oc-months:focus-visible { outline-offset: 4px; }
.oc-month { scroll-snap-align: start; }
.oc-month h4 { font-size: var(--fs-16); font-weight: 600; margin-bottom: 8px; }
.oc-month table { width: 100%; border-collapse: separate; border-spacing: 0 4px; table-layout: fixed; }
.oc-month th { font-size: var(--fs-12); font-weight: 600; color: var(--ink-3); padding-bottom: 4px; }
.oc-month td { padding: 0; text-align: center; }
.oc-month td span { display: grid; place-items: center; height: 36px; font-size: var(--fs-14); font-variant-numeric: tabular-nums; }
/* A stay's nights read as one bar, rounded where it starts and ends, so back-to-back
   guests show as separate bars. Rows also round at the week's edges. */
.oc-month td.is-stay span { background: var(--teal-700); color: #fff; font-weight: 600; }
.oc-month td.is-block span { background: repeating-linear-gradient(135deg, var(--slate-50) 0 4px, #dbe2e7 4px 7px); color: var(--ink-2); }
.oc-month td.is-start span, .oc-month td:first-child span { border-start-start-radius: 10px; border-end-start-radius: 10px; }
.oc-month td.is-end span, .oc-month td:last-child span { border-start-end-radius: 10px; border-end-end-radius: 10px; }
.oc-month td.is-start:not(:first-child) { padding-inline-start: 2px; }
.oc-month td.is-past span { opacity: .45; }
.oc-month td.is-today span { box-shadow: inset 0 0 0 2px var(--ink); border-radius: 10px; }
.oc-arrow { position: absolute; top: 0; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--white); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink); cursor: pointer; font-size: 1.1rem; }
.oc-arrow[data-dir="-1"] { right: 48px; }
.oc-arrow[data-dir="1"] { right: 0; }
.oc-arrow:hover:not(:disabled) { box-shadow: inset 0 0 0 1.5px var(--teal-700); color: var(--teal-700); }
.oc-arrow:disabled { opacity: .35; cursor: default; }

.stay-title { font-size: var(--fs-16); font-weight: 600; margin: 28px 0 8px; }
.stay-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.stay-list li { display: grid; grid-template-columns: 16px minmax(0, 1fr); column-gap: 14px; align-items: center; padding-block: 12px; border-bottom: 1px solid var(--line); }
.stay-list li .sw { grid-row: span 2; align-self: start; margin-top: 4px; }
.stay-list strong { font-weight: 600; }
.stay-list li > span:last-child { font-size: var(--fs-14); color: var(--ink-3); }
@media (min-width: 768px) {
  .stay-list li { grid-template-columns: 16px 260px minmax(0, 1fr); }
  .stay-list li .sw { grid-row: auto; margin-top: 0; }
}
.stay-more { margin-top: 12px; font-size: var(--fs-14); color: var(--ink-3); }

/* ---------- Profile ---------- */
.profile-list { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--line); max-width: 760px; }
.profile-list > div { display: grid; gap: 4px; padding-block: 14px; border-bottom: 1px solid var(--line); }
@media (min-width: 768px) { .profile-list > div { grid-template-columns: 220px 1fr; gap: 24px; } }
.profile-list dt { font-weight: 600; color: var(--ink-2); font-size: var(--fs-14); }
.profile-list dd { margin: 0; }
.contact-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); max-width: 960px; }
.contact-list li { display: grid; gap: 4px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-card); }
.contact-list li > span { font-size: var(--fs-14); color: var(--ink-3); }
.contact-list a { display: inline-flex; align-items: center; gap: 8px; color: var(--teal-700); font-size: var(--fs-14); font-weight: 500; text-decoration: none; overflow-wrap: anywhere; min-height: 32px; }
.contact-list a:hover { text-decoration: underline; }

/* ---------- Staff owner list ---------- */
.owner-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); padding-bottom: 48px; }
.owner-list a { display: grid; gap: 2px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-card); text-decoration: none; transition: border-color .2s, background-color .2s; }
.owner-list a:hover { border-color: var(--teal-700); background: var(--teal-50); }
.owner-list span { font-size: var(--fs-14); color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) {
  .portal *, .login-page * { transition: none !important; }
  .oc-months { scroll-behavior: auto; }
}
