/*
 * Стили auth-страниц под PROX (Tailwind: primary #4CAF50, neutral-*, emerald-600 #059669).
 */

:root {
  --ea-primary: #4caf50;
  --ea-primary-dark: #388e3c;
  --ea-primary-light: #81c784;
  --ea-emerald-600: #059669;
  --ea-neutral-900: #171717;
  --ea-neutral-600: #525252;
  --ea-neutral-500: #737373;
  --ea-neutral-400: #a3a3a3;
  --ea-neutral-200: #e5e5e5;
  --ea-neutral-50: #fafafa;
  --ea-white: #ffffff;
  --ea-emerald-50: #ecfdf5;
  --ea-emerald-200: #a7f3d0;
  --ea-teal-100: #ccfbf1;
  --ea-red-600: #dc2626;
  --ea-amber-600: #d97706;
}

.ea-reset,
.ea-reset * {
  box-sizing: border-box;
}

.ea-page {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ea-neutral-900);
  position: relative;
}

/* Фон как PROX: from-neutral-50 via-white to-emerald-50/40 */
.ea-bg {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  min-height: 100vh;
  overflow: hidden;
  background: linear-gradient(
    to bottom,
    var(--ea-neutral-50) 0%,
    var(--ea-white) 50%,
    rgba(236, 253, 245, 0.4) 100%
  );
}

/* Blobs: primary/10, emerald-200/50, teal-100/60 — позиции как в EmailAuthApp Shell */
.ea-bg__blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.ea-bg__blob--1 {
  left: -10rem;
  top: 5rem;
  width: 24rem;
  height: 24rem;
  background: rgba(76, 175, 80, 0.1);
  filter: blur(120px);
}

.ea-bg__blob--2 {
  right: -8rem;
  bottom: 0;
  width: 28rem;
  height: 28rem;
  background: rgba(167, 243, 208, 0.5);
  filter: blur(130px);
}

.ea-bg__blob--3 {
  left: 50%;
  top: 33%;
  width: 16rem;
  height: 16rem;
  transform: translate(-50%, -50%);
  background: rgba(204, 251, 241, 0.6);
  filter: blur(100px);
}

/* max-w-lg, px-4 pt-3 pb-12 sm:px-6 sm:pt-4 */
.ea-shell {
  position: relative;
  z-index: 10;
  margin: 0 auto;
  max-width: 32rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0.75rem 1rem 3rem;
}

@media (min-width: 640px) {
  .ea-shell {
    padding: 1rem 1.5rem 3rem;
  }
}

/* mb-5 */
.ea-brand {
  text-align: center;
  margin-bottom: 1.25rem;
}

/* h-14 w-14 sm:h-16 sm:w-16 object-contain drop-shadow PROX */
.ea-brand__logo {
  display: block;
  margin: 0 auto 0.5rem;
  width: 3.5rem;
  height: 3.5rem;
  max-width: 72vw;
  object-fit: contain;
  border-radius: 0;
  filter: drop-shadow(0 4px 14px rgba(74, 175, 80, 0.2));
}

@media (min-width: 640px) {
  .ea-brand__logo {
    width: 4rem;
    height: 4rem;
  }
}

/* text-lg sm:text-xl font-semibold tracking-tight text-primary */
.ea-brand__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ea-primary);
}

@media (min-width: 640px) {
  .ea-brand__title {
    font-size: 1.25rem;
  }
}

/* rounded-3xl border border-neutral-200/90 shadow-xl shadow-neutral-900/5 p-6 sm:p-8 */
.ea-card {
  width: 100%;
  border-radius: 1.5rem;
  border: 1px solid rgba(229, 229, 229, 0.9);
  background: var(--ea-white);
  padding: 1.5rem;
  box-shadow:
    0 20px 25px -5px rgba(23, 23, 23, 0.05),
    0 8px 10px -6px rgba(23, 23, 23, 0.04);
}

@media (min-width: 640px) {
  .ea-card {
    padding: 2rem;
  }
}

/* text-xl font-semibold text-neutral-900 */
.ea-card__h {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: var(--ea-neutral-900);
}

/* text-sm text-neutral-600 mt-1 */
.ea-card__lead {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--ea-neutral-600);
}

/* mt-6 space-y-4 */
.ea-form {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* mb-1.5 flex gap-2 text-sm text-neutral-600 */
.ea-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--ea-neutral-600);
}

.ea-label--block {
  display: flex;
  width: 100%;
  margin-bottom: 0.5rem;
}

.ea-sex-field {
  margin-top: 0.125rem;
}

