/* --- Фоновая сцена с мягким свечением --- */
.auth-shell .auth-viewport-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 60px;
  position: relative;
  overflow: hidden;
}

/* Декоративное фоновое свечение (soft ambient aura) */
.auth-shell .ambient-glow-1 {
  position: absolute;
  width: 650px;
  height: 650px;
  top: -120px;
  right: 5%;
  background: radial-gradient(circle, rgba(36, 91, 214, 0.07) 0%, rgba(243, 246, 250, 0) 70%);
  pointer-events: none;
  z-index: 0;
}
.auth-shell .ambient-glow-2 {
  position: absolute;
  width: 500px;
  height: 500px;
  bottom: -150px;
  left: 8%;
  background: radial-gradient(circle, rgba(70, 92, 123, 0.05) 0%, rgba(243, 246, 250, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* --- Основной контейнер авторизации --- */
.auth-shell .auth-layout-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  transition: max-width 0.3s ease;
}

/* Сетка из двух колонок: Форма + Интерактивная витрина */
.auth-shell .auth-grid {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 32px;
  align-items: stretch;
}

/* --- Колонка 1: Карточка входа / регистрации --- */
.auth-shell .auth-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 38px 34px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

/* Верхний бренд над карточкой */
.auth-shell .auth-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.auth-shell .brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 19px;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.auth-shell .brand-mark-box {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(36, 91, 214, 0.25);
  transition: transform 0.2s ease;
}
.auth-shell .brand-link:hover .brand-mark-box {
  transform: scale(1.05);
}

.auth-shell .status-badge-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  background: var(--green-soft);
  padding: 4px 10px;
  border-radius: 20px;
}
.auth-shell .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: authStatusBlink 2.5s 2;
}
@keyframes authStatusBlink {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.85);
  }
}

/* --- Динамическая эмблема "NFC Portal / Замок" --- */
.auth-shell .portal-emblem-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.auth-shell .portal-emblem {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #eef4ff 0%, #e1ecfd 100%);
  border: 1px solid var(--blue-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  box-shadow: 0 4px 16px rgba(36, 91, 214, 0.12);
  overflow: hidden;
}

/* Пульсирующие радио-волны за иконкой */
.auth-shell .portal-wave {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(36, 91, 214, 0.25);
  animation: authPortalPulse 3s 1 ease-out;
}
.auth-shell .portal-wave:nth-child(1) {
  width: 36px;
  height: 36px;
  animation-delay: 0s;
}
.auth-shell .portal-wave:nth-child(2) {
  width: 62px;
  height: 62px;
  animation-delay: 1s;
}
.auth-shell .portal-wave:nth-child(3) {
  width: 90px;
  height: 90px;
  animation-delay: 2s;
}

@keyframes authPortalPulse {
  0% {
    transform: scale(0.5);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.auth-shell .portal-icon-svg {
  position: relative;
  z-index: 2;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.auth-shell .auth-card:hover .portal-icon-svg {
  transform: translateY(-1px) scale(1.08);
}

.auth-shell .portal-emblem-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.auth-shell .portal-title-hint {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blue);
}
.auth-shell .portal-subtitle-hint {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

/* Заголовки */
.auth-shell .auth-card h1 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink-deep);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.auth-shell .auth-card .auth-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 22px;
}

/* Стек полей ввода */
.auth-shell .auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-shell .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-shell .form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-shell .input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-shell .input-prefix-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--muted-light);
  pointer-events: none;
  transition: color 0.15s ease;
}

.auth-shell .form-input {
  width: 100%;
  height: 48px;
  padding: 0 42px 0 42px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink-deep);
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.2s ease;
}
.auth-shell .form-input::placeholder {
  color: #a0aec0;
}
.auth-shell .form-input:focus {
  background: white;
  border-color: var(--blue);
  box-shadow: var(--shadow-focus);
}
.auth-shell .form-input:focus + .input-prefix-icon,
.auth-shell .input-with-icon:focus-within .input-prefix-icon {
  color: var(--blue);
}

.auth-shell .form-input.error {
  border-color: var(--red);
  background: #fff8f8;
}

/* Кнопка показа пароля (eye toggle) */
.auth-shell .password-toggle-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  padding: 6px;
  color: var(--muted-light);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    color 0.15s ease,
    background 0.15s ease;
}
.auth-shell .password-toggle-btn:hover {
  color: var(--ink);
  background: var(--canvas);
}

.auth-shell .input-help-text {
  font-size: 12px;
  color: var(--muted);
}

/* Строка с "Запомнить меня" и "Забыли пароль" */
.auth-shell .auth-row-helpers {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  margin-top: 4px;
}

.auth-shell .remember-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}

.auth-shell .forgot-link {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}
.auth-shell .forgot-link:hover {
  color: var(--blue-hover);
  text-decoration: underline;
}

