/* Страница регистрации — формы, роли, OTP */

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  border: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: calc(var(--radius-md) - 3px);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.auth-tab:hover {
  color: var(--text);
}

.auth-tab.is-active {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

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

.form-field {
  margin-bottom: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row .form-field {
  margin-bottom: 0;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.form-input:focus {
  border-color: rgba(139, 157, 201, 0.45);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-error {
  min-height: 1.25em;
  margin: 6px 0 0;
  font-size: 0.8125rem;
  color: #c98a8a;
}

.form-error--row {
  margin-top: -8px;
  margin-bottom: 8px;
}

.role-fieldset {
  margin: 8px 0 20px;
  padding: 0;
  border: none;
}

.role-fieldset .form-label {
  margin-bottom: 12px;
}

.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.role-grid .role-card:last-child {
  grid-column: 1 / -1;
  max-width: calc(50% - 5px);
  margin: 0 auto;
  width: 100%;
}

.role-card {
  position: relative;
  display: block;
  cursor: pointer;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-raised);
  padding: 16px 14px;
  transition: border-color 0.2s, background 0.2s;
}

.role-card:hover {
  border-color: var(--border-strong);
}

.role-card:has(.role-card__input:checked) {
  border-color: rgba(139, 157, 201, 0.45);
  background: var(--accent-soft);
}

.role-card__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.role-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.role-card__title {
  font-size: 0.875rem;
  font-weight: 600;
}

.role-card__hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* OTP — подтверждение по коду */

.otp-boxes {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 24px 0 4px;
}

.otp-box {
  width: 52px;
  height: 58px;
  text-align: center;
  font-family: inherit;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  caret-color: var(--accent);
}

.otp-box:focus {
  border-color: rgba(139, 157, 201, 0.45);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.otp-box.is-error {
  border-color: #c98a8a;
  box-shadow: 0 0 0 3px rgba(201, 138, 138, 0.15);
}

.otp-error {
  text-align: center;
  margin-bottom: 4px;
}

@media (max-width: 380px) {
  .otp-box {
    width: 44px;
    height: 50px;
    font-size: 1.25rem;
  }

  .otp-boxes {
    gap: 7px;
  }
}

/* ── Загрузка фото ───────────────────────────────────────────────────────────── */

.upload-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  transition: border-color 0.2s, background 0.2s;
}

.upload-zone.is-drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload-zone__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 20px;
  cursor: pointer;
  color: var(--text-muted);
}

.upload-zone__inner:hover {
  color: var(--text);
}

.upload-zone__text {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.upload-zone__hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.upload-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.upload-thumb__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upload-thumb__remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

@media (max-width: 520px) {
  .form-row,
  .role-grid {
    grid-template-columns: 1fr;
  }
}
