:root {
  --navy: #173768;
  --navy-strong: #10284d;
  --blue: #2f6fed;
  --ink: #142033;
  --muted: #66758c;
  --surface: #fff;
  --canvas: #eef2f7;
  --line: #dfe5ee;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  background: var(--canvas);
}

.login-layout {
  width: min(880px, calc(100% - 32px));
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(280px, .82fr) minmax(360px, 1.18fr);
  margin: max(32px, 8vh) auto;
  overflow: hidden;
  border: 1px solid rgba(19, 45, 84, .1);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(21, 39, 67, .14);
}

.login-brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 40px;
  color: #fff;
  background: var(--navy);
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--navy-strong);
  background: #fff;
  font-size: 14px;
  font-weight: 900;
}

.login-brand div {
  display: grid;
  gap: 5px;
}

.login-brand strong {
  font-size: 18px;
}

.login-brand span:last-child {
  color: #b9c9e5;
  font-size: 12px;
}

.login-panel {
  align-self: center;
  padding: 48px clamp(32px, 7vw, 76px);
}

.login-heading {
  margin-bottom: 28px;
}

.login-heading p {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-heading h1 {
  margin: 0;
  font-size: 28px;
}

form {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

input:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(47, 111, 237, .14);
}

button {
  min-height: 46px;
  margin-top: 4px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--blue);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.form-error {
  padding: 10px 12px;
  border: 1px solid #f0caca;
  border-radius: 6px;
  color: #9f2e2e;
  background: #fff2f2;
  font-size: 12px;
}

.telegram-progress {
  min-height: 90px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.telegram-error,
.telegram-only-hint {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.telegram-error {
  padding: 15px;
  border: 1px solid #f0caca;
  border-radius: 6px;
  background: #fff8f8;
}

.telegram-error strong,
.telegram-only-hint strong {
  color: var(--ink);
  font-size: 15px;
}

.telegram-error button {
  width: 100%;
}

.client-ip {
  padding: 7px 9px;
  border-radius: 5px;
  color: #5c3b14;
  background: #fff3d6;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid #dbe4f3;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

[hidden] {
  display: none !important;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 680px) {
  body {
    background: #fff;
  }

  .login-layout {
    width: 100%;
    min-height: 100dvh;
    display: block;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .login-brand {
    min-height: 118px;
    padding: calc(24px + env(safe-area-inset-top, 0px)) 24px 24px;
  }

  .login-panel {
    padding: 34px 24px calc(34px + env(safe-area-inset-bottom, 0px));
  }
}

