:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f4f0ed;
  background: #171313;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --muted: #a79c98;
  --accent: #d9a06b;
  --line: rgba(255, 255, 255, .09);
  --panel: rgba(32, 27, 26, .88);
}

* { box-sizing: border-box; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 13% 14%, rgba(137, 73, 58, .19), transparent 35rem),
    radial-gradient(ellipse at 90% 70%, rgba(111, 75, 119, .13), transparent 32rem),
    #171313;
}
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }

.topbar {
  min-height: 78px;
  padding: 0 clamp(20px, 6vw, 92px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .14em;
  text-decoration: none;
}
.brand img { width: 35px; height: 35px; border-radius: 50%; object-fit: cover; }
.brand span span { color: var(--accent); }
.back-link { color: var(--muted); font-size: 13px; text-decoration: none; transition: color .2s ease; }
.back-link:hover { color: #fff; }

main {
  width: min(100% - 40px, 1080px);
  min-height: calc(100vh - 140px);
  margin: 0 auto;
  padding: clamp(54px, 9vh, 108px) 0 70px;
}
.login-panel { width: min(100%, 590px); margin: 0 auto; padding: clamp(28px, 6vw, 58px); border: 1px solid var(--line); border-radius: 25px; background: linear-gradient(145deg, rgba(39, 32, 30, .94), rgba(25, 21, 21, .94)); box-shadow: 0 30px 100px rgba(0, 0, 0, .25); animation: rise-in .6s cubic-bezier(.2, .75, .25, 1) both; }
.eyebrow { margin: 0 0 13px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .2em; }
h1 { margin: 0; font-size: clamp(39px, 7vw, 66px); font-weight: 730; letter-spacing: -.065em; line-height: .99; }
h1 span { color: var(--accent); }
.intro { max-width: 550px; margin: 18px 0 30px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.fine-print { color: #8d8380; font-size: 11px; line-height: 1.6; }

.primary-button, .secondary-button {
  min-height: 47px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 0 19px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 720;
  text-decoration: none;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, opacity .2s ease;
}
.primary-button { color: #201612; background: var(--accent); }
.primary-button:hover { transform: translateY(-2px); background: #e7b27e; }
.primary-button:disabled { cursor: wait; opacity: .55; transform: none; }
.secondary-button { color: #e7deda; border-color: var(--line); background: rgba(255,255,255,.035); }
.secondary-button:hover { border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.07); }

.panel-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; margin-bottom: 35px; animation: rise-in .55s ease both; }
.panel-heading h1 { font-size: clamp(36px, 6vw, 55px); }
.panel-heading h1 span { color: #f1d4bb; }
.panel-heading .intro { margin: 13px 0 0; }
.heading-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.server-badge { display: inline-flex; align-items: center; gap: 9px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: #ddd4cf; font-size: 12px; }
.server-badge img { width: 23px; height: 23px; border-radius: 50%; object-fit: cover; }

.layout { display: grid; grid-template-columns: minmax(210px, .72fr) minmax(0, 1.7fr); gap: 17px; align-items: start; }
.side-card, .form-card { border: 1px solid var(--line); border-radius: 19px; background: var(--panel); box-shadow: 0 18px 60px rgba(0, 0, 0, .13); }
.side-card { padding: 23px 21px; animation: rise-in .55s .08s ease both; }
.permission-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; color: #d8ceca; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,.055); }
.permission-row:last-of-type { border-bottom: 0; }
.permission-dot { width: 8px; height: 8px; border-radius: 50%; background: #6f625e; box-shadow: 0 0 0 4px rgba(255,255,255,.035); }
.permission-dot.allowed { background: #83c89b; box-shadow: 0 0 0 4px rgba(131,200,155,.12); }
.side-card .fine-print { margin: 17px 0 0; }
.form-card { padding: clamp(22px, 4vw, 34px); animation: rise-in .55s .15s ease both; }
.card-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 23px; }
.card-heading .eyebrow { margin-bottom: 7px; }
.card-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.lock-mark { color: var(--accent); font-size: 29px; }
form { display: grid; gap: 12px; }
form > label, .field-group > label { color: #d8cfcb; font-size: 12px; font-weight: 650; }
input, select, textarea {
  width: 100%;
  min-height: 45px;
  padding: 11px 13px;
  color: #f4f0ed;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  outline: none;
  background: #171414;
  transition: border-color .2s ease, box-shadow .2s ease;
}
input:focus, select:focus, textarea:focus { border-color: rgba(217,160,107,.72); box-shadow: 0 0 0 3px rgba(217,160,107,.1); }
input::placeholder, textarea::placeholder { color: #706764; }
select { appearance: auto; }
textarea { min-height: 82px; resize: vertical; }
.field-group { display: grid; gap: 8px; margin-top: 8px; }
.field-hint { color: #8f8581; font-size: 10px; line-height: 1.5; }
.optional { color: #827975; font-weight: 400; }
.input-suffix { display: flex; align-items: center; gap: 10px; }
.input-suffix input { max-width: 130px; }
.input-suffix span { color: #8f8581; font-size: 10px; line-height: 1.4; }
.status { min-height: 18px; margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.status.is-error { color: #ff9a91; }
.status.is-success { color: #91d8a8; }
form .primary-button { width: 100%; margin-top: 3px; }

.footer { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 20px 22px; color: #766d69; font-size: 11px; }
.footer-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
@keyframes rise-in { from { opacity: 0; transform: translateY(13px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 720px) {
  .topbar { min-height: 66px; padding: 0 20px; }
  main { padding-top: 54px; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { justify-content: flex-start; }
  .layout { grid-template-columns: 1fr; }
  .side-card { order: 2; }
  .form-card { order: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
