:root{
  color-scheme: light;

  /* Фирменный тёмно-коричневый */
  --portal-navy:            #5b4839;
  --portal-navy-deep:       #473e38;
  --portal-steel:           #5b4839;
  --portal-steel-deep:      #473e38;
  --portal-pill:            #f4efe9;
  --portal-pill-hover:      #ece5dc;

  /* Фоны */
  --portal-bg:              #f5f2ed;   /* Мягкий бежевый фон страницы */
  --portal-bg-soft:         #faf8f5;
  --portal-surface:         #ffffff;   /* Белая карточка */
  --portal-surface-muted:   #ffffff;   /* Белые поля ввода */
  --portal-border:          #e5e1dc;   /* Светло-бежевая рамка */
  --portal-border-strong:   #d5cec5;

  /* Текст */
  --portal-logo:            #5b4839;
  --portal-text:            #313131;   /* Тёмно-серый */
  --portal-text-2:          #777777;   /* Серый для лейблов */
  --portal-text-3:          #999999;   /* Светло-серый для подсказок */
  --portal-text-inverse:    #ffffff;

  /* Состояния */
  --portal-neutral-bg:      #e8e4e0;
  --portal-success:         #5b4839;
  --portal-success-soft:    #f4efe9;
  --portal-success-text:    #5b4839;
  --portal-danger:          #c0463c;
  --portal-error-field-bg:  #fdf0ee;

  --portal-shadow-color:    rgba(0, 0, 0, 0.06);
  --shadow-card:            0 8px 24px var(--portal-shadow-color);

  --radius-pill:   999px;
  --radius-input:  8px;
  --radius-md:     12px;
  --radius-card:   16px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 26px;
  --space-8: 32px;

  --font-body:    "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Inter", system-ui, "Segoe UI", Roboto, sans-serif;

  --portal-field-gap: 7px;
}

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

html, body{ margin: 0; padding: 0; }

