/* Soorta — стеклянная модалка входа/регистрации (дизайн с лендинга) */

#screen-buyer-auth,
#screen-supplier-auth {
  --ink: #f0f4f1;
  --ink-2: rgba(240, 244, 241, 0.8);
  --ink-3: rgba(240, 244, 241, 0.56);
  --brand: #16a34a;
  --brand-ink: #4ade80;
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  background: rgba(7, 13, 9, 0.5);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  overflow-y: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

#screen-buyer-auth.hidden,
#screen-supplier-auth.hidden {
  display: none !important;
}

#screen-buyer-auth .auth-card,
#screen-supplier-auth .auth-card {
  position: relative;
  width: 100%;
  max-width: 410px;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 34px 32px 30px;
  border-radius: 24px;
  color: var(--ink);
  background: linear-gradient(160deg, rgba(30, 40, 32, 0.62), rgba(13, 20, 16, 0.52));
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(34px) saturate(180%);
  -webkit-backdrop-filter: blur(34px) saturate(180%);
  box-shadow:
    inset 0 1.5px 0.5px rgba(255, 255, 255, 0.35),
    inset 0 -8px 20px -10px rgba(255, 255, 255, 0.12),
    0 40px 90px -24px rgba(0, 0, 0, 0.75);
  animation: authCardIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@keyframes authCardIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

#screen-buyer-auth .auth-close,
#screen-supplier-auth .auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(240, 244, 241, 0.7);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 18px;
  line-height: 1;
  transition: background 0.2s ease, color 0.2s ease;
}

#screen-buyer-auth .auth-close:hover,
#screen-supplier-auth .auth-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

#screen-buyer-auth .auth-kicker,
#screen-supplier-auth .auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-ink);
  margin-bottom: 14px;
}

#screen-buyer-auth .auth-kicker i,
#screen-supplier-auth .auth-kicker i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.9);
}

#screen-buyer-auth .auth-title,
#screen-supplier-auth .auth-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  color: var(--ink);
}

#screen-buyer-auth .auth-desc,
#screen-supplier-auth .auth-desc {
  font-size: 13.5px;
  color: var(--ink-3);
  margin-bottom: 22px;
  line-height: 1.5;
}

#screen-buyer-auth .auth-tabs,
#screen-supplier-auth .auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
}

#screen-buyer-auth .auth-tab,
#screen-supplier-auth .auth-tab {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-3);
  background: transparent;
  border: none;
  transition: background 0.2s ease, color 0.2s ease;
  box-shadow: none;
}

#screen-buyer-auth .auth-tab:hover,
#screen-supplier-auth .auth-tab:hover {
  color: var(--ink);
}

#screen-buyer-auth .auth-tab-active,
#screen-supplier-auth .auth-tab-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

#screen-buyer-auth .auth-field,
#screen-supplier-auth .auth-field {
  display: block;
  margin-bottom: 15px;
}

#screen-buyer-auth .auth-field > span,
#screen-supplier-auth .auth-field > span {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 7px;
}

#screen-buyer-auth .auth-input,
#screen-supplier-auth .auth-input,
#screen-buyer-auth .form-input,
#screen-supplier-auth .form-input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 13px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  box-shadow: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

#screen-buyer-auth .auth-input::placeholder,
#screen-supplier-auth .auth-input::placeholder,
#screen-buyer-auth .form-input::placeholder,
#screen-supplier-auth .form-input::placeholder {
  color: rgba(240, 244, 241, 0.38);
}

#screen-buyer-auth .auth-input:focus,
#screen-supplier-auth .auth-input:focus,
#screen-buyer-auth .form-input:focus,
#screen-supplier-auth .form-input:focus {
  outline: none;
  border-color: rgba(134, 239, 172, 0.6);
  background: rgba(255, 255, 255, 0.11);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.16);
}

#screen-buyer-auth .form-hint,
#screen-supplier-auth .form-hint {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-3);
}

#screen-buyer-auth .auth-error,
#screen-supplier-auth .auth-error {
  font-size: 13px;
  color: #fca5a5;
  background: rgba(220, 38, 38, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 10px;
  padding: 9px 13px;
  margin-bottom: 14px;
}

#screen-buyer-auth .auth-error.hidden,
#screen-supplier-auth .auth-error.hidden {
  display: none !important;
}

#screen-buyer-auth .auth-submit,
#screen-supplier-auth .auth-submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 6px;
  min-height: 48px;
  padding: 14px 30px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  border: 1px solid rgba(21, 128, 61, 0.55);
  background: linear-gradient(180deg, rgba(40, 196, 100, 0.95), rgba(22, 163, 74, 0.92) 55%, rgba(13, 148, 136, 0.9));
  box-shadow:
    inset 0 1.5px 0.5px rgba(255, 255, 255, 0.55),
    inset 0 -8px 14px -8px rgba(190, 255, 210, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.28),
    0 18px 40px -14px rgba(22, 163, 74, 0.45);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, filter 0.2s ease;
}

