:root {
  --ink: #0a0a0a;
  --ink-soft: #4a4a4a;
  --line: #e2e0db;
  --white: #ffffff;
  --black: #0a0a0a;
  --accent: #ff8562;
  --danger: #b42318;
  --ok: #1a7f4b;
  --tap: 48px;
  --font: "Manrope", "Trebuchet MS", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body.auth {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-weight: 500;
  color: var(--ink);
  background: var(--white);
  line-height: 1.35;
}

.auth-split {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
}

/* Mobile: compact brand strip on top (black), form below (white) */
.auth-pane--dark {
  order: -1;
  background: var(--black);
  color: #fff;
  padding: 6px 20px 10px;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
}

.auth-pane--dark::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 70% at 110% 0%, rgba(255, 133, 98, 0.22), transparent 55%),
    radial-gradient(60% 50% at -10% 100%, rgba(255, 255, 255, 0.06), transparent 50%);
  pointer-events: none;
}

.auth-pane--light {
  background: var(--white);
  padding: 24px 20px 40px;
  display: flex;
  align-items: flex-start;
}

.auth-pane__inner {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.auth-brand {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.auth-brand__logo-plate {
  display: inline-block;
  line-height: 0;
  /* Logo: white РЕ on black / black ПРОФИТ on white */
  background: linear-gradient(
    to right,
    #000 0%,
    #000 49.64%,
    #fff 49.64%,
    #fff 100%
  );
  max-width: min(200px, 68vw);
}

.auth-brand__logo {
  display: block;
  height: 26px;
  width: auto;
  max-width: 100%;
}

.auth-brand__line {
  margin: 6px 0 0;
  font-size: clamp(0.95rem, 3.6vw, 1.15rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.auth-title {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.auth-lead {
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* class display:flex would otherwise override UA [hidden] */
.auth-form[hidden] {
  display: none !important;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.auth-optional {
  font-weight: 500;
  color: var(--ink-soft);
}

.auth-field input {
  width: 100%;
  min-height: var(--tap);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px; /* avoid iOS zoom */
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.08);
}

.auth-hint {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.auth-msg {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.auth-msg.is-error {
  color: var(--danger);
}

.auth-msg.is-ok {
  color: var(--ok);
}

.auth-btn {
  min-height: var(--tap);
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  padding: 12px 18px;
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.15s ease;
}

.auth-btn:active {
  transform: scale(0.98);
}

.auth-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.auth-btn--primary {
  background: var(--black);
  color: #fff;
}

.auth-btn--primary:hover {
  background: #1a1a1a;
}

.auth-btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}

/* Desktop / wide: left white form, right black brand */
@media (min-width: 860px) {
  .auth-split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 1fr;
  }

  .auth-pane--dark {
    order: 0;
    min-height: 100dvh;
    align-items: center;
    padding: 48px;
  }

  .auth-pane--light {
    align-items: center;
    padding: 48px;
  }

  .auth-brand__logo {
    height: 36px;
  }

  .auth-brand__logo-plate {
    max-width: min(240px, 72vw);
  }

  .auth-brand__line {
    margin-top: 14px;
    font-size: clamp(1.75rem, 2.8vw, 2.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-btn,
  .auth-field input {
    transition: none;
  }
}
