/* === DaCucina login screen — centred slab (approved concept 2026-09-24) — scoped to .dc-login only ===
   The existing #login-screen container carries .dc-login; the ORIGINAL form (ids username / password / login-btn / login-error,
   handlers in app.js) is kept untouched inside .dc-login__form. Nothing here targets other screens.
   Layers: .dc-login__scene = pointer depth (translate) · .dc-login__scene-img = entrance zoom (scale) · vignette · drafting grid ·
   corner marks · title block / stamp / scale bar / tagline in the margins · .dc-login__center (flex centring, scrolls on short
   viewports) · .dc-login__panel = the slab (LED ring, inner frame, top bronze line, floor shadow via ::after).
   Motion: entrance zoom + slab rise + 100ms stagger; LED light travelling around the frame; depth by pointer (JS).
   prefers-reduced-motion / phones: no motion (static ring), form usable from the first frame. */
.dc-login {
  --dc-ink: #2b2621;
  --dc-muted: #6f6559;
  --dc-bronze: #a78050;
  --dc-bronze-deep: #8a6636;
  --dc-led: #c9a468;
  --dc-depth-x: 24px;
  --dc-depth-y: 16px;
  position: fixed;
  inset: 0;
  isolation: isolate;
  overflow: hidden auto;
  background: #e9e1d3;
  color: var(--dc-ink);
  font-family: 'Heebo', var(--font-sans, sans-serif);
  padding: 0;
}
/* the legacy .login-screen.active rule centres a card with flex; the centre wrapper below does the centring now */
.dc-login.login-screen.active {
  display: block;
}
.dc-login,
.dc-login * {
  box-sizing: border-box;
}

/* ---- background: depth wrapper (pointer translate) + zoom layer (entrance scale) ---- */
.dc-login__scene {
  position: fixed;
  inset: -48px;                       /* > max depth + zoom overscan → no exposed edges while moving */
  z-index: -2;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
}
.dc-login__scene-img {
  position: absolute;
  inset: 0;
  background: url("assets/login/dacucina-kitchen.webp") center center / cover no-repeat;
  transform: scale(1);
  transform-origin: 50% 50%;
}
.dc-login--img-ready .dc-login__scene-img {
  animation: dcLoginZoom 2s cubic-bezier(.22, .61, .36, 1) both;
}
@keyframes dcLoginZoom {
  from { transform: scale(1.05); }
  to   { transform: scale(1); }
}
.dc-login__vignette {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 55%, rgba(233, 225, 211, 0) 30%, rgba(60, 44, 24, .22) 100%);
}
.dc-login__grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(rgba(43, 38, 33, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(43, 38, 33, .05) 1px, transparent 1px);
  background-size: 120px 120px;
  opacity: 0;
}
.dc-login--enter .dc-login__grid { animation: dcLoginFade 1.8s .4s both; }
@keyframes dcLoginFade { from { opacity: 0; } to { opacity: 1; } }
.dc-login:not(.dc-login--enter) .dc-login__grid { opacity: 1; }

/* ---- drafting-sheet margins: corner marks, title block, stamp, scale bar, tagline ---- */
.dc-login__mark {
  position: fixed;
  width: 20px;
  height: 20px;
  border: 0 solid rgba(43, 38, 33, .5);
  pointer-events: none;
}
.dc-login__mark--tl { top: 28px; left: 28px; border-top-width: 1px; border-left-width: 1px; }
.dc-login__mark--tr { top: 28px; right: 28px; border-top-width: 1px; border-right-width: 1px; }
.dc-login__mark--bl { bottom: 28px; left: 28px; border-bottom-width: 1px; border-left-width: 1px; }
.dc-login__mark--br { bottom: 28px; right: 28px; border-bottom-width: 1px; border-right-width: 1px; }

