.register-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(99, 102, 241, 0.08), transparent),
    var(--cursor-bg);
}

.register-chat {
  width: 100%;
  max-width: 440px;
  height: min(720px, calc(100vh - 32px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--cursor-surface);
  border: 1px solid var(--cursor-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(17, 17, 17, 0.06);
}

.register-chat__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--cursor-border);
  background: var(--cursor-surface);
}

.register-chat__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 18px;
  color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  flex-shrink: 0;
}

.register-chat__meta {
  min-width: 0;
}

.register-chat__name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.register-chat__status {
  margin: 2px 0 0;
  font-size: 12px;
  color: #16a34a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.register-chat__status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
}

.register-chat__messages {
  padding: 18px 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.register-bubble {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(8px);
  animation: register-bubble-in 0.35s ease forwards;
}

.register-bubble--aida {
  align-self: flex-start;
  background: var(--cursor-hover);
  color: var(--cursor-text);
  border-bottom-left-radius: 6px;
}

.register-bubble--aida.register-bubble--sad {
  background: #f0f4f8;
  color: #5c6b7a;
  border: 1px solid #d8e0ea;
}

.register-bubble--user {
  align-self: flex-end;
  background: var(--cursor-text);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.register-bubble--error {
  align-self: flex-start;
  background: #fef2f2;
  color: #b42318;
  border: 1px solid #fecaca;
}

.register-bubble--password {
  display: grid;
  gap: 10px;
  max-width: 92%;
}

.register-password-card__lead {
  margin: 0;
}

.register-password-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--cursor-surface);
  border: 1px solid var(--cursor-border-strong);
  border-radius: 10px;
}

.register-password-card__value {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  word-break: break-all;
  color: var(--cursor-text);
}

.register-password-card__copy {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--cursor-border-strong);
  border-radius: 8px;
  background: var(--cursor-surface);
  color: var(--cursor-text-secondary);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.register-password-card__copy:hover {
  background: var(--cursor-hover);
  color: var(--cursor-text);
  opacity: 1;
}

.register-password-card__copy.is-copied {
  color: #16a34a;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.register-password-card__copy svg {
  display: block;
}

.register-password-card__hint {
  margin: 0;
  font-size: 12px;
  color: var(--cursor-text-secondary);
}

.register-password-card__login {
  margin: 0;
  font-size: 13px;
}

.register-password-card__login a {
  color: var(--cursor-text);
  font-weight: 500;
  text-decoration: none;
}

.register-password-card__login a:hover {
  text-decoration: underline;
}

.register-password-card__enter {
  width: 100%;
  margin-top: 2px;
}

.register-typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 12px 14px;
  border-radius: 16px;
  border-bottom-left-radius: 6px;
  background: var(--cursor-hover);
}

.register-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cursor-muted);
  animation: register-typing-dot 1.2s infinite ease-in-out;
}

.register-typing span:nth-child(2) { animation-delay: 0.15s; }
.register-typing span:nth-child(3) { animation-delay: 0.3s; }

.register-chat__composer {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--cursor-border);
  background: var(--cursor-surface);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.register-chat__composer.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.register-chat__composer.is-hidden,
.register-chat__composer[hidden] {
  display: none !important;
}

.register-chat__composer-form {
  display: grid;
  gap: 10px;
}

.register-chat__composer-form[hidden] {
  display: none !important;
}

.register-chat__composer-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.register-chat__composer input[type="tel"],
.register-chat__composer input[type="text"],
.register-chat__composer input[type="password"] {
  width: 100%;
  min-width: 0;
}

.register-chat__forgot {
  margin: 0;
  text-align: center;
}

.register-chat__forgot button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--cursor-text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.register-chat__forgot button:hover {
  color: var(--cursor-text);
  opacity: 1;
}

