:root {
  color-scheme: light;
  --wine: #52242c;
  --wine-deep: #28161b;
  --gold: #b58a43;
  --gold-light: #e0bf78;
  --ink: #372818;
  --muted: #705d46;
  --book: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--wine-deep);
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: linear-gradient(#21141899, #211418b8), url('/desktop-assets/holz.jpg') center / cover fixed; }
button, input { font: inherit; }
a { color: var(--wine); text-underline-offset: .18em; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #d5a854; outline-offset: 3px; }
.page { width: min(1160px, calc(100% - 32px)); min-height: 100vh; margin: auto; display: flex; flex-direction: column; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 26px 2px 20px; }
.brand { display: inline-flex; align-items: center; gap: 13px; color: #fff0cb; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 51px; border: 2px solid var(--gold-light); border-radius: 7px 7px 20px 20px; background: radial-gradient(circle at 50% 25%, #99545b, var(--wine) 72%); box-shadow: inset 0 0 0 3px #4b2530, inset 0 0 0 4px #d3a75e, 0 3px 8px #160c11; font: 28px var(--book); }
.brand-name { display: block; font: 700 30px/1 var(--book); letter-spacing: .025em; }
.brand-name strong { color: var(--gold-light); }
.brand-name small { display: block; margin-top: 6px; color: #e2cda9; font: 700 10px/1.1 "Segoe UI", system-ui, sans-serif; letter-spacing: .17em; text-transform: uppercase; }
.back-link { color: #f4dfb7; font-size: .88rem; font-weight: 650; text-decoration: none; border-bottom: 1px solid #d2aa6b80; padding-bottom: 3px; }
.back-link:hover { color: white; border-color: white; }

.login-panel { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1fr); min-height: 550px; margin: auto 0; border: 1px solid #dfba72; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 5px #1c1119, 0 0 0 6px #9f783d, 0 28px 70px #130b0bc4; }
.welcome { position: relative; display: flex; flex-direction: column; align-items: flex-start; padding: clamp(36px, 5vw, 72px); color: #f8e8c8; background: radial-gradient(circle at 8% 0%, #8b525666, transparent 45%), repeating-linear-gradient(45deg, transparent 0 19px, #e2b86b0b 19px 20px, transparent 20px 38px), linear-gradient(145deg, #4d252d, #24161b 78%); }
.welcome::after { content: ""; position: absolute; inset: 14px; border: 1px solid #d5ae6552; pointer-events: none; }
.eyebrow { margin: 0 0 28px; color: var(--gold-light); font-size: .73rem; font-weight: 750; letter-spacing: .2em; text-transform: uppercase; }
.welcome h1 { position: relative; z-index: 1; margin: 0; font: 700 clamp(2.4rem, 4.3vw, 4.2rem)/1.07 var(--book); letter-spacing: -.025em; }
.welcome h1 em { color: var(--gold-light); font-style: normal; }
.welcome > p:not(.eyebrow) { position: relative; z-index: 1; max-width: 23rem; margin: 27px 0 0; color: #e9d8bb; line-height: 1.7; }
.welcome-seal { display: grid; place-items: center; align-content: center; width: 105px; height: 105px; margin-top: auto; border: 2px solid #d1a45c; border-radius: 50%; color: #f3d38c; box-shadow: inset 0 0 0 5px #4d292d, inset 0 0 0 6px #d1a45c80; transform: rotate(-10deg); }
.welcome-seal span { font: 52px/.9 var(--book); }
.welcome-seal small { margin-top: 6px; font-size: 9px; font-weight: 700; letter-spacing: .15em; }

.login-card { padding: clamp(32px, 5vw, 67px); background: linear-gradient(#fff5d9e8, #f6e3b9e8), url('/desktop-assets/ppap.jpg') center / cover; }
.card-topline { display: flex; align-items: center; gap: 9px; color: #8a632c; font-size: .76rem; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.card-rune { font: 25px/1 var(--book); }
.login-card h2 { margin: 16px 0 9px; color: var(--wine); font: 700 clamp(2rem, 3.5vw, 2.8rem)/1.12 var(--book); }
.intro { max-width: 29rem; margin: 0 0 33px; color: var(--muted); }
#dm-login label { display: block; margin-bottom: 9px; color: #4b3422; font-size: .88rem; font-weight: 750; }
.key-field { position: relative; }
.key-field input { display: block; width: 100%; height: 54px; padding: 0 103px 0 17px; border: 1px solid #a78654; border-radius: 6px; color: var(--ink); background: #fffaf0e8; box-shadow: inset 0 2px 4px #563c1712; }
.key-field input::placeholder { color: #947b5c; }
.key-field input:focus { border-color: #7a4542; outline: 3px solid #b58a4370; outline-offset: 1px; }
.reveal-key { position: absolute; top: 7px; right: 7px; height: 40px; padding: 0 12px; border: 0; border-radius: 4px; color: var(--wine); background: #ecddbd; font-size: .8rem; font-weight: 700; cursor: pointer; }
.reveal-key:hover { background: #e6cfa0; }
.field-help { margin: 9px 0 0; color: var(--muted); font-size: .78rem; }
.error { min-height: 1.35em; margin: 14px 0 8px; color: #9f2333; font-size: .88rem; font-weight: 650; }
.submit { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 54px; padding: 11px 18px; border: 1px solid #4d232b; border-radius: 6px; color: #fff3d4; background: linear-gradient(#723940, #4b222b); box-shadow: inset 0 1px #b6827a66, 0 4px 10px #4b222b2f; font-weight: 750; cursor: pointer; }
.submit:hover { filter: brightness(1.1); }
.submit:disabled { opacity: .6; cursor: wait; }
.submit span { font-size: 1.4rem; line-height: 1; }
.card-footer { margin-top: 28px; padding-top: 20px; border-top: 1px solid #a786547a; color: var(--muted); font-size: .88rem; }
.card-footer p { margin: 0 0 9px; }
.card-footer a { font-weight: 700; }
.page-footer { padding: 23px 2px 26px; color: #e4c995; font: 700 .78rem var(--book); letter-spacing: .08em; text-align: center; }
.page-footer span { margin: 0 7px; }

@media (max-width: 760px) {
  .page { width: min(600px, calc(100% - 24px)); }
  .masthead { padding: 18px 2px; }
  .brand-name { font-size: 25px; }
  .brand-mark { width: 40px; height: 45px; font-size: 24px; }
  .back-link { font-size: .78rem; }
  .login-panel { display: block; min-height: 0; }
  .welcome { min-height: 195px; padding: 28px 34px 24px; }
  .welcome h1 { font-size: clamp(2rem, 7vw, 2.7rem); }
  .eyebrow { margin-bottom: 14px; }
  .welcome > p:not(.eyebrow), .welcome-seal { display: none; }
  .login-card { padding: 31px 30px 35px; }
}

@media (max-width: 420px) {
  .page { width: calc(100% - 16px); }
  .masthead { gap: 8px; }
  .brand-name small { font-size: 8px; }
  .welcome { padding: 25px 24px; }
  .login-card { padding: 27px 23px 32px; }
}