.dc-login__block {
  position: fixed;
  top: 48px;
  left: 56px;
  direction: ltr;
  text-align: left;
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--dc-ink);
  display: flex;
  flex-direction: column;
  gap: 14px;
  pointer-events: none;
}
.dc-login__block-brand { font-size: 12px; letter-spacing: .36em; font-weight: 500; }
.dc-login__block-rule { width: 1px; height: 56px; background: var(--dc-ink); opacity: .55; transform-origin: center top; }
.dc-login__block-meta { font-size: 12px; letter-spacing: .26em; line-height: 2; opacity: .8; }

.dc-login__stamp {
  position: fixed;
  top: 48px;
  right: 56px;
  direction: ltr;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 12px;
  letter-spacing: .3em;
  color: var(--dc-ink);
  opacity: .75;
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: none;
}
.dc-login__stamp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dc-ink); }
.dc-login--enter .dc-login__stamp-dot { animation: dcLoginBlink 2.4s ease-in-out infinite; }
@keyframes dcLoginBlink { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

.dc-login__scale {
  position: fixed;
  bottom: 48px;
  left: 56px;
  direction: ltr;
  display: flex;
  align-items: flex-end;
  pointer-events: none;
}
.dc-login__scale-seg { width: 28px; height: 5px; border: 1px solid var(--dc-ink); border-left: 0; }
.dc-login__scale-seg:first-child { border-left: 1px solid var(--dc-ink); }
.dc-login__scale-seg--fill { background: var(--dc-ink); }
.dc-login__scale-label { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 11px; letter-spacing: .22em; margin-left: 12px; line-height: 1; color: var(--dc-ink); }

.dc-login__tagline {
  position: fixed;
  bottom: 48px;
  right: 56px;
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--dc-ink);
  opacity: .75;
  pointer-events: none;
}

/* ---- centring wrapper: full height, scrolls when the slab is taller than the viewport ---- */
.dc-login__center {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 16px;
}

