:root {
  --ink: #1d1d1f;
  --ink-soft: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --surface: #ffffff;
  --surface-soft: #f5f5f7;
  --input-bg: #f2f2f4;
  --bg-0: #f5f5f7;
  --bg-1: #e8e8ed;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-press: #006edb;
  --danger: #b80000;
  --danger-bg: #fff2f2;
  --radius: 18px;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.12);
  --font-display: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-text: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body.auth-body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-text);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.auth-atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(0, 113, 227, 0.12), transparent 55%),
    linear-gradient(180deg, #fbfbfd 0%, var(--bg-0) 52%, var(--bg-1) 100%);
  filter: blur(0);
}

.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 40px 20px;
}

.auth-card {
  position: relative;
  width: min(460px, 100%);
  padding: 32px 32px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: panel-in 650ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-card-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 20px;
}

.auth-brand {
  display: inline-flex;
  line-height: 0;
}

.auth-brand img {
  display: block;
  width: 168px;
  height: 64px;
  object-fit: contain;
  object-position: left center;
  filter: brightness(0);
}

.auth-card-head {
  margin-bottom: 24px;
}

.auth-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.auth-title-bar {
  display: block;
  width: 4px;
  height: 1.05em;
  flex-shrink: 0;
  border-radius: 3px;
  background: var(--accent);
}

.auth-lead {
  margin: 10px 0 0 16px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
}

.field-control {
  position: relative;
}

.field input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  letter-spacing: -0.014em;
  outline: none;
  transition: box-shadow 160ms ease, background 160ms ease;
}

.field-control input {
  padding-right: 46px;
}

.field input::placeholder {
  color: #a1a1a6;
}

.field input:focus {
  background: #ececef;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.16);
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}

.toggle-password svg {
  display: block;
  flex-shrink: 0;
}

.toggle-password svg.is-hidden,
.toggle-password svg[hidden] {
  display: none !important;
}

.toggle-password:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.04);
}

.hint {
  margin: -4px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.35;
}

.auth-extras {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-top: -2px;
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: -0.01em;
  cursor: pointer;
  user-select: none;
}

.remember input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.016em;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.btn:active {
  transform: scale(0.985);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-primary {
  margin-top: 6px;
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-primary:active:not(:disabled) {
  background: var(--accent-press);
}

.btn-secondary {
  background: var(--surface-soft);
  color: var(--ink);
}

.btn-secondary:hover {
  background: #e8e8ed;
}

.turnstile-wrap {
  margin: 4px 0 2px;
  min-height: 65px;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  gap: 8px;
}

.turnstile-hint {
  margin: 0;
  text-align: center;
}

.turnstile-wrap .cf-turnstile {
  width: 100%;
}

.hint--error {
  color: #b42318;
  margin: 0 0 8px;
}

.auth-switch {
  margin: 20px 0 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  letter-spacing: -0.01em;
}

.auth-switch a {
  margin-left: 4px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-switch a:hover {
  color: var(--accent-hover);
}

.auth-footer {
  display: flex;
  justify-content: center;
}

.lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px 4px 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
}

.lang-globe {
  display: inline-flex;
  margin-right: 4px;
}

.lang-form {
  display: inline;
  margin: 0;
}

.lang-btn {
  min-width: 32px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
}

.lang-btn:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.04);
}

.lang-btn.is-active {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.06);
}

.flash {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 14px;
  line-height: 1.4;
  border: 1px solid rgba(184, 0, 0, 0.12);
}

@media (max-width: 520px) {
  .auth-shell {
    padding: 28px 16px;
  }

  .auth-card {
    padding: 24px 20px 22px;
  }

  .auth-title {
    font-size: 24px;
  }

  .auth-extras {
    flex-wrap: wrap;
  }
}