#screen-buyer-auth .auth-submit:hover,
#screen-supplier-auth .auth-submit:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

#screen-buyer-auth .auth-submit:disabled,
#screen-supplier-auth .auth-submit:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
  filter: none;
}

#screen-buyer-auth .auth-hint,
#screen-supplier-auth .auth-hint {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 13px;
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.2);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

#screen-buyer-auth .auth-hint svg,
#screen-supplier-auth .auth-hint svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--brand-ink);
}

#screen-buyer-auth .auth-hint b,
#screen-supplier-auth .auth-hint b {
  color: var(--brand-ink);
  font-weight: 600;
}

/* Светлая тема лендинга → светлая модалка */
body:has(#screen-landing.landing-light) #screen-buyer-auth,
body:has(#screen-landing.landing-light) #screen-supplier-auth {
  --ink: #18211b;
  --ink-2: rgba(24, 33, 27, 0.82);
  --ink-3: rgba(24, 33, 27, 0.6);
  --brand-ink: #15803d;
  background: rgba(243, 241, 235, 0.55);
}

body:has(#screen-landing.landing-light) #screen-buyer-auth .auth-card,
body:has(#screen-landing.landing-light) #screen-supplier-auth .auth-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.78), rgba(247, 245, 240, 0.7));
  border-color: rgba(24, 33, 27, 0.12);
  box-shadow:
    inset 0 1.5px 0.5px rgba(255, 255, 255, 0.95),
    0 40px 90px -24px rgba(24, 33, 27, 0.35);
}

body:has(#screen-landing.landing-light) #screen-buyer-auth .auth-close,
body:has(#screen-landing.landing-light) #screen-supplier-auth .auth-close {
  color: rgba(24, 33, 27, 0.6);
  background: rgba(24, 33, 27, 0.06);
  border-color: rgba(24, 33, 27, 0.12);
}

body:has(#screen-landing.landing-light) #screen-buyer-auth .auth-tabs,
body:has(#screen-landing.landing-light) #screen-supplier-auth .auth-tabs {
  background: rgba(24, 33, 27, 0.06);
  border-color: rgba(24, 33, 27, 0.1);
}

body:has(#screen-landing.landing-light) #screen-buyer-auth .auth-tab,
body:has(#screen-landing.landing-light) #screen-supplier-auth .auth-tab {
  color: rgba(24, 33, 27, 0.55);
}

body:has(#screen-landing.landing-light) #screen-buyer-auth .auth-tab-active,
body:has(#screen-landing.landing-light) #screen-supplier-auth .auth-tab-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 3px rgba(24, 33, 27, 0.12);
}

body:has(#screen-landing.landing-light) #screen-buyer-auth .auth-input,
body:has(#screen-landing.landing-light) #screen-supplier-auth .auth-input,
body:has(#screen-landing.landing-light) #screen-buyer-auth .form-input,
body:has(#screen-landing.landing-light) #screen-supplier-auth .form-input {
  color: var(--ink);
  background: rgba(24, 33, 27, 0.05);
  border-color: rgba(24, 33, 27, 0.16);
}

body:has(#screen-landing.landing-light) #screen-buyer-auth .auth-input::placeholder,
body:has(#screen-landing.landing-light) #screen-supplier-auth .auth-input::placeholder,
body:has(#screen-landing.landing-light) #screen-buyer-auth .form-input::placeholder,
body:has(#screen-landing.landing-light) #screen-supplier-auth .form-input::placeholder {
  color: rgba(24, 33, 27, 0.4);
}

body:has(#screen-landing.landing-light) #screen-buyer-auth .auth-input:focus,
body:has(#screen-landing.landing-light) #screen-supplier-auth .auth-input:focus,
body:has(#screen-landing.landing-light) #screen-buyer-auth .form-input:focus,
body:has(#screen-landing.landing-light) #screen-supplier-auth .form-input:focus {
  background: #fff;
  border-color: rgba(22, 163, 74, 0.55);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.14);
}

body:has(#screen-landing.landing-light) #screen-buyer-auth .auth-error,
body:has(#screen-landing.landing-light) #screen-supplier-auth .auth-error {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.25);
}

@media (max-width: 480px) {
  #screen-buyer-auth,
  #screen-supplier-auth {
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
    align-items: flex-start;
  }

  #screen-buyer-auth .auth-card,
  #screen-supplier-auth .auth-card {
    padding: 26px 18px 22px;
    border-radius: 20px;
    max-height: calc(100dvh - 24px);
  }

  #screen-buyer-auth .auth-title,
  #screen-supplier-auth .auth-title {
    font-size: 20px;
  }

  #screen-buyer-auth .auth-input,
  #screen-supplier-auth .auth-input {
    font-size: 16px; /* без автозума iOS */
  }
}

@media (max-height: 700px) {
  #screen-buyer-auth,
  #screen-supplier-auth {
    align-items: flex-start;
  }

  #screen-buyer-auth .auth-card,
  #screen-supplier-auth .auth-card {
    margin-top: 8px;
    margin-bottom: 8px;
  }
}