/* ---- the slab ---- */
.dc-login__panel {
  position: relative;
  width: 470px;
  max-width: 100%;
  padding: 46px 46px 38px;
  background: rgba(248, 243, 234, .9);
  border-radius: 18px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .7), 0 34px 80px rgba(52, 38, 20, .28), 0 0 90px rgba(255, 234, 196, .45);
}
@supports (backdrop-filter: blur(26px)) {
  .dc-login__panel {
    background: rgba(248, 243, 234, .82);
    backdrop-filter: blur(26px);
    -webkit-backdrop-filter: blur(26px);
  }
}
/* floor shadow — anchors the slab to the counter */
.dc-login__panel::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  margin-top: 8px;
  width: 88%;
  height: 56px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(52, 38, 20, .38) 0%, rgba(52, 38, 20, 0) 70%);
  filter: blur(6px);
  pointer-events: none;
  z-index: -1;
}
.dc-login__frame {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(151, 111, 65, .55);
  border-radius: 12px;
  pointer-events: none;
}
.dc-login__topline {
  position: absolute;
  top: 0;
  left: 46px;
  right: 46px;
  height: 2px;
  background: var(--dc-bronze);
  border-radius: 0 0 2px 2px;
  opacity: .9;
  pointer-events: none;
}
/* LED light travelling around the slab's edge: a rotating conic gradient masked to a 2px ring */
.dc-login__led {
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  padding: 2px;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.dc-login__led-spin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1100px;
  height: 1100px;
  margin: -550px 0 0 -550px;
  background: conic-gradient(from 0deg, rgba(201, 164, 104, 0) 0deg, rgba(201, 164, 104, 0) 250deg, rgba(201, 164, 104, .55) 300deg, #fff1cf 330deg, rgba(201, 164, 104, .55) 350deg, rgba(201, 164, 104, 0) 360deg);
  animation: dcLoginLed 7s linear infinite;
}
@keyframes dcLoginLed { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.dc-login__content {
  position: relative;
  display: flex;
  flex-direction: column;
}

/* logo: entrance reveal + light sweep once, and a light sweep + lift + bronze underline on hover */
.dc-login__logo-wrap {
  position: relative;
  width: 292px;
  max-width: 100%;
  margin: 4px auto 30px;
  cursor: default;
  transition: transform .45s cubic-bezier(.22, .61, .36, 1);
}
.dc-login__logo {
  display: block;
  width: 100%;
  height: auto;
  max-height: 150px;
  object-fit: contain;
  transition: filter .45s ease;
}
.dc-login__logo-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, rgba(255, 241, 207, 0) 38%, rgba(255, 241, 207, .95) 50%, rgba(201, 164, 104, .9) 54%, rgba(255, 241, 207, 0) 64%);
  background-size: 260% 100%;
  background-position: 140% 0;
  -webkit-mask: url("assets/login/dacucina-logo-dark.png") center / contain no-repeat;
  mask: url("assets/login/dacucina-logo-dark.png") center / contain no-repeat;
  opacity: 0;
}
.dc-login__logo-line {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: -12px;
  height: 1px;
  background: var(--dc-bronze);
  opacity: .8;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .55s cubic-bezier(.22, .61, .36, 1);
  pointer-events: none;
}
.dc-login__logo-wrap:hover { transform: translateY(-2px); }
.dc-login__logo-wrap:hover .dc-login__logo { filter: drop-shadow(0 6px 14px rgba(106, 74, 38, .22)); }
.dc-login__logo-wrap:hover .dc-login__logo-shine { animation: dcLoginShine 1.1s cubic-bezier(.22, .61, .36, 1) both; }
.dc-login__logo-wrap:hover .dc-login__logo-line { transform: scaleX(1); }
.dc-login--enter .dc-login__logo-shine { animation: dcLoginShine 1.3s 1.35s cubic-bezier(.22, .61, .36, 1) both; }
@keyframes dcLoginShine {
  0%   { opacity: 0; background-position: 140% 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { opacity: 0; background-position: -40% 0; }
}

.dc-login__heading {
  text-align: center;
  margin-bottom: 30px;
}
.dc-login__greeting {
  min-height: 18px;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--dc-bronze-deep);
  margin-bottom: 8px;
}
.dc-login__heading h1 {
  margin: 0 0 6px;
  font-family: 'Frank Ruhl Libre', 'David', serif;
  font-weight: 300;
  font-size: 30px;
  white-space: nowrap;
}
.dc-login__nowrap {
  white-space: nowrap;
  line-height: 1.15;
  color: var(--dc-ink);
}
.dc-login__heading p {
  margin: 0;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  color: var(--dc-muted);
}

