/* ESTEÉ & CO. Documents — house colours: ivory, navy (Pantone 289 C), brass. */
:root {
  --ivory: #F6F2EB;
  --paper: #FFFFFF;
  --navy: #0C2340;
  --ink: #1E2A3A;
  --muted: #6B7280;
  --line: #E4DDD0;
  --brass: #A98B5B;
  --brass-soft: rgba(169, 139, 91, .14);
  --danger: #9B2C2C;
  --ok: #2F6B4F;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--ivory); color: var(--ink); font-family: var(--sans); }
body { min-height: 100vh; min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }

/* top bar */
.bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 18px 10px; background: rgba(246, 242, 235, .94);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.bar .brand { height: 15px; display: block; }
.bar .grow { flex: 1; min-width: 0; }
.bar .who { font-size: 13px; color: var(--muted); }
.bar .title { font-size: 17px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .sub { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--brass); }

.btn {
  border: 1px solid var(--navy); background: var(--navy); color: #fff; border-radius: 2px;
  padding: 11px 18px; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; min-height: 44px;
}
.btn.ghost { background: transparent; color: var(--navy); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--navy); text-transform: none; letter-spacing: 0; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn:disabled { opacity: .45; cursor: default; }

.wrap { max-width: 980px; margin: 0 auto; padding: 28px 18px 80px; }
h1 { font-weight: 400; color: var(--navy); font-size: 30px; letter-spacing: -.01em; margin: 6px 0 4px; }
h2 { font-weight: 400; color: var(--navy); font-size: 19px; margin: 34px 0 12px; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--brass); }
.lead { color: var(--muted); margin: 0 0 18px; }

/* language switch */
.seg { display: inline-flex; border: 1px solid var(--navy); border-radius: 2px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 10px 18px; min-height: 44px; color: var(--navy); }
.seg button.on { background: var(--navy); color: #fff; }

/* document cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card {
  text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 2px;
  padding: 18px 18px 16px; min-height: 92px; display: flex; flex-direction: column; gap: 6px;
  transition: border-color .15s, transform .15s;
}
.card:active { transform: scale(.99); }
.card:hover { border-color: var(--brass); }
.card .t { font-size: 18px; color: var(--navy); line-height: 1.2; }
.card .d { font-size: 13px; color: var(--muted); }
.card .tag { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--brass); }

.notice { background: var(--paper); border: 1px solid var(--brass); padding: 14px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.notice .grow { flex: 1; min-width: 200px; }

/* the document being filled */
.doc { max-width: 1000px; margin: 0 auto; padding: 18px 10px 120px; }
.page {
  position: relative; margin: 0 auto 22px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 30px rgba(12,35,64,.08);
}
.page img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; pointer-events: none; }
.page .pno { position: absolute; right: 8px; bottom: -18px; font-size: 11px; color: var(--muted); }
.f {
  position: absolute; border: 0; margin: 0; padding: 0 2px; background: var(--brass-soft); color: var(--navy);
  font-family: "Tinos", "Times New Roman", serif; line-height: 1; border-radius: 1px; outline: none;
}
.f:focus { background: rgba(169, 139, 91, .28); box-shadow: 0 0 0 1px var(--brass); }
.f.ro { background: transparent; }
.f.ebg { font-family: "EB Garamond", serif; }
.f.center { text-align: center; }
.f.caps { text-transform: uppercase; }
textarea.f { resize: none; line-height: 1.22; padding-top: 2px; }
.chk { position: absolute; border: 0; background: var(--brass-soft); padding: 0; border-radius: 1px; }
.chk svg { width: 100%; height: 100%; display: block; }
.chk.on { background: transparent; }
.sig {
  position: absolute; border: 1px dashed var(--brass); background: rgba(255,255,255,.6); border-radius: 2px;
  display: flex; align-items: center; justify-content: center; padding: 0; color: var(--brass);
  font-size: calc(var(--k) * 6.2px); letter-spacing: .06em; text-transform: uppercase; overflow: hidden;
}
.sig.done { border-color: transparent; background: transparent; }
.sig img { max-width: 100%; max-height: 100%; object-fit: contain; object-position: left bottom; width: 100%; height: 100%; }
.sig.missing { animation: pulse 1.2s ease-in-out 2; }
@keyframes pulse { 50% { background: rgba(155, 44, 44, .18); border-color: var(--danger); } }

/* bottom action bar on the document */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; gap: 10px; align-items: center;
  padding: 12px 18px max(12px, env(safe-area-inset-bottom)); background: rgba(246, 242, 235, .96);
  border-top: 1px solid var(--line); backdrop-filter: blur(8px);
}
.dock .grow { flex: 1; font-size: 13px; color: var(--muted); }

/* sheets and modals */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(12, 35, 64, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sheet { background: var(--ivory); width: min(760px, 100%); border-radius: 3px; padding: 22px; max-height: 92vh; overflow: auto; }
.sheet h3 { font-weight: 400; color: var(--navy); font-size: 21px; margin: 0 0 4px; }
.sheet .row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.pad { width: 100%; height: 260px; background: #fff; border: 1px solid var(--line); touch-action: none; display: block; border-radius: 2px; }
.pad.small { height: 200px; }
.padhint { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin: 8px 2px 0; }
label.opt { display: flex; gap: 10px; align-items: center; margin-top: 12px; font-size: 15px; }
label.opt input { width: 22px; height: 22px; accent-color: var(--navy); }

/* forms in sheets / finish */
.field { display: block; margin: 14px 0; }
.field span { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--brass); margin-bottom: 6px; }
.field input { width: 100%; border: 1px solid var(--line); background: #fff; padding: 12px 12px; font-size: 17px; border-radius: 2px; min-height: 48px; }
.field input:focus { outline: none; border-color: var(--navy); }
.list { list-style: none; padding: 0; margin: 8px 0 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.list li button { margin-left: auto; }
.okmark { color: var(--ok); }
.warn { color: var(--danger); }

/* archive */
.search { width: 100%; border: 1px solid var(--line); background: #fff; padding: 14px; font-size: 17px; border-radius: 2px; }
.rows { margin-top: 14px; background: #fff; border: 1px solid var(--line); }
.rowi { display: grid; grid-template-columns: 110px 1fr auto; gap: 4px 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.rowi:last-child { border-bottom: 0; }
.rowi .no { color: var(--navy); font-size: 16px; }
.rowi .what { font-size: 15px; }
.rowi .meta { font-size: 12px; color: var(--muted); }
.rowi .acts { display: flex; gap: 6px; }
.empty { color: var(--muted); padding: 30px 0; text-align: center; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 60; background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 2px; font-size: 14px; max-width: 90vw; }
.spin { width: 28px; height: 28px; border: 2px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: s 1s linear infinite; margin: 0 auto; }
@keyframes s { to { transform: rotate(360deg); } }

/* login */
.login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login form { width: min(380px, 100%); background: #fff; border: 1px solid var(--line); padding: 34px 28px; text-align: center; }
.login img.emb { width: 54px; margin-bottom: 14px; }
.login img.wm { width: 200px; display: block; margin: 0 auto 26px; }
.login .err { color: var(--danger); min-height: 20px; font-size: 14px; margin: 8px 0 0; }

@media (max-width: 640px) {
  .wrap { padding: 20px 14px 80px; }
  h1 { font-size: 28px; }
  .rowi { grid-template-columns: 1fr auto; }
  .rowi .no { grid-column: 1 / -1; }
  .bar .who { display: none; }
}