body{
  background: var(--portal-bg);
  color: var(--portal-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a{ color: inherit; text-decoration: none; }
button, input, select, textarea{ font: inherit; color: inherit; }
button{ cursor: pointer; }
h1{ font-family: var(--font-heading); color: var(--portal-text); margin: 0; font-weight: 700; }
p{ margin: 0; }

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

[hidden]{ display: none !important; }

.root{
  background: var(--portal-bg);
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* Убираем декоративное свечение, так как на скриншоте фон чистый */
.root::before{
  display: none;
}

.center{
  padding: var(--space-6);
  flex: 1;
  justify-content: center;
  align-items: center;
  display: flex;
  position: relative;
}

.card{
  align-items: center;
  gap: var(--space-5);
  background: var(--portal-surface);
  border: none;
  border-radius: var(--radius-card);
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-card);
  padding: var(--space-8);
  flex-direction: column;
  display: flex;
}

.head{
  flex-direction: column;
  align-items: center;
  gap: 6px;
  display: flex;
}

.title{
  text-align: center;
  font-size: 24px;
  line-height: 1.15;
  color: var(--portal-navy);
  font-weight: 700;
}

.subtitle{
  color: var(--portal-text-3);
  text-align: center;
  max-width: 30ch;
  font-size: 13px;
  line-height: 1.4;
}

.body{ width: 100%; }

.form{
  flex-direction: column;
  gap: var(--space-5);
  display: flex;
}

.group{
  flex-direction: column;
  gap: var(--space-4);
  display: flex;
}

.logo{ align-items: center; display: inline-flex; }
.logo--vertical{ gap: var(--space-2); flex-direction: column; }
.logo__mark{ object-fit: contain; flex: none; display: block; }
.logo__wordmark{ flex-direction: column; gap: 2px; display: flex; }
.logo__wordmark--centered{ align-items: center; }

.logo__word{
  font-family: var(--font-heading);
  color: var(--portal-logo);
  letter-spacing: 5px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.logo__sub{
  font-family: var(--font-heading);
  color: var(--portal-logo);
  letter-spacing: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.field{
  gap: var(--portal-field-gap);
  flex-direction: column;
  min-width: 0;
  display: flex;
}

.label{
  font-family: var(--font-body);
  color: var(--portal-text-2);
  font-size: 13px;
  font-weight: 500;
}

.control{
  background: var(--portal-surface-muted);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-input);
  width: 100%;
  height: 44px;
  font-family: var(--font-body);
  color: var(--portal-text);
  outline: none;
  padding: 0 14px;
  font-size: 14px;
  transition: border-color .12s, background-color .12s, box-shadow .12s;
}

.control::placeholder{ color: var(--portal-text-3); }

.control:hover{ border-color: var(--portal-border-strong); }

.control:focus{
  background: var(--portal-surface);
  border-color: var(--portal-navy);
  box-shadow: 0 0 0 1px var(--portal-navy);
}

.control.is-invalid,
.control.is-invalid:focus{
  border-color: var(--portal-danger);
  background: var(--portal-error-field-bg);
  color: var(--portal-danger);
  box-shadow: 0 0 0 1px var(--portal-danger);
}

.control:-webkit-autofill{
  -webkit-text-fill-color: var(--portal-text);
  -webkit-box-shadow: 0 0 0 1000px var(--portal-surface-muted) inset;
  transition: background-color 9999s ease-in-out 0s;
}

.error-msg{
  color: var(--portal-danger);
  align-items: center;
  gap: 7px;
  font-size: 13px;
  line-height: 1.35;
  display: none;
}

.error-msg.is-visible{ display: flex; }

.error-msg::before{
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5'/%3E%3Cpath d='M12 16.2v.1'/%3E%3C/svg%3E");
  mask: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5'/%3E%3Cpath d='M12 16.2v.1'/%3E%3C/svg%3E");
}

.chips{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

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

.chip{
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--portal-border);
  background: var(--portal-surface-muted);
  color: var(--portal-text-2);
  font-family: var(--font-body);
  white-space: nowrap;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-user-select: none;
  user-select: none;
  transition: background-color .14s, border-color .14s, color .14s, box-shadow .14s;
}

.chip:hover{
  border-color: var(--portal-border-strong);
  color: var(--portal-navy);
}

.chip__input:checked + .chip{
  background: var(--portal-navy);
  border-color: var(--portal-navy);
  color: var(--portal-text-inverse);
  box-shadow: none;
}

.chip__input:focus-visible + .chip{
  outline: 2px solid var(--portal-navy);
  outline-offset: 2px;
}

.consent{
  align-items: flex-start;
  gap: var(--space-3);
  background: #f9f7f5; /* Очень светлый бежевый для блока согласия */
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  display: flex;
  transition: border-color .12s, background-color .12s;
}

.consent:hover{ border-color: var(--portal-border-strong); }

.consent:has(.checkbox:checked){
  background: var(--portal-pill);
  border-color: var(--portal-navy);
}

.checkbox{
  width: 20px;
  height: 20px;
  accent-color: var(--portal-navy);
  cursor: pointer;
  flex: none;
  margin: 0;
}

.check-label{
  color: var(--portal-text-2);
  font-size: 13.5px;
  line-height: 1.4;
}

.check-link{
  color: var(--portal-navy);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color .12s;
}

.check-link:hover{ color: var(--portal-navy-deep); }

.notice{
  align-items: flex-start;
  gap: 10px;
  border-radius: var(--radius-md);
  padding: 13px 15px;
  margin-bottom: var(--space-5);
  font-size: 13.5px;
  line-height: 1.4;
  display: flex;
  animation: notice-in .22s ease-out;
}

.notice--success{
  background: var(--portal-success-soft);
  border: 1px solid rgba(91, 72, 57, 0.2);
  color: var(--portal-success-text);
}

.notice__icon{ flex: none; margin-top: 1px; }

@keyframes notice-in{
  from{ opacity: 0; transform: translateY(-6px); }
  to{ opacity: 1; transform: none; }
}

.btn{
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  border-radius: var(--radius-pill); /* Кнопка-пилюля как на скриншоте */
  font-family: var(--font-body);
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
  border: 1px solid transparent;
  padding: 14px 22px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background-color .12s, border-color .12s, color .12s, box-shadow .12s, transform 60ms;
  display: inline-flex;
}

.btn:active{ transform: translateY(1px); }
.btn--full{ width: 100%; }

.btn--primary{
  background: var(--portal-navy);
  color: var(--portal-text-inverse);
  box-shadow: 0 4px 12px rgba(91, 72, 57, 0.2);
}

.btn--primary:hover{ background: var(--portal-navy-deep); }

.btn:disabled{
  background: var(--portal-neutral-bg);
  color: var(--portal-text-3);
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
  border-color: transparent;
  transform: none;
}

.btn__spin{
  display: none;
  flex: none;
  animation: portal-btn-spin .8s linear infinite;
}

.btn.is-loading .btn__label{ display: none; }
.btn.is-loading .btn__spin{ display: block; }

@keyframes portal-btn-spin{ to{ transform: rotate(360deg); } }

.secondary-link{
  color: var(--portal-navy);
  align-self: center;
  font-size: 14px;
  font-weight: 600;
  transition: color .12s;
}

.secondary-link:hover{ color: var(--portal-navy-deep); }

@media (width <= 480px){
  .card{ padding: var(--space-6); }
  .title{ font-size: 22px; }
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: .01ms !important; transition-duration: .01ms !important; }
}