/* the original .login-form / .form-row / .form-field wrappers get the dc classes; their legacy flex rules are neutralised */
.dc-login .dc-login__form {
  display: grid;
  gap: 18px;
  width: 100%;
  margin: 0;
}
.dc-login .dc-login__form .form-row {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
  margin: 0;
}
.dc-login .dc-login__field {
  min-width: 0;
  display: block;
}
.dc-login .dc-login__field label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--dc-muted);
  transition: color .2s;
}
.dc-login .dc-login__field:focus-within label { color: var(--dc-bronze-deep); }
.dc-login .dc-login__field input {
  width: 100%;
  height: 56px;
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid #bfb3a2;
  border-radius: 10px;
  background: rgba(255, 255, 255, .55);
  color: var(--dc-ink);
  font: inherit;
  font-size: 17px;
  box-shadow: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.dc-login .dc-login__field input::placeholder { color: #a79b8b; }
/* browser autofill: keep the cream field instead of the browser's blue tint */
.dc-login .dc-login__field input:-webkit-autofill,
.dc-login .dc-login__field input:-webkit-autofill:hover,
.dc-login .dc-login__field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fbf8f1 inset;
  box-shadow: 0 0 0 1000px #fbf8f1 inset;
  -webkit-text-fill-color: var(--dc-ink);
  caret-color: var(--dc-ink);
  transition: background-color 9999s ease-out 0s;
}
.dc-login .dc-login__field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fbf8f1 inset, 0 0 0 3px rgba(167, 128, 80, .18);
  box-shadow: 0 0 0 1000px #fbf8f1 inset, 0 0 0 3px rgba(167, 128, 80, .18);
}
.dc-login .dc-login__field input:hover { border-color: #a89b88; }
.dc-login .dc-login__field input:focus,
.dc-login .dc-login__field input:focus-visible {
  outline: 0;
  border-color: var(--dc-bronze);
  box-shadow: 0 0 0 3px rgba(167, 128, 80, .18);
  background: rgba(255, 255, 255, .75);
}
.dc-login__pw { position: relative; }
.dc-login .dc-login__pw input { padding-left: 52px; }
.dc-login__eye {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8a7e70;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.dc-login__eye:hover { color: #5c4228; background: rgba(43, 38, 33, .05); }
.dc-login__eye:focus-visible { outline: 2px solid var(--dc-bronze); }
.dc-login__eye .dc-login__eye-off { display: none; }
.dc-login__eye.is-on .dc-login__eye-open { display: none; }
.dc-login__eye.is-on .dc-login__eye-off { display: block; }

.dc-login .dc-login__submit {
  width: 100%;
  height: 58px;
  min-height: 58px;
  margin-top: 12px;
  padding: 0 22px;
  border: 1px solid #7b5a30;
  border-radius: 10px;
  background: var(--dc-bronze-deep);
  color: #fbf6ec;
  font: inherit;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: .03em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(106, 74, 38, .22);
  transition: background .2s, box-shadow .2s, transform .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transform: none;
}
.dc-login .dc-login__submit:hover:not(:disabled) {
  background: #74542c;
  box-shadow: 0 14px 30px rgba(106, 74, 38, .3);
  transform: translateY(-1px);
  filter: none;
}
.dc-login .dc-login__submit:active:not(:disabled) { transform: none; }
.dc-login .dc-login__submit:focus-visible {
  outline: 2px solid var(--dc-ink);
  outline-offset: 4px;
}
.dc-login .dc-login__submit:disabled {
  opacity: .7;
  cursor: wait;
  transform: none;
}

/* the existing error box keeps its behaviour; only its colours are adapted to the light panel */
.dc-login #login-error {
  color: #9b2c2c !important;
  background: rgba(220, 38, 38, .08) !important;
  border-right-color: #b91c1c !important;
}

.dc-login__footer {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-family: 'Frank Ruhl Libre', 'David', serif;
  font-size: 13px;
  letter-spacing: .2em;
  color: var(--dc-muted);
  text-align: center;
}
.dc-login__footer-rule { display: block; width: 64px; height: 1px; background: rgba(43, 38, 33, .3); }

/* ---- entrance: slab rises, content fades in with a stagger (opacity/translate only — inputs usable immediately) ---- */
.dc-login--enter .dc-login__panel {
  animation: dcLoginSlab 1s .2s cubic-bezier(.22, .61, .36, 1) both;
}
@keyframes dcLoginSlab {
  from { opacity: 0; transform: translate3d(0, 26px, 0) scale(.985); }
  to   { opacity: 1; transform: none; }
}
.dc-login--enter .dc-login__logo-wrap,
.dc-login--enter .dc-login__heading,
.dc-login--enter .dc-login__field,
.dc-login--enter #login-error,
.dc-login--enter .dc-login__submit,
.dc-login--enter .dc-login__footer,
.dc-login--enter .dc-login__block,
.dc-login--enter .dc-login__stamp,
.dc-login--enter .dc-login__scale,
.dc-login--enter .dc-login__tagline {
  animation: dcLoginRise .6s cubic-bezier(.22, .61, .36, 1) both;
}
.dc-login--enter .dc-login__logo-wrap { animation-delay: .55s; }
.dc-login--enter .dc-login__heading   { animation-delay: .65s; }
.dc-login--enter .dc-login__field:nth-of-type(1) { animation-delay: .75s; }
.dc-login--enter .dc-login__field:nth-of-type(2) { animation-delay: .85s; }
.dc-login--enter #login-error         { animation-delay: .9s; }
.dc-login--enter .dc-login__submit    { animation-delay: .95s; }
.dc-login--enter .dc-login__footer    { animation-delay: 1.05s; }
.dc-login--enter .dc-login__block,
.dc-login--enter .dc-login__stamp,
.dc-login--enter .dc-login__scale,
.dc-login--enter .dc-login__tagline   { animation-delay: 1.2s; }
.dc-login--enter .dc-login__block-rule { animation: dcLoginDrawV 1s .9s cubic-bezier(.22, .61, .36, 1) both; }
@keyframes dcLoginRise {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to   { opacity: 1; transform: none; }
}
@keyframes dcLoginDrawV { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* tab hidden → every login animation paused (JS toggles the class on visibilitychange) */
.dc-login--paused .dc-login__scene-img,
.dc-login--paused .dc-login__grid,
.dc-login--paused .dc-login__panel,
.dc-login--paused .dc-login__logo-wrap,
.dc-login--paused .dc-login__logo-shine,
.dc-login--paused .dc-login__heading,
.dc-login--paused .dc-login__field,
.dc-login--paused .dc-login__submit,
.dc-login--paused .dc-login__footer,
.dc-login--paused .dc-login__block,
.dc-login--paused .dc-login__block-rule,
.dc-login--paused .dc-login__stamp,
.dc-login--paused .dc-login__stamp-dot,
.dc-login--paused .dc-login__scale,
.dc-login--paused .dc-login__tagline,
.dc-login--paused .dc-login__led-spin {
  animation-play-state: paused;
}

@media (max-width: 760px) {
  .dc-login__center { padding: 24px 16px; }
  .dc-login__panel { padding: 34px 26px 26px; }
  .dc-login__topline { left: 26px; right: 26px; }
  .dc-login__frame { inset: 8px; }
  .dc-login__logo-wrap { width: 210px; margin-bottom: 22px; }
  .dc-login__logo { max-height: 110px; }
  .dc-login__heading { margin-bottom: 22px; }
  .dc-login__heading h1 { font-size: 24px; white-space: normal; }
  .dc-login__heading p { font-size: 14px; }
  .dc-login .dc-login__field input { height: 54px; min-height: 54px; font-size: 16px; }
  .dc-login .dc-login__submit { height: 56px; min-height: 56px; font-size: 17px; }
  .dc-login__footer { margin-top: 22px; }
  .dc-login__block { top: 52px; left: 22px; gap: 10px; }
  .dc-login__block-brand, .dc-login__block-meta { font-size: 10px; }
  .dc-login__block-rule { height: 30px; }
  .dc-login__mark--tl, .dc-login__mark--tr { top: 16px; }
  .dc-login__mark--tl, .dc-login__mark--bl { left: 16px; }
  .dc-login__mark--tr, .dc-login__mark--br { right: 16px; }
  .dc-login__mark--bl, .dc-login__mark--br { bottom: 16px; }
  .dc-login__stamp,
  .dc-login__scale,
  .dc-login__tagline { display: none; }
  .dc-login__scene { inset: 0; transform: none !important; }
  .dc-login__scene-img { background-position: 42% center; animation: none !important; }   /* stable background on phones */
}

/* short viewports: the slab stays reachable by scrolling; tighter vertical rhythm */
@media (max-height: 700px) {
  .dc-login__center { padding: 40px 16px; }
  .dc-login__panel { padding: 30px 40px 26px; }
  .dc-login__logo-wrap { margin-bottom: 16px; }
  .dc-login__logo { max-height: 96px; }
  .dc-login__heading { margin-bottom: 18px; }
  .dc-login__heading h1 { font-size: 28px; }
  .dc-login__footer { margin-top: 18px; }
  .dc-login__block, .dc-login__stamp, .dc-login__scale, .dc-login__tagline { display: none; }
}

/* Round B (2026-09-24, Raphael): the login decorations no longer follow the OS "reduce motion" flag — company PCs have Windows
   animation effects switched off, which made browsers hide every login animation. Motion stays off on phones (above). */
