*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --bg-start: #f8f6ff;
  --bg-end: #ede8ff;
  --surface: rgba(255,255,255,0.92);
  --surface-soft: rgba(255,255,255,0.85);
  --card-soft: rgba(255,255,255,0.7);
  --border: rgba(137,93,254,0.15);
  --border-soft: rgba(137,93,254,0.12);
  --text: #181525;
  --text-sec: #59556a;
  --text-muted: #8d879f;
  --accent: #895dfe;
  --accent-dark: #6a3fd8;
  --accent-soft: rgba(137,93,254,0.08);
  --accent-soft-2: rgba(137,93,254,0.15);
  --green: #22c55e;
  --orange: #f59e0b;
  --red: #ef4444;
  --shadow: 0 24px 80px rgba(137,93,254,0.15);
  --shadow-btn: 0 8px 24px rgba(137,93,254,0.35);
  --input-bg: #ffffff;
  --backdrop: blur(16px);
}

body[data-mode="dark"] {
  --bg-start: #0f0d1e;
  --bg-end: #1a1730;
  --surface: rgba(26,23,48,0.9);
  --surface-soft: rgba(255,255,255,0.05);
  --card-soft: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.1);
  --border-soft: rgba(255,255,255,0.08);
  --text: #f3f0ff;
  --text-sec: #c7c0db;
  --text-muted: #a59cbf;
  --accent-soft: rgba(137,93,254,0.15);
  --accent-soft-2: rgba(137,93,254,0.18);
  --shadow: 0 24px 80px rgba(0,0,0,0.3);
  --input-bg: rgba(255,255,255,0.05);
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
}

button, input, select {
  font: inherit;
}

button {
  border: none;
}

.screen {
  min-height: 100vh;
  width: 100%;
}

.screen--gradient {
  background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
}

.shell {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 16px;
}

.shell--wide {
  max-width: 1220px;
  padding: 40px 24px;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 16px 40px rgba(137,93,254,0.45);
  user-select: none;
}

.brand-icon--xl {
    width: 80px;
    height: 80px;
    font-size: 38px;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}
    .brand-icon--xl .icon {
        display: inline-block;
        transform: translateY(-8%); /* подгонишь: 1px–3px */
        line-height: 1;
    }
.brand-icon--sm { width: 40px; height: 40px; font-size: 20px; border-radius: 12px; box-shadow: 0 6px 20px rgba(137,93,254,0.4); }
.brand-icon--xs { width: 32px; height: 32px; font-size: 16px; border-radius: 12px; }

.brand-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

.brand-subtitle {
  color: var(--text-sec);
  font-size: 0.9rem;
  text-align: center;
  margin: 8px 0 0;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
}

.brand-name--mobile {
  font-size: 1rem;
  font-weight: 700;
}

.btn {
  width: 100%;
  border-radius: 18px;
  padding: 14px 18px;
  transition: 0.2s ease;
  cursor: pointer;
}

.btn--lg {
  min-height: 54px;
  font-size: 0.925rem;
  font-weight: 700;
}

.btn--primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: var(--shadow-btn);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(137,93,254,0.5);
}

.btn--secondary {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(137,93,254,0.25);
}

.btn--secondary:hover {
  background: var(--accent-soft-2);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label {
  color: var(--text-sec);
  font-size: 0.75rem;
  font-weight: 500;
}

.input, .select {
  width: 100%;
  border-radius: 14px;
  outline: none;
  padding: 12px 16px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.15s ease;
}

.input:focus, .select:focus {
  border-color: var(--accent);
}

.input-row {
  position: relative;
}

.input--password {
  padding-right: 48px;
}

.icon-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
}

.error-text {
  color: var(--red);
  font-size: 0.8rem;
}

.helper-text {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
}

.helper-text--tiny {
  font-size: 0.72rem;
}

.is-hidden {
  display: none !important;
}

.link-btn {
  width: fit-content;
  padding: 0;
  background: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.mobile-brand-row {
  display: none;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.onb-in {
  animation: onbIn 0.5s ease;
}

@keyframes onbIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.spin {
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 1024px) {
  .mobile-brand-row {
    display: flex;
  }
}
