/*
 * StyleCo Photos — visual system
 * Built to the StyleCo Brand Style Guide v1.0 (July 2026).
 *
 * Palette is warm neutrals only — no accent colours. Espresso carries every
 * action. Cormorant Garamond for headings, Jost for everything functional.
 *
 * One deliberate departure from the guide: buttons are specified at 11px with
 * 14px padding, which is a ~40px target. This app is used one-handed, outdoors,
 * often in a hurry, so type and letter-spacing follow the guide exactly while
 * padding is increased to keep every target at least 52px.
 */

:root {
  /* Brand palette */
  --espresso:   #2C2420;   /* primary dark — headers, buttons, headings */
  --walnut:     #4A3F38;   /* body text */
  --driftwood:  #6B5E54;   /* secondary text */
  --warmstone:  #8C7B6E;   /* tertiary text, eyebrow labels */
  --linen:      #C4B5A5;   /* accent on dark */
  --parchment:  #E8E0D6;   /* borders, dividers */
  --cream:      #F5F0E8;   /* alternate backgrounds */
  --offwhite:   #FAF8F5;   /* page background */
  --white:      #FFFFFF;

  /* Functional states, kept inside the warm palette */
  --error:      #8C4A3A;
  --error-bg:   #F7EDE9;
  --warn:       #A0824F;
  --warn-bg:    #F8F2E6;
  --ok:         #5C6B4F;
  --ok-bg:      #F0F1EA;

  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:  'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --hair: 0.5px solid var(--parchment);
  --tap: 52px;
  --nav: 72px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--offwhite);
  color: var(--walnut);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
  overscroll-behavior-y: contain;
}

/* ---------------- layout ---------------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 0 24px 110px; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--espresso);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  max-width: 760px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px; min-height: var(--nav);
}
.brand {
  font-family: var(--serif);
  font-size: 22px; font-weight: 500; letter-spacing: 0.2em;
  color: var(--offwhite); text-decoration: none; line-height: 1;
}
.brand small {
  display: block; margin-top: 5px;
  font-family: var(--sans); font-size: 9px; font-weight: 400;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--warmstone);
}
.spacer { flex: 1; }
.topbar a.nav {
  color: var(--warmstone); text-decoration: none;
  font-size: 10px; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 10px 2px; transition: color .15s ease;
}
.topbar a.nav:hover, .topbar a.nav:focus { color: var(--linen); }

/* ---------------- typography ---------------- */
h1 {
  font-family: var(--serif); font-size: 34px; font-weight: 300;
  color: var(--espresso); line-height: 1.15; letter-spacing: 0;
  margin: 36px 0 6px;
}
h2 {
  font-size: 10px; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--warmstone); font-family: var(--sans);
  margin: 44px 0 16px;
  display: flex; align-items: center; gap: 12px;
}
h2::after { content: ''; display: block; flex: 1; height: 0.5px; background: var(--parchment); }
.sub { color: var(--driftwood); font-size: 15px; font-weight: 300; margin: 0 0 28px; }
a { color: var(--driftwood); text-decoration-thickness: 0.5px; text-underline-offset: 3px; }
a:hover { color: var(--espresso); }

/* ---------------- cards & fields ---------------- */
.card {
  background: var(--white); border: var(--hair); border-radius: 2px;
  padding: 24px; margin-bottom: 16px;
}
label.field { display: block; margin-bottom: 22px; }
.lbl, label.field > span.lbl {
  display: block; font-family: var(--sans);
  font-size: 10px; font-weight: 400; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--warmstone); margin-bottom: 9px;
}
input[type=text], input[type=password], input[type=search], input[type=number], select, textarea {
  width: 100%; min-height: var(--tap);
  padding: 14px 16px;
  font-family: var(--sans); font-size: 16px; font-weight: 300; color: var(--walnut);
  background: var(--white); border: 0.5px solid var(--linen); border-radius: 0;
  appearance: none; -webkit-appearance: none;
}
select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%238C7B6E' stroke-width='1' stroke-linecap='round' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 42px;
}
textarea { min-height: 104px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--espresso); box-shadow: inset 0 0 0 0.5px var(--espresso);
}
.hint { font-size: 13px; font-weight: 300; color: var(--driftwood); margin-top: 7px; line-height: 1.65; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }

