:root {
  color-scheme: dark;
  --page: #090909;
  --panel: #151517;
  --surface: #1f1f1f;
  --surface-pressed: #292929;
  --text: #f5f5f5;
  --muted: #929298;
  --border: #303034;
  --danger: #ff5a62;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  min-width: 320px;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  color: var(--text);
  background: var(--page);
}

button,
input {
  font: inherit;
}

.auth-layout {
  width: min(920px, 100%);
  min-height: calc(100vh - 48px);
  min-height: calc(100dvh - 48px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.2fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel);
}

.auth-side {
  min-width: 0;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  border-right: 1px solid var(--border);
  background: #101011;
}

.auth-logo {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 18px;
  background: #ffffff;
  color: #080808;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-status,
.auth-tagline {
  margin: 0;
}

.auth-status {
  max-width: 280px;
  margin-top: 12px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
}

.auth-tagline {
  max-width: 290px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.auth-main {
  min-width: 0;
  padding: 40px;
  display: flex;
  align-items: flex-start;
}

.auth-card {
  width: min(100%, 456px);
  display: grid;
  align-content: start;
  gap: 18px;
}

.auth-card form,
.auth-fields,
.auth-head {
  display: grid;
}

.auth-card form,
.auth-fields {
  gap: 14px;
}

.auth-head {
  gap: 8px;
}

.auth-panel {
  display: none;
}

.auth-panel.is-active {
  display: grid;
}

.auth-title,
.auth-subtitle,
.auth-info,
.auth-error {
  margin: 0;
}

.auth-title {
  font-size: clamp(28px, 5vw, 36px);
  line-height: 1.08;
  letter-spacing: 0;
}

.auth-subtitle,
.auth-info {
  color: var(--muted);
  line-height: 1.45;
}

.auth-subtitle {
  font-size: 15px;
}

.auth-info,
.auth-error {
  font-size: 13px;
}

.field {
  display: grid;
  gap: var(--space-1);
  color: #b4b4ba;
  font-size: 14px;
}

.field input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.field input::placeholder {
  color: #707076;
}

.field input:focus {
  border-color: #66666d;
  background: #222224;
}

.file-picker {
  position: relative;
  min-height: 50px;
  padding: 7px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.file-picker:focus-within {
  border-color: #66666d;
}

.file-picker-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-picker-trigger {
  min-height: 34px;
  padding: 0 12px;
  flex: 0 0 auto;
  border: 1px solid #48484d;
  border-radius: 11px;
  background: #29292c;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.file-picker-trigger:active {
  background: #343438;
}

.file-picker-value {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-picker.has-file .file-picker-value {
  color: #d5d5d8;
}

.file-picker.is-disabled {
  opacity: 0.55;
}

.field-checkbox {
  gap: 0;
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.check-inline input[type='checkbox'] {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  accent-color: #ffffff;
}

.auth-btn {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 14px;
  background: #ffffff;
  color: #090909;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.16s ease, transform 0.12s ease;
}

.auth-btn:hover {
  background: #e9e9eb;
}

.auth-btn:active {
  transform: scale(0.992);
  background: #d8d8da;
}

.auth-btn:focus-visible,
.auth-link-btn:focus-visible,
.file-picker-trigger:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.captcha-wrap,
.captcha-slot {
  min-height: 65px;
  max-width: 100%;
  overflow: hidden;
}

.captcha-wrap iframe {
  max-width: 100%;
}

.auth-error {
  padding: 2px 0;
  color: var(--danger);
  line-height: 1.35;
}

.auth-actions {
  min-height: 0;
  margin-top: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.auth-link-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: #a6a6ac;
  font-size: 14px;
  cursor: pointer;
}

.auth-link-btn:hover {
  color: #ffffff;
}

.auth-link-btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

@media (max-width: 760px) {
  body {
    padding: 0;
  }

  .auth-layout {
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
  }

  .auth-side {
    padding: max(24px, env(safe-area-inset-top)) 20px 20px;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    column-gap: 14px;
    row-gap: 5px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .auth-logo {
    width: 52px;
    height: 52px;
    grid-row: 1 / span 2;
    font-size: 17px;
  }

  .auth-status {
    margin-top: 1px;
    font-size: 17px;
  }

  .auth-tagline {
    font-size: 13px;
    line-height: 1.35;
  }

  .auth-main {
    padding: 28px 20px max(32px, env(safe-area-inset-bottom));
  }

  .auth-card {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .auth-main {
    padding-inline: 14px;
  }
}
