:root {
  color-scheme: light;
  font-family:
    "Golos Text",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --canvas: #f7f5f1;
  --surface: #ffffff;
  --surface-subtle: #f1f0ed;
  --text: #15171a;
  --secondary: #5e636b;
  --border: #d9d6cf;
  --border-strong: #8a877f;
  --action-fill: #a63a0a;
  --action-fill-hover: #8e2f06;
  --on-action: #ffffff;
  --focus: #005fcc;
  --error: #b42318;
  --disabled: #72767d;
  --control-radius: 3px;
  background: var(--canvas);
  color: var(--text);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #111315;
  --surface: #171a1d;
  --surface-subtle: #202428;
  --text: #f3f1ed;
  --secondary: #bbc0c6;
  --border: #373c42;
  --border-strong: #707780;
  --action-fill: #f07b3e;
  --action-fill-hover: #ff9460;
  --on-action: #111315;
  --focus: #66b0ff;
  --error: #ff8a80;
  --disabled: #9aa0a8;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --canvas: #111315;
    --surface: #171a1d;
    --surface-subtle: #202428;
    --text: #f3f1ed;
    --secondary: #bbc0c6;
    --border: #373c42;
    --border-strong: #707780;
    --action-fill: #f07b3e;
    --action-fill-hover: #ff9460;
    --on-action: #111315;
    --focus: #66b0ff;
    --error: #ff8a80;
    --disabled: #9aa0a8;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--canvas);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.site-header {
  min-height: 56px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header-inner {
  width: min(100%, 1120px);
  min-height: 56px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
}

.site-name {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.login-main {
  width: min(100%, 1120px);
  min-height: calc(100vh - 57px);
  min-height: calc(100svh - 57px);
  margin: 0 auto;
  padding: 56px 32px 40px;
}

.login-section {
  width: min(100%, 460px);
  margin: 0 auto;
}

h1 {
  margin: 0;
  font-size: 26px;
  line-height: 32px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.login-intro {
  margin: 12px 0 0;
  color: var(--secondary);
  font-size: 16px;
  line-height: 24px;
}

.login-form {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.required-help {
  margin: 0;
  color: var(--secondary);
  font-size: 14px;
  line-height: 20px;
}

.form-field {
  margin-top: 20px;
}

.form-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}

.form-field input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--control-radius);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  line-height: 24px;
  caret-color: var(--action-fill);
}

.form-field input:hover:not(:disabled) {
  border-color: var(--text);
}

.form-field input[aria-invalid="true"] {
  border-color: var(--error);
}

.form-field input:disabled {
  border-color: var(--border);
  color: var(--disabled);
  background: var(--surface-subtle);
  cursor: wait;
}

.password-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.password-toggle {
  min-width: 104px;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--control-radius);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  cursor: pointer;
}

.password-toggle:hover:not(:disabled) {
  border-color: var(--text);
  background: var(--surface-subtle);
}

.password-toggle:disabled {
  border-color: var(--border);
  color: var(--disabled);
  cursor: wait;
}

.field-error {
  margin: 8px 0 0;
  color: var(--error);
  font-size: 14px;
  line-height: 20px;
}

.submit-button {
  width: 100%;
  min-height: 48px;
  margin-top: 24px;
  padding: 12px 20px;
  border: 1px solid var(--action-fill);
  border-radius: var(--control-radius);
  background: var(--action-fill);
  color: var(--on-action);
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  cursor: pointer;
}

.submit-button:hover:not(:disabled) {
  border-color: var(--action-fill-hover);
  background: var(--action-fill-hover);
}

.submit-button:disabled {
  border-color: var(--border-strong);
  background: var(--border-strong);
  color: var(--surface);
  cursor: wait;
}

.form-status {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--secondary);
  font-size: 14px;
  line-height: 20px;
}

.form-status[data-state="error"] {
  color: var(--error);
  font-weight: 500;
}

.security-note {
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--secondary);
  font-size: 14px;
  line-height: 20px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 600px) {
  .site-header-inner {
    padding: 0 16px;
  }

  .login-main {
    padding: 32px 16px 28px;
  }

  h1 {
    font-size: 22px;
    line-height: 28px;
  }
}

@media (max-width: 340px) {
  .password-control {
    grid-template-columns: minmax(0, 1fr);
  }

  .password-toggle {
    width: 100%;
  }
}
