:root {
  color-scheme: light;
  --login-bg: #f7f6f2;
  --login-surface: #ffffff;
  --login-line: #e4e1da;
  --login-text: #14213b;
  --login-muted: #7c879b;
  --login-blue: #2f63ed;
  --login-blue-dark: #2454d6;
  --login-danger: #d84d5e;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; }

body {
  margin: 0;
  color: var(--login-text);
  background: var(--login-bg);
  font-family: "Inter", "Noto Sans SC", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.material-symbols-rounded {
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 20;
  line-height: 1;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(390px, 43%) minmax(0, 57%);
  width: 100%;
  min-height: 100vh;
  padding: 20px;
  gap: 20px;
}

.login-brand {
  position: relative;
  display: flex;
  min-height: calc(100vh - 40px);
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px 48px;
  border: 1px solid #dfe5f4;
  border-radius: 22px;
  background: #eef3ff;
}

.brand-lockup {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #22304d;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .03em;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--login-blue);
  box-shadow: 0 9px 20px rgba(47, 99, 237, .22);
}

.brand-message {
  position: relative;
  z-index: 1;
  width: min(100%, 470px);
  margin: auto 0;
}

.brand-eyebrow, .login-eyebrow {
  display: block;
  color: var(--login-blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
}

.brand-message h2 {
  margin: 20px 0 18px;
  color: #182642;
  font-size: clamp(34px, 3.4vw, 54px);
  font-weight: 750;
  letter-spacing: -.035em;
  line-height: 1.22;
}

.brand-message p {
  max-width: 420px;
  margin: 0;
  color: #67748d;
  font-size: 15px;
  line-height: 1.85;
}

.brand-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #738099;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
}

.brand-footer span {
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: var(--login-blue);
}

.login-panel {
  display: grid;
  min-height: calc(100vh - 40px);
  place-items: center;
  padding: 54px;
  border: 1px solid #ebe8e1;
  border-radius: 22px;
  background: var(--login-surface);
  box-shadow: 0 18px 55px rgba(39, 49, 72, .055);
}

.access-frame { width: min(100%, 470px); }
.login-content { width: 100%; }

h1 {
  margin: 14px 0 0;
  color: var(--login-text);
  font-size: clamp(29px, 3vw, 42px);
  font-weight: 760;
  letter-spacing: -.035em;
  line-height: 1.3;
}

.login-subtitle {
  margin: 14px 0 42px;
  color: var(--login-muted);
  font-size: 14px;
  line-height: 1.7;
}

.login-form { width: 100%; }
.password-field { display: grid; gap: 10px; }

.telegram-login {
  display: flex;
  width: 100%;
  height: 56px;
  align-items: center;
  justify-content: center;
  gap: 11px;
  cursor: pointer;
  border: 1px solid #249cd8;
  border-radius: 9px;
  color: #fff;
  background: #249cd8;
  box-shadow: 0 10px 22px rgba(36, 156, 216, .19);
  font-size: 15px;
  font-weight: 700;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}

.telegram-login:hover { background: #168cc7; box-shadow: 0 13px 26px rgba(36, 156, 216, .25); transform: translateY(-1px); }
.telegram-login:focus-visible { outline: 3px solid rgba(36, 156, 216, .24); outline-offset: 3px; }
.telegram-login .material-symbols-rounded { font-size: 20px; }
.telegram-login.is-disabled { cursor: not-allowed; color: #8e99a9; border-color: #d8dde5; background: #f5f6f7; box-shadow: none; }
.telegram-login.is-disabled:hover { transform: none; }

.telegram-disabled-note {
  margin: 10px 0 0;
  color: #929bab;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.telegram-card {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  gap: 20px;
  padding: 18px;
  margin-top: 16px;
  border: 1px solid #dbe4ed;
  border-radius: 12px;
  background: #f8fbfd;
}

.telegram-card[hidden] { display: none; }
.telegram-qr-frame { overflow: hidden; border: 1px solid #e1e6eb; border-radius: 9px; background: #fff; }
.telegram-qr-frame img { display: block; width: 100%; height: auto; }
.telegram-card-copy { display: flex; min-width: 0; flex-direction: column; justify-content: center; }
.telegram-card-label { color: #249cd8; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.telegram-card-copy > p { margin: 9px 0 0; color: #4f5c74; font-size: 12px; line-height: 1.55; }
.telegram-expiry strong { color: #17243e; font-variant-numeric: tabular-nums; }
.telegram-open { margin-top: 12px; color: #187fb3; font-size: 12px; font-weight: 700; text-decoration: none; }
.telegram-open:hover { text-decoration: underline; }
.telegram-card-actions { display: flex; gap: 8px; margin-top: 13px; }
.telegram-card-actions button { padding: 6px 9px; cursor: pointer; border: 1px solid #ccd5df; border-radius: 6px; color: #59677c; background: #fff; font-size: 11px; }
.telegram-card-actions button:hover { border-color: #9eacbd; color: #27364e; }

.login-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 25px 0;
  color: #929bab;
  font-size: 12px;
}

.login-divider::before,
.login-divider::after { content: ""; height: 1px; flex: 1; background: #e7e4dd; }
.admin-divider { margin-top: 20px; }

.field-label {
  color: #4f5c74;
  font-size: 13px;
  font-weight: 650;
}

.password-field input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  outline: none;
  border: 1px solid #dcd9d1;
  border-radius: 9px;
  color: var(--login-text);
  background: #fff;
  font-size: 15px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.password-field input::placeholder { color: #a2a9b6; opacity: 1; }
.password-field input:hover { border-color: #b9c3d7; }
.password-field input:focus { border-color: var(--login-blue); box-shadow: 0 0 0 4px rgba(47, 99, 237, .1); }

.login-form button {
  display: flex;
  width: 100%;
  height: 54px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  cursor: pointer;
  border: 1px solid var(--login-blue);
  border-radius: 9px;
  color: #fff;
  background: var(--login-blue);
  box-shadow: 0 10px 22px rgba(47, 99, 237, .18);
  font-size: 15px;
  font-weight: 700;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}

.login-form button:hover { background: var(--login-blue-dark); box-shadow: 0 13px 26px rgba(47, 99, 237, .24); transform: translateY(-1px); }
.login-form button:active { transform: translateY(1px); }
.login-form button:focus-visible { outline: 3px solid rgba(47, 99, 237, .25); outline-offset: 3px; }
.login-form button .material-symbols-rounded { font-size: 18px; }

.login-error {
  min-height: 42px;
  padding: 11px 13px;
  margin: 0 0 16px;
  border: 1px solid #f1c7ce;
  border-radius: 8px;
  color: var(--login-danger);
  background: #fff2f4;
  font-size: 13px;
}

.login-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 24px 0 0;
  color: #919aa9;
  font-size: 12px;
}

.login-note .material-symbols-rounded { font-size: 15px; }

@media (max-width: 920px) {
  .login-shell { grid-template-columns: minmax(280px, 38%) minmax(0, 62%); padding: 12px; gap: 12px; }
  .login-brand { min-height: calc(100vh - 24px); padding: 32px 28px; border-radius: 17px; }
  .login-panel { min-height: calc(100vh - 24px); padding: 38px; border-radius: 17px; }
  .brand-message h2 { font-size: 34px; }
}

@media (max-width: 720px) {
  .login-shell { display: block; min-height: 100vh; padding: 12px; }
  .login-brand { min-height: 240px; padding: 26px; }
  .brand-message { margin: 44px 0 20px; }
  .brand-message h2 { margin: 14px 0 10px; font-size: 29px; }
  .brand-message p, .brand-footer { display: none; }
  .login-panel { min-height: auto; margin-top: 12px; padding: 42px 24px; }
  h1 { font-size: 28px; }
  .login-subtitle { margin-bottom: 32px; }
  .telegram-card { grid-template-columns: 132px minmax(0, 1fr); gap: 14px; padding: 14px; }
}

@media (max-width: 430px) {
  .telegram-card { grid-template-columns: 1fr; }
  .telegram-qr-frame { width: 184px; margin: 0 auto; }
  .telegram-card-copy { text-align: center; }
  .telegram-card-actions { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