/* ---------------- buttons — sharp corners, per brand ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: var(--tap); padding: 16px 32px;
  font-family: var(--sans); font-size: 11px; font-weight: 400;
  letter-spacing: 0.12em; text-transform: uppercase;
  border-radius: 0; border: 0.5px solid transparent; cursor: pointer;
  text-decoration: none; text-align: center;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--espresso); color: var(--offwhite); }
.btn-primary:hover { background: var(--walnut); color: var(--offwhite); }
.btn-primary[disabled] { background: var(--parchment); color: var(--warmstone); cursor: not-allowed; }
.btn-secondary { background: transparent; color: var(--espresso); border-color: var(--espresso); }
.btn-secondary:hover { background: var(--espresso); color: var(--offwhite); }
.btn-ghost { background: transparent; color: var(--driftwood); border-color: var(--parchment); }
.btn-ghost:hover { border-color: var(--warmstone); color: var(--espresso); }
.btn-danger { background: transparent; color: var(--error); border-color: var(--error); }
.btn-danger:hover { background: var(--error); color: var(--offwhite); }
.btn-sm { min-height: 44px; padding: 12px 20px; font-size: 10px; width: auto; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { width: auto; flex: 1 1 auto; }

/* ---------------- capture ---------------- */
.capture-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--parchment); border: var(--hair); }
.capture-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 420px) { .capture-grid.three { grid-template-columns: 1fr 1fr; } }
@media (max-width: 330px) { .capture-grid, .capture-grid.three { grid-template-columns: 1fr; } }
.capture-btn {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 116px; padding: 20px 12px; cursor: pointer;
  background: var(--white); color: var(--espresso);
  font-size: 10px; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase;
  text-align: center; line-height: 1.5;
  transition: background .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.capture-btn:hover, .capture-btn:focus-within { background: var(--cream); }
.capture-btn svg { width: 26px; height: 26px; stroke: var(--driftwood); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; }
.capture-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---------------- upload queue ---------------- */
.queue { list-style: none; margin: 20px 0 0; padding: 0; }
.qitem { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: var(--hair); }
.qthumb-wrap { position: relative; flex: 0 0 auto; }
.qthumb { width: 48px; height: 48px; border-radius: 2px; object-fit: cover; background: var(--cream); display: block; }
.qvideo {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--offwhite); font-size: 15px; text-shadow: 0 1px 4px rgba(0,0,0,.7); pointer-events: none;
}
.qmain { flex: 1; min-width: 0; }
.qname { font-size: 14px; font-weight: 400; color: var(--espresso); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qmeta { font-size: 12px; font-weight: 300; color: var(--warmstone); margin-top: 3px; }
.qmeta.err { color: var(--error); white-space: normal; }
.bar { height: 2px; background: var(--parchment); overflow: hidden; margin-top: 9px; }
.bar > i { display: block; height: 100%; width: 0; background: var(--espresso); transition: width .25s ease; }
.qstatus { flex: 0 0 auto; font-size: 11px; font-weight: 400; letter-spacing: .06em; color: var(--warmstone); min-width: 26px; text-align: right; }
.qstatus.done { color: var(--ok); font-size: 16px; }
.qstatus.fail { color: var(--error); font-size: 16px; }

/* ---------------- sticky action bar ---------------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--offwhite); border-top: var(--hair);
  padding: 14px 24px calc(14px + env(safe-area-inset-bottom));
}
.actionbar-inner { max-width: 760px; margin: 0 auto; }

/* ---------------- notices ---------------- */
.notice {
  padding: 14px 16px; font-size: 14px; font-weight: 300; line-height: 1.6;
  margin-bottom: 20px; border-left: 2px solid; border-radius: 0;
}
.notice-info  { background: var(--cream);    border-color: var(--linen);     color: var(--driftwood); }
.notice-warn  { background: var(--warn-bg);  border-color: var(--warn);      color: #6E5836; }
.notice-error { background: var(--error-bg); border-color: var(--error);     color: var(--error); }
.notice-ok    { background: var(--ok-bg);    border-color: var(--ok);        color: #43503A; }

/* ---------------- photo grids ---------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 4px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } }
.tile { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--cream); display: block; border-radius: 0; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vbadge {
  position: absolute; right: 6px; bottom: 6px;
  background: rgba(44,36,32,.82); color: var(--offwhite);
  font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 0;
}

/* ---------------- lists ---------------- */
.catlist { list-style: none; margin: 0; padding: 0; }
.catlist li { border-top: var(--hair); }
.catlist li:first-child { border-top: none; }
.catlist a {
  display: flex; align-items: center; gap: 14px; padding: 17px 2px;
  text-decoration: none; color: var(--espresso); min-height: var(--tap);
}
.catlist a:hover { color: var(--driftwood); }
.catlist .cname { flex: 1; font-size: 16px; font-weight: 400; }
.catlist .ccount { color: var(--warmstone); font-size: 13px; }
.catlist .chev { color: var(--linen); font-size: 18px; }

.pill {
  display: inline-block; font-size: 9px; font-weight: 400; letter-spacing: .1em;
  text-transform: uppercase; padding: 4px 9px; border-radius: 0;
  background: var(--espresso); color: var(--offwhite);
}
.pill.private { background: transparent; color: var(--warmstone); border: 0.5px solid var(--parchment); }
.pill.shared  { background: var(--linen); color: var(--espresso); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-weight: 300; }
table.tbl th {
  text-align: left; font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--warmstone); font-weight: 400; padding: 10px 10px 10px 0; border-bottom: var(--hair);
}
table.tbl td { padding: 13px 10px 13px 0; border-bottom: var(--hair); vertical-align: top; color: var(--walnut); }

.switch { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; cursor: pointer; min-height: var(--tap); }
.switch input { width: 20px; height: 20px; accent-color: var(--espresso); flex: 0 0 auto; margin: 2px 0 0; }
.switch .sw-main { flex: 1; }
.switch .sw-title { font-size: 15px; font-weight: 400; color: var(--espresso); }
.switch .sw-hint { font-size: 13px; font-weight: 300; color: var(--driftwood); line-height: 1.6; }

.footer {
  text-align: center; color: var(--warmstone); font-size: 9px;
  letter-spacing: .14em; text-transform: uppercase; padding: 48px 24px 24px;
}
.hidden { display: none !important; }
.center { text-align: center; }

/* ---------------- folder cards ---------------- */
.folder-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--parchment); border: var(--hair); margin-bottom: 8px; }
@media (max-width: 360px) { .folder-grid { grid-template-columns: 1fr; } }
.folder-card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  min-height: 116px; padding: 20px; text-decoration: none;
  background: var(--white); color: var(--espresso);
  transition: background .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.folder-card:hover, .folder-card:focus { background: var(--cream); color: var(--espresso); }
