:root {
  --ink: #211b18;
  --paper: #f6f1ea;
  --wine: #7f2434;
  --wine-dark: #651a28;
  --muted: #7d746d;
  --line: #ded6cc;
  --sans: Arial, Helvetica, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 15% 10%, rgba(184, 53, 67, .32), transparent 33%), radial-gradient(circle at 86% 92%, rgba(43, 56, 121, .2), transparent 32%), linear-gradient(145deg, #1d1111, #4d1720 56%, #171117);
  font-family: var(--sans);
}
button, input { font: inherit; }
.login-shell { min-height: 100svh; display: grid; place-items: center; padding: 14px; }
.login-card {
  width: min(100%, 430px);
  max-height: calc(100svh - 28px);
  overflow: auto;
  padding: clamp(18px, 4vh, 34px) clamp(20px, 4vw, 38px);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 24px;
  background: rgba(250, 247, 242, .97);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .38);
  text-align: center;
}
.login-logo { display: block; width: clamp(104px, 18vh, 154px); height: clamp(104px, 18vh, 154px); margin: 0 auto 6px; object-fit: contain; }
.product-name { margin: 0; color: var(--wine); font-size: 11px; font-weight: 800; letter-spacing: .19em; text-transform: uppercase; }
.login-card h1 { margin: 6px 0 2px; font: 42px/1 var(--serif); }
.intro { margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.login-card form { text-align: left; }
.login-card form > label:not(.trust-device) { display: block; margin-bottom: 12px; }
.login-card label > span:first-child { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 700; }
.login-card input[type="text"], .login-card input[type="password"] { width: 100%; height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: #fff; color: var(--ink); font-size: 14px; transition: .18s; }
.login-card input:focus { border-color: var(--wine); box-shadow: 0 0 0 3px rgba(127, 36, 52, .11); }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 82px !important; }
.password-field button { position: absolute; top: 50%; right: 11px; transform: translateY(-50%); padding: 6px; border: 0; background: transparent; color: var(--wine); font-size: 10px; font-weight: 800; cursor: pointer; }
.trust-device { display: flex; align-items: flex-start; gap: 9px; margin: 2px 0 15px; cursor: pointer; }
.trust-device input { margin: 2px 0 0; accent-color: var(--wine); }
.trust-device span { margin: 0 !important; }
.trust-device strong, .trust-device small { display: block; }
.trust-device strong { font-size: 11px; }
.trust-device small { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.submit-button { width: 100%; height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 17px; border: 0; border-radius: 10px; background: var(--wine); color: #fff; font-size: 12px; font-weight: 800; cursor: pointer; }
.submit-button:hover { background: var(--wine-dark); }
.submit-button b { font-size: 19px; font-weight: 400; }
.form-alert { margin: 0 0 12px; padding: 10px 12px; border: 1px solid #dca9af; border-radius: 9px; background: #fff0f1; color: #792432; font-size: 11px; text-align: left; }
.setup-notice { display: grid; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; }
.setup-notice strong { font: 21px var(--serif); }
.setup-notice span { color: var(--muted); font-size: 12px; }
.setup-notice a { color: var(--wine); font-size: 11px; font-weight: 700; text-decoration: none; }
.pwa-install.compact { margin-top: 10px; padding: 9px 11px; border-radius: 9px; background: #eee8df; text-align: left; }
.pwa-install.compact strong, .pwa-install.compact span { display: block; }
.pwa-install.compact strong { font-size: 10px; }
.pwa-install.compact span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.pwa-install-button { width: 100%; margin-top: 9px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--wine); font-size: 10px; font-weight: 800; cursor: pointer; }
@media (max-height: 670px) {
  .login-card { padding-top: 14px; padding-bottom: 14px; }
  .login-logo { width: 88px; height: 88px; }
  .login-card h1 { font-size: 34px; }
  .intro { margin-bottom: 11px; }
  .login-card form > label:not(.trust-device) { margin-bottom: 9px; }
  .login-card input[type="text"], .login-card input[type="password"] { height: 42px; }
  .trust-device { margin-bottom: 10px; }
  .submit-button { height: 44px; }
}
@media (max-width: 480px) {
  .login-shell { padding: 10px; }
  .login-card { max-height: calc(100svh - 20px); border-radius: 20px; padding-left: 20px; padding-right: 20px; }
}
