:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #191919;
  background: #f1f1f1;
  font-synthesis: none;
  color-scheme: light;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 16px;
}

.login-surface {
  min-height: calc(100vh - 32px);
  min-height: calc(100svh - 32px);
  display: grid;
  grid-template-rows: 40px minmax(180px, 1fr) auto;
  justify-items: center;
  padding: 24px 24px 48px;
  border-radius: 24px;
  background: #fff;
}

.brand-mark { width: 36px; height: 36px; }
.brand-mark svg { display: block; width: 100%; height: 100%; }

.login-actions {
  grid-row: 3;
  width: min(100%, 360px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.telegram-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  max-width: 100%;
  min-height: 48px;
  padding: 14px 23px;
  border: 0;
  border-radius: 999px;
  background: #191919;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: none;
  text-align: center;
  transition: background 150ms ease, transform 150ms ease;
}

.telegram-button svg {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  fill: none;
}

@media (hover: hover) {
  .telegram-button:not(:disabled):hover { background: #383838; transform: translateY(-1px); }
}

.telegram-button:not(:disabled):active { transform: translateY(0); background: #000; }
.telegram-button:focus-visible { outline: 2px solid #191919; outline-offset: 5px; }
.telegram-button:disabled { background: #ededed; color: #767676; cursor: not-allowed; }

.notice {
  margin: 0;
  max-width: 100%;
  font-size: 13px;
  line-height: 1.5;
  color: #767676;
  text-align: center;
  overflow-wrap: anywhere;
}

.notice.error {
  padding: 12px 16px;
  border-radius: 12px;
  color: #9f3737;
  background: #fff5f4;
}

@media (max-width: 520px) {
  body { padding: 8px; }
  .login-surface {
    min-height: calc(100vh - 16px);
    min-height: calc(100svh - 16px);
    padding: max(24px, env(safe-area-inset-top)) 20px max(32px, env(safe-area-inset-bottom));
    border-radius: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .telegram-button { transition: none; }
}