.folder-card .fc-name { font-family: var(--serif); font-size: 20px; font-weight: 400; line-height: 1.2; }
.folder-card .fc-meta { font-size: 11px; font-weight: 300; letter-spacing: .04em; color: var(--warmstone); }
.folder-card .pill { position: absolute; top: 14px; right: 14px; }

.copybox { background: var(--cream); padding: 14px 16px; border: var(--hair); }

/* ---------------- sign in ---------------- */
.login-wrap { max-width: 400px; margin: 0 auto; padding: 72px 28px 48px; }
.login-mark { text-align: center; margin-bottom: 40px; }
.login-mark .n { font-family: var(--serif); font-size: 32px; font-weight: 500; letter-spacing: .2em; color: var(--espresso); line-height: 1; }
.login-mark .t { color: var(--driftwood); font-size: 14px; font-weight: 300; margin-top: 14px; }

/* ---------------- setup steps ---------------- */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps > li { counter-increment: s; position: relative; padding: 0 0 4px 40px; margin-bottom: 28px; }
.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; background: var(--espresso); color: var(--offwhite);
  font-size: 11px; font-weight: 400; display: flex; align-items: center; justify-content: center;
}

/* ================================================================
   Client & agent view — the brand's public face
   ================================================================ */
body.client {
  background: var(--offwhite);
  display: flex; flex-direction: column; min-height: 100vh;
}
body.client .client-main { flex: 1 0 auto; }
body.client .client-foot { flex-shrink: 0; }

.client-top {
  background: var(--espresso);
  padding: 64px 32px 56px;
  padding-top: calc(64px + env(safe-area-inset-top));
}
.client-top-inner { max-width: 1100px; margin: 0 auto; }
.client-rule { width: 48px; height: 0.5px; background: var(--linen); margin-bottom: 28px; }
.client-brand {
  font-family: var(--serif); font-size: 22px; font-weight: 500;
  letter-spacing: .2em; color: var(--offwhite); margin-bottom: 28px;
}
.client-top h1 {
  font-family: var(--serif); font-size: clamp(32px, 6vw, 52px); font-weight: 300;
  color: var(--offwhite); line-height: 1.1; margin: 0; letter-spacing: 0;
}
.client-eyebrow {
  font-size: 10px; font-weight: 400; letter-spacing: .15em; text-transform: uppercase;
  color: var(--warmstone); margin-bottom: 18px;
}
.client-sub {
  font-family: var(--serif); font-size: 20px; font-weight: 300; font-style: italic;
  color: var(--linen); margin: 14px 0 0;
}