/* Основная кнопка входа */
.auth-shell .auth-submit-btn {
  height: 50px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(36, 91, 214, 0.28);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 6px;
}
.auth-shell .auth-submit-btn:hover {
  background: var(--blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(36, 91, 214, 0.35);
}
.auth-shell .auth-submit-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(36, 91, 214, 0.2);
}
.auth-shell .btn-arrow-icon {
  transition: transform 0.2s ease;
}
.auth-shell .auth-submit-btn:hover .btn-arrow-icon {
  transform: translateX(4px);
}

/* Нижний блок переключения: Вход / Регистрация */
.auth-shell .auth-bottom-switch {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.auth-shell .switch-prompt {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
.auth-shell .switch-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}
.auth-shell .switch-action-btn:hover {
  background: white;
  border-color: var(--blue-border);
  color: var(--blue);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* --- Колонка 2: Интерактивная витрина (Showcase Panel) --- */
.auth-shell .auth-showcase-column {
  background: linear-gradient(145deg, var(--paper) 0%, #f4f8fd 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 34px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-subtle);
  position: relative;
  overflow: hidden;
}

/* Шапка витрины */
.auth-shell .showcase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.auth-shell .showcase-eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 6px;
}
.auth-shell .showcase-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

/* Интерактивный переключатель режима прямо на витрине */
.auth-shell .showcase-mode-tabs {
  display: flex;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.auth-shell .mode-tab-btn {
  border: none;
  background: transparent;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.auth-shell .mode-tab-btn.active {
  background: var(--blue);
  color: white;
}

/* --- Реалистичная физическая метка AtlasLink (3D Card) --- */
.auth-shell .physical-tag-card {
  background: linear-gradient(135deg, #1c2a3d 0%, var(--ink-deep) 100%);
  border-radius: 18px;
  padding: 22px 20px;
  color: white;
  position: relative;
  box-shadow:
    0 16px 36px rgba(14, 25, 41, 0.22),
    0 2px 6px rgba(14, 25, 41, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  margin-bottom: 20px;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  overflow: hidden;
}
.auth-shell .physical-tag-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 20px 42px rgba(14, 25, 41, 0.28);
}

/* Световой блик по поверхности карточки */
.auth-shell .tag-glare {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.auth-shell .tag-card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  position: relative;
  z-index: 2;
}
.auth-shell .tag-brand-name {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.auth-shell .tag-brand-chip {
  width: 20px;
  height: 20px;
  background: var(--blue);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.auth-shell .tag-nfc-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.1);
  padding: 3px 8px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

/* Интерактивный контент карточки (переключается Авто / Визитка) */
.auth-shell .tag-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 2;
}

.auth-shell .tag-info-col {
  flex: 1;
}
.auth-shell .tag-id-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--blue-border);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.auth-shell .tag-profile-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: white;
  margin-bottom: 6px;
}
.auth-shell .tag-mode-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(36, 91, 214, 0.35);
  border: 1px solid rgba(86, 142, 255, 0.4);
  color: #b9d5ff;
}

/* Мини-QR код на физической метке с анимацией сканирования */
.auth-shell .tag-qr-preview-box {
  width: 76px;
  height: 76px;
  background: white;
  border-radius: 10px;
  padding: 5px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
.auth-shell .qr-scan-laser {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue), #00f0ff, var(--blue), transparent);
  box-shadow: 0 0 6px #00d9ff;
  animation: authLaserScan 2.4s ease-in-out 2;
}
@keyframes authLaserScan {
  0%,
  100% {
    top: 5px;
    opacity: 0.3;
  }
  50% {
    top: 68px;
    opacity: 1;
  }
}

/* --- Демонстрация живого диалога (Micro-Chat) --- */
.auth-shell .live-dialogue-sim {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-shell .dialogue-sim-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-subtle);
}

.auth-shell .sim-bubble {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 10px;
  max-width: 90%;
  animation: authChatIn 0.4s ease;
}
@keyframes authChatIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-shell .sim-bubble-incoming {
  align-self: flex-start;
  background: var(--canvas);
  color: var(--ink);
  border-bottom-left-radius: 2px;
}
.auth-shell .sim-bubble-outgoing {
  align-self: flex-end;
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid var(--blue-border);
  border-bottom-right-radius: 2px;
}
.auth-shell .bubble-author {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}
.auth-shell .bubble-time {
  font-size: 9px;
  color: var(--muted-light);
  align-self: flex-end;
}

/* Список преимуществ / столпов безопасности */
.auth-shell .showcase-features-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.auth-shell .showcase-feat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.auth-shell .feat-icon-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.auth-shell .feat-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

/* --- Футер страницы --- */
.auth-shell .auth-footer {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 24px;
  position: relative;
  z-index: 1;
}
.auth-shell .auth-footer a {
  color: var(--muted);
  text-decoration: none;
}
.auth-shell .auth-footer a:hover {
  color: var(--blue);
}

/* --- Адаптивность --- */
@media (max-width: 960px) {
  .auth-shell .auth-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
  }
  .auth-shell .auth-showcase-column {
    display: none;
  }
  .auth-shell .auth-card {
    padding: 32px 24px;
  }
}