.register-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.register-platforms--topics {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.register-platforms--topics .register-platforms__chip {
  font-weight: 500;
}

.register-platforms__chip--custom {
  border-style: dashed;
}

.register-channel-topic-custom {
  margin: 0 0 12px;
}

.register-channel-topic-custom input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--cursor-border-strong);
  border-radius: 10px;
  background: var(--cursor-surface);
  color: var(--cursor-text);
  font-size: 14px;
}

.register-channel-topic-custom input:focus {
  outline: none;
  border-color: var(--cursor-text);
}

.register-platforms__chip {
  border: 1px solid var(--cursor-border-strong);
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--cursor-surface);
  color: var(--cursor-text);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.register-platforms__chip.is-selected {
  background: var(--cursor-text);
  border-color: var(--cursor-text);
  color: #fff;
}

.register-platforms__submit {
  width: 100%;
}

.register-chat__secondary-btn {
  width: 100%;
  margin-top: 8px;
  padding: 10px 14px;
  border: 1px solid var(--cursor-border-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--cursor-text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.register-chat__secondary-btn:hover:not(:disabled) {
  background: var(--cursor-bg);
  color: var(--cursor-text);
  border-color: var(--cursor-text-secondary);
}

.register-chat__secondary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.register-chat__composer-row--stack {
  flex-direction: column;
  align-items: stretch;
}

.register-chat__composer-row--stack textarea {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--cursor-border-strong);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  resize: vertical;
  background: var(--cursor-surface);
  color: var(--cursor-text);
}

.register-chat__composer-row--stack textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.register-chat__composer-row--stack button {
  align-self: flex-end;
}

.register-channel-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.register-chat__hint {
  margin: 0;
  font-size: 12px;
  color: var(--cursor-text-secondary);
}

.register-bubble--video {
  padding: 8px;
  max-width: min(100%, 320px);
}

.register-bubble--video video {
  display: block;
  width: 100%;
  max-height: 240px;
  border-radius: 10px;
  background: #000;
}

.register-video-card__caption {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--cursor-text-secondary);
  line-height: 1.35;
}

.register-chat__back-btn {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px 10px;
  padding: 9px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--cursor-text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}

.register-chat__back-btn:hover:not(:disabled) {
  color: var(--cursor-text);
  background: var(--cursor-bg);
}

.register-chat__back-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.register-chat__footer-link {
  text-align: center;
  padding: 0 16px 14px;
  font-size: 13px;
  color: var(--cursor-text-secondary);
}

.register-chat__footer-link a {
  color: var(--cursor-text);
  font-weight: 500;
  text-decoration: none;
}

.register-chat__footer-link a:hover {
  text-decoration: underline;
}

.register-external-channels {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(52vh, 360px);
  overflow-y: auto;
  margin: 0 0 12px;
  padding-right: 2px;
}

.register-external-channels__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--cursor-border);
  border-radius: 12px;
  background: var(--cursor-bg);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.register-external-channels__item:hover {
  border-color: color-mix(in srgb, var(--cursor-accent) 35%, var(--cursor-border));
}

.register-external-channels__item.is-selected {
  border-color: var(--cursor-accent);
  background: color-mix(in srgb, var(--cursor-accent) 8%, var(--cursor-bg));
}

.register-external-channels__check {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--cursor-accent);
}

.register-external-channels__body {
  flex: 1;
  min-width: 0;
}

.register-external-channels__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--cursor-text);
  line-height: 1.35;
}

.register-external-channels__meta {
  margin: 0;
  font-size: 12px;
  color: var(--cursor-text-secondary);
  line-height: 1.35;
}

.register-external-channels__link {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--cursor-accent);
  text-decoration: none;
  word-break: break-all;
}

.register-external-channels__link:hover {
  text-decoration: underline;
}

.register-external-channels__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.register-external-channels__actions .register-platforms__submit {
  width: 100%;
}

.register-external-channels__empty {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--cursor-text-secondary);
  line-height: 1.45;
}

@keyframes register-bubble-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes register-typing-dot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 480px) {
  .register-page {
    padding: 0;
  }

  .register-chat {
    max-width: none;
    height: 100vh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
}