.ea-sex-options {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.ea-sex-option {
  position: relative;
  flex: 1;
  min-width: calc(50% - 0.3125rem);
}

.ea-sex-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.ea-sex-option label {
  display: block;
  text-align: center;
  padding: 0.75rem 0.875rem;
  border-radius: 0.75rem;
  border: 1px solid var(--ea-neutral-200);
  background: var(--ea-white);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ea-neutral-700);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.ea-sex-option label:hover {
  border-color: var(--ea-primary-light);
  background: var(--ea-neutral-50);
}

.ea-sex-option input:focus-visible + label {
  outline: 2px solid var(--ea-primary);
  outline-offset: 2px;
}

.ea-sex-option input:checked + label {
  border-color: var(--ea-primary);
  background: rgba(76, 175, 80, 0.1);
  color: var(--ea-primary-dark);
  box-shadow: 0 0 0 1px rgba(76, 175, 80, 0.2);
}

.ea-label svg {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  color: var(--ea-neutral-600);
  opacity: 1;
}

/* rounded-xl border-neutral-200 px-4 py-3 focus:border-primary focus:ring-2 focus:ring-primary/25 */
.ea-input {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid var(--ea-neutral-200);
  background: var(--ea-white);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5rem;
  color: var(--ea-neutral-900);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ea-input::placeholder {
  color: var(--ea-neutral-400);
}

.ea-input:focus {
  border-color: var(--ea-primary);
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.25);
}

.ea-input-wrap {
  position: relative;
}

.ea-input--pw {
  padding-right: 3rem;
}

/* absolute right-2 rounded-lg p-2 text-neutral-500 hover:bg-neutral-100 */
.ea-toggle-pw {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--ea-neutral-500);
  border-radius: 0.5rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ea-toggle-pw:hover {
  background: #f5f5f5;
  color: #262626;
}

.ea-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--ea-neutral-600);
}

.ea-check input {
  margin-top: 0.125rem;
  flex-shrink: 0;
  accent-color: var(--ea-primary);
}

/* rounded-xl gradient from-primary to-emerald-600 py-3.5 font-medium shadow-lg shadow-primary/20 */
.ea-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  border: none;
  border-radius: 0.75rem;
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(90deg, var(--ea-primary) 0%, var(--ea-emerald-600) 100%);
  box-shadow:
    0 10px 15px -3px rgba(76, 175, 80, 0.2),
    0 4px 6px -4px rgba(76, 175, 80, 0.15);
  transition: filter 0.15s ease, opacity 0.15s ease;
}

.ea-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.ea-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ea-btn__icon {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
}

/* Кнопка «Регистрация» на экране входа — как Link в PROX LoginView */
.ea-btn-register {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--ea-primary);
  background: var(--ea-white);
  border: 2px solid rgba(76, 175, 80, 0.25);
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px rgba(23, 23, 23, 0.05);
  text-decoration: none;
  box-sizing: border-box;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.ea-btn-register:hover {
  border-color: rgba(76, 175, 80, 0.4);
  background: rgba(76, 175, 80, 0.06);
}

.ea-btn--secondary {
  background: var(--ea-white);
  color: #404040;
  border: 1px solid var(--ea-neutral-200);
  box-shadow: none;
  font-size: 0.875rem;
  font-weight: 400;
  padding: 0.75rem 1rem;
}

.ea-btn--secondary:hover:not(:disabled) {
  background: var(--ea-neutral-50);
  filter: none;
}

/* text-sm text-red-600 mt-2 */
.ea-err {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--ea-red-600);
}

.ea-err.ea-err--field {
  margin-top: 0.5rem;
}

/* как text-emerald-700 в PROX */
.ea-info {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #047857;
}

/* mt-6 flex flex-col gap-3 text-center text-sm */
.ea-links {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.ea-links > a {
  color: var(--ea-primary);
  text-decoration: none;
}

.ea-links > a:hover {
  text-decoration: underline;
}

.ea-muted-inline {
  color: var(--ea-neutral-600);
}

.ea-muted-inline a {
  font-weight: 500;
  color: var(--ea-primary);
  text-decoration: none;
}

.ea-muted-inline a:hover {
  text-decoration: underline;
}

.ea-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0 1rem;
  color: var(--ea-neutral-600);
  font-size: 0.8125rem;
}

.ea-divider::before,
.ea-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ea-neutral-200);
}

.ea-status {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  text-align: center;
  min-height: 1.25rem;
  color: var(--ea-neutral-600);
}

.ea-status--ok {
  color: var(--ea-emerald-600);
}

.ea-status--err {
  color: var(--ea-red-600);
}

.ea-center-msg {
  text-align: center;
}

.ea-icon-circle {
  margin: 0 auto 1rem;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ea-icon-circle--warn {
  background: #fffbeb;
  color: var(--ea-amber-600);
}

.ea-icon-circle--ok {
  background: #ecfdf5;
  color: var(--ea-emerald-600);
}

/* Страница подтверждения почты — 6 ячеек как в PROX VerifyView */
.ea-verify-digits-wrap {
  width: 100%;
}

.ea-verify-digits {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.25rem;
  width: 100%;
}

@media (min-width: 640px) {
  .ea-verify-digits {
    gap: 0.5rem;
  }
}

@media (min-width: 768px) {
  .ea-verify-digits {
    gap: 0.75rem;
  }
}

.ea-verify-digit {
  height: 2.5rem;
  min-width: 0;
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid var(--ea-neutral-200);
  background: var(--ea-white);
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ea-neutral-900);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ea-verify-digit:focus {
  border-color: var(--ea-primary);
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.25);
}