@media (max-width: 480px) {
  .auth-shell .auth-viewport-wrapper {
    padding: 16px 12px 40px;
  }
  .auth-shell .auth-card {
    padding: 26px 18px;
    border-radius: var(--radius);
  }
  .auth-shell .auth-card h1 {
    font-size: 22px;
  }
}

.auth-shell {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}
.auth-shell .auth-main {
  display: flex;
  flex: 1;
}
.auth-shell .auth-viewport-wrapper {
  min-width: 0;
  width: 100%;
}
.auth-shell .auth-grid > * {
  min-width: 0;
}
.auth-shell .portal-emblem {
  flex: 0 0 56px;
}
.auth-shell .portal-icon-svg {
  width: 26px;
  height: 26px;
}
.auth-shell .portal-wave {
  animation-fill-mode: forwards;
}
.auth-shell .form-input {
  font-size: 16px;
}
.auth-shell .password-toggle-btn {
  width: 44px;
  height: 44px;
  right: 3px;
}
.auth-shell .eye-cross {
  display: none;
}
.auth-shell [data-password-toggle][aria-pressed='true'] .eye-cross {
  display: block;
}
.auth-shell .remember-checkbox-label {
  flex-direction: row;
  font-size: 13px;
  min-height: 44px;
  font-weight: 500;
}
.auth-shell .remember-checkbox-label input[type='checkbox'] {
  display: block;
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  margin: 0;
  accent-color: var(--blue);
  flex-shrink: 0;
}
.auth-shell .auth-row-helpers {
  flex-wrap: wrap;
  gap: 4px 14px;
}
.auth-shell .forgot-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.auth-shell .auth-submit-btn {
  width: 100%;
  min-height: 50px;
  height: auto;
  padding: 12px 16px;
}
.auth-shell .auth-switch {
  margin-top: 24px;
  padding-top: 20px;
}
.auth-shell .auth-switch p {
  font-size: 13px;
  margin-bottom: 10px;
}
.auth-shell .auth-switch .button {
  min-height: 44px;
  background: var(--canvas);
  border-color: var(--line);
  border-radius: var(--radius-sm);
}
.auth-shell .notice {
  font-size: 13px;
  border: 1px solid var(--blue-border);
  margin: 16px 0 20px;
}
.auth-shell .notice.error {
  border-color: var(--red);
}
.auth-shell .action-links {
  margin-top: 24px;
}
.auth-shell .action-links a {
  min-height: 44px;
}
.auth-shell .form-input:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
.auth-shell [hidden] {
  display: none !important;
}
.auth-shell .tag-qr-preview-box {
  flex-shrink: 0;
}
.auth-shell .tag-info-col {
  min-width: 0;
}
.auth-shell .sim-privacy-note {
  color: var(--green);
}
.auth-shell .mode-tab-btn {
  min-height: 44px;
  min-width: 66px;
}
.auth-shell .showcase-header {
  gap: 12px;
  flex-wrap: wrap;
}
.auth-shell .showcase-mode-tabs {
  flex-shrink: 0;
}
.auth-shell .tag-card-top-row {
  gap: 12px;
  flex-wrap: wrap;
}
.auth-shell .showcase-features-list {
  margin-top: 18px;
}
.auth-shell .showcase-features-list > * {
  min-width: 0;
}
.auth-shell .feat-icon-title {
  flex-wrap: wrap;
}
.auth-shell .sim-bubble {
  animation: none;
}
.auth-shell .chat-replay .sim-bubble-incoming {
  animation: authChatIn 0.4s both;
}
.auth-shell .chat-replay .sim-bubble-outgoing {
  animation: authChatIn 0.4s 0.7s both;
}
.auth-shell .auth-footer {
  padding-top: 0;
}
@media (max-width: 960px) {
  .auth-shell .auth-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* Native labels inherit the application's column layout unless reset here. */
.auth-shell .form-label {
  flex-direction: row;
  justify-content: flex-start;
  align-items: flex-start;
}
.auth-shell .physical-tag-card:hover {
  transform: perspective(900px) rotateY(-3deg) rotateX(2deg) translateY(-2px);
}
.auth-shell .tag-nfc-badge {
  animation: authStatusBlink 2.5s 2;
}
@media (prefers-reduced-motion: reduce) {
  .auth-shell *,
  .auth-shell *::before,
  .auth-shell *::after {
    animation: none !important;
    transition: none !important;
  }
  .auth-shell .physical-tag-card:hover,
  .auth-shell .auth-card:hover .portal-icon-svg {
    transform: none;
  }
}