.client-main { max-width: 1100px; margin: 0 auto; padding: 8px 32px 72px; }
.client-section { margin-top: 56px; }
.client-section h2 {
  font-size: 10px; font-weight: 400; letter-spacing: .14em; text-transform: uppercase;
  color: var(--warmstone); margin: 0 0 18px; padding-bottom: 14px; border-bottom: var(--hair);
  display: flex; align-items: center; gap: 12px;
}
.client-section h2::after { display: none; }
.client-count { color: var(--linen); font-weight: 300; letter-spacing: 0; margin-left: auto; }
.client-main .tiles { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px; }
.client-empty { max-width: 520px; margin: 0 auto; padding: 88px 28px; text-align: center; }
.client-empty h1 { font-family: var(--serif); font-size: 30px; font-weight: 300; color: var(--espresso); }
.client-empty p { color: var(--driftwood); font-weight: 300; }
.client-note { text-align: center; color: var(--warmstone); font-size: 12px; font-weight: 300; margin-top: 56px; }
.client-foot {
  background: var(--espresso); color: var(--warmstone);
  font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
  text-align: center; padding: 40px 32px calc(40px + env(safe-area-inset-bottom));
}
.client-foot .fl { font-family: var(--serif); font-size: 18px; font-weight: 500; letter-spacing: .2em; color: var(--offwhite); text-transform: none; display: block; margin-bottom: 12px; }

/* lightbox — shared by the staff folder view and the client share page */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(44,36,32,.97);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  gap: 20px; padding: 24px 16px calc(20px + env(safe-area-inset-bottom));
  /* Swiping the viewer must not drag the page underneath it. */
  overscroll-behavior: contain; touch-action: pan-y;
}
.lightbox[hidden] { display: none; }
body.lb-open { overflow: hidden; }

.lb-stage {
  flex: 1 1 auto; min-height: 0; width: 100%;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.lightbox img, .lightbox video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 0; }
.lightbox video { background: #000; width: 100%; }
.lightbox video[hidden], .lightbox img[hidden] { display: none; }

.lb-spinner {
  position: absolute; width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid rgba(196,181,165,.28); border-top-color: var(--linen);
  animation: lb-spin .7s linear infinite;
}
.lb-spinner[hidden] { display: none; }
@keyframes lb-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lb-spinner { animation-duration: 2s; } }

.lb-close {
  position: absolute; top: 8px; right: 12px; width: 48px; height: 48px; z-index: 2;
  background: none; border: 0; color: var(--linen); font-size: 28px; line-height: 1; cursor: pointer;
}
.lb-close:hover { color: var(--offwhite); }

.lb-bar { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.lb-nav {
  width: 52px; height: 52px; border: 0.5px solid rgba(196,181,165,.5);
  background: transparent; color: var(--linen); font-size: 22px; line-height: 1; cursor: pointer;
}
.lb-nav:hover:not(:disabled) { background: rgba(196,181,165,.14); color: var(--offwhite); }
.lb-nav:disabled { opacity: .28; cursor: default; }
.lb-count {
  font-family: var(--sans); font-size: 11px; letter-spacing: .16em; color: var(--linen);
  min-width: 74px; text-align: center; font-variant-numeric: tabular-nums;
}
.lb-dl {
  color: var(--offwhite); text-decoration: none;
  font-size: 11px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase;
  padding: 15px 26px; border: 0.5px solid rgba(250,248,245,.55);
}
.lb-dl:hover { background: var(--offwhite); color: var(--espresso); }

.gallery-hint { margin: 0 0 10px; }

/* On a phone the arrows are a fallback — swiping is the primary gesture — so
   the bar stays compact and the photo keeps the room. */
@media (max-width: 520px) {
  .lightbox { padding: 16px 8px calc(14px + env(safe-area-inset-bottom)); gap: 14px; }
  .lb-dl { padding: 13px 18px; }
  .lb-bar { gap: 10px; }
}