@media (min-width: 640px) {
  .ea-verify-digit {
    height: 3rem;
    font-size: 1.25rem;
    line-height: 1.75rem;
  }
}

.ea-verify-footer {
  margin-top: 1.5rem;
}

/* Футер под формой: «Уже есть аккаунт?» */
.ea-form-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--ea-neutral-600);
}

.ea-form-footer a {
  font-weight: 500;
  color: var(--ea-primary);
  text-decoration: none;
}

.ea-form-footer a:hover {
  text-decoration: underline;
}

/* Ссылка-кнопка */
a.ea-btn {
  text-decoration: none;
  box-sizing: border-box;
}

a.ea-btn--secondary {
  margin-top: 0.5rem;
}

/* До проверки Telegram WebApp (webapp-tg-bootstrap.js снимает класс) */
html.ea-tg-boot-pending body {
  visibility: hidden;
}

/* —— Страница доступа / сопровождения —— */
.ea-subscribe-page .ea-shell {
  justify-content: center;
  padding-top: 0.5rem;
  padding-bottom: 2.5rem;
}

.ea-subscribe-page .ea-brand {
  margin-bottom: 0.25rem;
}

.ea-subscribe-card {
  position: relative;
  overflow: hidden;
  padding-top: 1.75rem;
  padding-bottom: 1.75rem;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.6) inset,
    0 25px 50px -12px rgba(23, 23, 23, 0.12),
    0 12px 24px -10px rgba(5, 150, 105, 0.08);
}

.ea-subscribe-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ea-primary) 0%, var(--ea-emerald-600) 100%);
  border-radius: 1.5rem 1.5rem 0 0;
}

.ea-subscribe__hero {
  text-align: center;
  margin-bottom: 0.25rem;
}

.ea-subscribe__badge {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1.25rem;
  background: linear-gradient(145deg, var(--ea-primary) 0%, var(--ea-emerald-600) 100%);
  color: #fff;
  box-shadow:
    0 12px 24px -8px rgba(76, 175, 80, 0.45),
    0 4px 8px -4px rgba(5, 150, 105, 0.25);
}

.ea-subscribe__badge-icon {
  width: 2.25rem;
  height: 2.25rem;
}

.ea-subscribe__title {
  margin: 0;
  font-size: 1.375rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ea-neutral-900);
}

@media (min-width: 640px) {
  .ea-subscribe__title {
    font-size: 1.5rem;
  }
}

.ea-subscribe__subtitle {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--ea-neutral-500);
  max-width: 18rem;
  margin-left: auto;
  margin-right: auto;
}

.ea-subscribe__lead {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ea-neutral-600);
}

.ea-subscribe__paths {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.ea-subscribe__path {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--ea-neutral-200);
  background: linear-gradient(180deg, #fff 0%, var(--ea-neutral-50) 100%);
  box-shadow: 0 1px 2px rgba(23, 23, 23, 0.04);
}

.ea-subscribe__path-icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(236, 253, 245, 0.9);
  color: var(--ea-primary-dark);
}

.ea-subscribe__path-icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

.ea-subscribe__path-icon--tg {
  background: rgba(0, 136, 204, 0.1);
  color: #0088cc;
}

.ea-subscribe__path-text {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ea-neutral-600);
  padding-top: 0.125rem;
}

.ea-subscribe__path-text strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ea-neutral-900);
  margin-bottom: 0.125rem;
}

.ea-subscribe__hint {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: 1.25rem;
  padding: 0.875rem 1rem;
  border-radius: 0.875rem;
  background: linear-gradient(135deg, var(--ea-emerald-50) 0%, rgba(204, 251, 241, 0.5) 100%);
  border: 1px solid rgba(76, 175, 80, 0.22);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ea-neutral-700);
}

.ea-subscribe__hint-icon {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.1rem;
  color: var(--ea-emerald-600);
}

.ea-subscribe__hint-icon--alert {
  width: 1.275rem;
    height: 1.275rem;
    padding: 0.25rem;
    box-sizing: border-box;
    border-radius: 50%;
    border: 2px solid rgb(5 203 142 / 69%);
    margin-top: 0.05rem;
}

.ea-subscribe__actions {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ea-subscribe__actions .ea-btn--secondary {
  margin-top: 0;
}

.ea-subscribe__btn-primary .ea-btn__icon {
  width: 1.125rem;
  height: 1.125rem;
}

.ea-subscribe__btn-tg .ea-btn__icon {
  width: 1.125rem;
  height: 1.125rem;
}

.ea-subscribe__status {
  margin-top: 1rem;
  min-height: 1.25rem;
  text-align: center;
}

.ea-subscribe__btn-tg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.ea-subscribe__btn-tg .ea-btn__icon {
  width: 1rem;
  height: 1rem;
  margin: 0;
}
