/* LAYOUT ONLY. The cover picture, its wording and its colours live in cover.css, never here. */
:root {
  --paper: #ffffff;
  --ink: #17261e;
  --muted: #66746b;
  --line: #d9ded8;
  --soft: #f3f6f2;
  --err: #a52a2a;
  --brand-red: #c31728;      /* the logo's own red, from the Corporate Profile */
  --radius: 28px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #e9efe4;
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Noto Sans SC", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* ---------- computer: one full picture, the sign-in card floats on the right ---------- */
.shell {
  position: relative;
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: flex-end;
  padding: 32px clamp(24px, 5.5vw, 84px);
  overflow: hidden;
}
.cover {
  position: absolute; inset: 0;
  background-color: #cfe0c3;
  background-image: var(--cover-image), var(--cover-fallback);
  background-size: cover, cover;
  background-position: var(--cover-focus), center;
  background-repeat: no-repeat;
}
.cover::after {              /* soft shade under the cover text so it reads on any picture */
  content: ""; position: absolute; inset: 0; background: var(--cover-shade);
}
.brand {
  position: absolute; z-index: 1;
  left: clamp(32px, 6vw, 96px); top: clamp(36px, 9vh, 96px);
  max-width: min(46vw, 560px);
  color: var(--cover-ink);
}
.plate {                    /* white plate keeps the red logo exactly as approved: red on white */
  display: inline-flex; padding: 16px 24px; border-radius: 18px;
  background: #fff; box-shadow: 0 10px 34px rgba(20, 60, 40, 0.14);
}
.logo { display: block; height: 84px; width: auto; }
.greet {
  margin: clamp(24px, 5vh, 56px) 0 0; font-size: clamp(30px, 3.4vw, 50px); line-height: 1.12; font-weight: 500; letter-spacing: -0.015em;
}
.slogan { margin-top: clamp(24px, 5vh, 56px); text-shadow: 0 1px 16px rgba(0, 0, 0, 0.18); }
.slogan .s1 { margin: 0; font-size: clamp(30px, 3.4vw, 50px); line-height: 1.12; font-weight: 500; letter-spacing: -0.015em; }
.slogan .s2 { margin: 12px 0 0; font-size: 14px; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 600; color: var(--cover-ink-soft); }
.greet:not([hidden]) + .slogan { display: none; }
.datebox {
  position: absolute; z-index: 1; left: clamp(32px, 6vw, 96px); bottom: clamp(32px, 7vh, 72px);
  color: var(--cover-ink); text-shadow: 0 1px 14px rgba(0, 0, 0, 0.10);
}
.dow { font-size: 14px; letter-spacing: 0.28em; text-transform: uppercase; font-weight: 600; color: var(--cover-ink-soft); }
.day { font-size: clamp(76px, 9.5vw, 132px); line-height: 0.95; font-weight: 200; letter-spacing: -0.04em; margin: 4px 0 6px; }
.mon { font-size: clamp(18px, 1.7vw, 24px); font-weight: 400; letter-spacing: 0.02em; }
.lunar { margin-top: 2px; font-size: 15px; color: var(--cover-ink-soft); }
.chip {
  display: inline-block; margin-top: 14px; padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 500;
  color: var(--cover-ink); background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.45);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
body[data-ink="dark"] .chip { background: rgba(255, 255, 255, 0.55); border-color: rgba(23, 48, 31, 0.25); }

.panel { position: relative; z-index: 1; width: min(480px, 100%); }
.card {
  position: relative;
  background: var(--paper); border-radius: var(--radius);
  padding: 34px 40px 28px;
  box-shadow: 0 30px 80px rgba(20, 50, 34, 0.22);
}

.lang {
  display: flex; align-items: center; justify-content: flex-end; gap: 4px;
  margin: -8px -14px 8px 0; color: var(--ink); font-size: 14px;
}
.lang svg { width: 20px; height: 20px; margin-right: 6px; color: var(--ink); }
.lang button {
  min-height: 36px; min-width: 40px; padding: 0 8px; border: 0; background: transparent;
  color: var(--muted); font: inherit; font-size: 15px; letter-spacing: 0.02em; cursor: pointer; border-radius: 8px;
}
.lang button[aria-pressed="true"] { color: var(--ink); font-weight: 700; }
.lang .bar { color: var(--line); user-select: none; }

.welcome { margin: 22px 0 0; font-size: 30px; line-height: 1.15; font-weight: 500; letter-spacing: -0.01em; }
h1 { margin: 0; font-size: 33px; line-height: 1.15; letter-spacing: -0.015em; font-weight: 700; color: var(--accent-dark); }
.sub { margin: 10px 0 26px; color: var(--muted); font-size: 17px; }

form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.group { }
.box {
  display: flex; align-items: stretch;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.box.bad { border-color: var(--err); }
.ico {
  flex: 0 0 56px; display: grid; place-items: center; background: var(--soft); border-right: 1.5px solid var(--line); color: var(--ink);
}
.ico svg { width: 24px; height: 24px; }
.box input {
  flex: 1; min-width: 0; min-height: 54px; padding: 0 16px; border: 0; outline: 0; background: transparent;
  color: var(--ink); font: inherit; font-size: 18px;
}
.box input::placeholder { color: #9aa59d; }
.box input.pin { letter-spacing: 0.4em; font-size: 22px; }
.box input.pin::placeholder { letter-spacing: 0; font-size: 18px; }
.peek {
  flex: 0 0 52px; display: grid; place-items: center; border: 0; background: transparent; color: var(--ink); cursor: pointer;
}
.peek svg { width: 24px; height: 24px; }
.peek .off { display: none; }
.peek[aria-pressed="true"] .on { display: none; }
.peek[aria-pressed="true"] .off { display: block; }
.hint { margin: 6px 0 0 4px; font-size: 14px; color: var(--muted); }
.error { margin: 0; min-height: 20px; font-size: 14px; color: var(--err); }

.go {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 56px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-size: 19px; font-weight: 600;
  transition: background .15s, transform .05s;
}
.go svg { width: 22px; height: 22px; }
.go:hover { background: var(--accent-dark); }
.go:active { transform: translateY(1px); }
.go:focus-visible, .lang button:focus-visible, .peek:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.help { margin: 18px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.mock-note { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 13px; background: var(--soft); color: #2c4a38; text-align: center; }
.secure {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.secure svg { width: 18px; height: 18px; color: #7d8a82; }
.secure .sep { color: var(--line); }

/* ---------- phone and narrow windows: one column, the picture becomes a banner ---------- */
@media (max-width: 860px) {
  .shell { display: block; padding: 0; min-height: 100dvh; background: var(--paper); }
  .cover { position: relative; inset: auto; height: clamp(230px, 34vh, 300px); }
  .brand { left: 16px; top: 16px; max-width: none; }
  .plate { padding: 10px 14px; border-radius: 14px; }
  .logo { height: 52px; }
  .greet, .slogan { display: none; }
  .datebox { left: 18px; bottom: auto; top: calc(clamp(230px, 34vh, 300px) - 156px); }
  .dow { font-size: 11px; }
  .day { font-size: 54px; margin: 2px 0 2px; }
  .mon { font-size: 15px; }
  .lunar { font-size: 12px; }
  .chip { margin-top: 8px; padding: 4px 10px; font-size: 12px; }
  .panel { width: 100%; margin-top: -26px; }
  .card { border-radius: 26px 26px 0 0; padding: 20px 20px 28px; box-shadow: 0 -10px 30px rgba(20, 50, 34, 0.14); min-height: calc(100dvh - clamp(230px, 34vh, 300px) + 26px); }
  .lang { margin: 0 -6px 0 0; }
  .welcome { margin-top: 10px; font-size: 24px; }
  h1 { font-size: 28px; }
  .sub { margin-bottom: 20px; font-size: 16px; }
  .box input { font-size: 16px; }    /* 16px stops iPhone Safari zooming into the field */
  .box input.pin { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 860px) { .lang button { min-height: 44px; min-width: 44px; } }

/* ---------- pages after sign-in (home, set PIN, plain messages): same card, same look ---------- */
.desks { list-style: none; margin: 18px 0 8px; padding: 0; display: grid; gap: 10px; }
.desks li { margin: 0; }
.desks a, .desks .off {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--line);
  background: #fff; color: var(--ink); text-decoration: none; font-size: 18px; font-weight: 600;
  overflow-wrap: anywhere;
}
.desks a:hover { border-color: var(--accent); }
.desks a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.desks .off { color: var(--muted); font-weight: 500; background: var(--soft); flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.desks .off span:first-child { flex: 1 1 12ch; min-width: 0; }
.desks .note { flex: 0 0 auto; font-size: 13px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.go.quiet { background: transparent; color: var(--ink); border: 1.5px solid var(--line); margin-top: 8px; width: 100%; }
.go.quiet:hover { background: var(--soft); }
.plain { max-width: 440px; margin: 12vh auto; padding: 0 24px; text-align: center; }
.plain .logo { height: 56px; width: auto; }
.plain a { color: var(--accent); }
