/* Shkian OTP auth modal — clinical teal, desktop + mobile */

.shk-auth-modal {
  --am-font: "Vazirmatn", Tahoma, sans-serif;
  --am-ink: #0b1f2a;
  --am-muted: #5b6b76;
  --am-soft: #8a9aa6;
  --am-teal: #0f766e;
  --am-teal-mid: #0d9488;
  --am-teal-soft: rgba(15, 118, 110, 0.1);
  --am-teal-line: rgba(15, 118, 110, 0.28);
  --am-surface: #ffffff;
  --am-wash: #f3f8f9;
  --am-danger: #b42318;
  --am-danger-bg: #fef3f2;
  --am-ok: #0f766e;
  --am-ok-bg: #ecfdf8;
  --am-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  font-family: var(--am-font);
  color: var(--am-ink);
}

.shk-auth-modal[hidden] {
  display: none !important;
}

.shk-auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(15, 118, 110, 0.22), transparent 60%),
    rgba(8, 24, 32, 0.58);
  backdrop-filter: blur(8px) saturate(1.15);
  -webkit-backdrop-filter: blur(8px) saturate(1.15);
  animation: shkAuthFade 0.28s var(--am-ease) both;
}

.shk-auth-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 26.5rem);
  max-height: min(92vh, 40rem);
  overflow: auto;
  background: var(--am-surface);
  border-radius: 1.5rem;
  border: 1px solid rgba(15, 35, 45, 0.08);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 28px 80px rgba(8, 24, 32, 0.28);
  padding: 0 0 1.35rem;
  animation: shkAuthRise 0.38s var(--am-ease) both;
  -webkit-overflow-scrolling: touch;
}

.shk-auth-modal__accent {
  height: 0.35rem;
  background: linear-gradient(90deg, #0f766e 0%, #14b8a6 55%, #0e7490 100%);
  border-radius: 1.5rem 1.5rem 0 0;
}

.shk-auth-modal__close {
  position: absolute;
  top: 1rem;
  left: 0.85rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid rgba(15, 35, 45, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--am-muted);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.shk-auth-modal__close:hover {
  color: var(--am-teal);
  border-color: var(--am-teal-line);
  background: var(--am-wash);
}

.shk-auth-modal__close:active {
  transform: scale(0.96);
}

.shk-auth-modal__head {
  padding: 1.45rem 1.5rem 0.35rem;
  text-align: center;
}

.shk-auth-modal__icon {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  margin: 0.15rem auto 0.95rem;
  border-radius: 1.05rem;
  background:
    linear-gradient(160deg, rgba(20, 184, 166, 0.16), rgba(15, 118, 110, 0.08)),
    var(--am-wash);
  border: 1px solid var(--am-teal-line);
  color: var(--am-teal);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.12);
}

.shk-auth-modal__icon svg {
  width: 1.55rem;
  height: 1.55rem;
}

.shk-auth-modal__brand {
  margin: 0 0 0.35rem;
  color: var(--am-teal);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.shk-auth-modal__title {
  margin: 0 0 0.4rem;
  font-size: clamp(1.35rem, 3.5vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--am-ink);
  line-height: 1.25;
}

.shk-auth-modal__lead {
  margin: 0 auto 0.15rem;
  max-width: 22rem;
  color: var(--am-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* Removed step pills — hide if any cached markup still ships them */
.shk-auth-modal__steps,
.shk-auth-modal__step,
.shk-auth-modal__step-num {
  display: none !important;
}

.shk-auth-modal__form {
  padding: 0.75rem 1.5rem 0;
}

.shk-auth-modal__field {
  margin-bottom: 0.95rem;
}

.shk-auth-modal__field label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.8125rem;
  color: #334155;
  font-weight: 700;
}

.shk-auth-modal__phone {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  direction: ltr;
  border: 1.5px solid rgba(15, 35, 45, 0.1);
  border-radius: 0.95rem;
  background: var(--am-wash);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.shk-auth-modal__phone:focus-within {
  border-color: var(--am-teal-mid);
  background: #fff;
  box-shadow: 0 0 0 4px var(--am-teal-soft);
}

.shk-auth-modal__prefix {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  order: -1;
  padding: 0 0.85rem;
  border-right: 1px solid rgba(15, 35, 45, 0.08);
  border-left: 0;
  background: rgba(255, 255, 255, 0.55);
  color: var(--am-teal);
  font-size: 0.8125rem;
  font-weight: 800;
  white-space: nowrap;
  direction: ltr;
}

.shk-auth-modal__prefix-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #14b8a6, #0f766e);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}

.shk-auth-modal__field input,
.shk-auth-modal__phone input {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  outline: none;
  background: transparent;
  padding: 0.95rem 0.95rem;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--am-ink);
  direction: ltr;
  text-align: left;
  letter-spacing: 0.04em;
}

.shk-auth-modal__field input::placeholder,
.shk-auth-modal__phone input::placeholder {
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0;
}

.shk-auth-modal__code-shell {
  border: 1.5px solid rgba(15, 35, 45, 0.1);
  border-radius: 0.95rem;
  background: var(--am-wash);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.shk-auth-modal__code-shell:focus-within {
  border-color: var(--am-teal-mid);
  background: #fff;
  box-shadow: 0 0 0 4px var(--am-teal-soft);
}

.shk-auth-modal__code-shell input {
  text-align: center;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0.42em;
  padding-inline-start: 0.7em;
}

.shk-auth-modal__hint {
  margin: 0.45rem 0 0;
  font-size: 0.75rem;
  color: var(--am-soft);
  line-height: 1.5;
}

.shk-auth-modal__sent-to {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.85rem;
  background: var(--am-ok-bg);
  border: 1px solid rgba(15, 118, 110, 0.14);
  color: var(--am-ok);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.55;
  text-align: center;
}

.shk-auth-modal__sent-to[hidden] {
  display: none !important;
}

.shk-auth-modal__sent-to strong {
  direction: ltr;
  unicode-bidi: plaintext;
  font-weight: 800;
}

.shk-auth-modal__error,
.shk-auth-modal__ok {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.85rem;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.55;
}

.shk-auth-modal__error {
  color: var(--am-danger);
  background: var(--am-danger-bg);
  border: 1px solid rgba(180, 35, 24, 0.12);
}

.shk-auth-modal__ok {
  color: var(--am-ok);
  background: var(--am-ok-bg);
  border: 1px solid rgba(15, 118, 110, 0.14);
}

.shk-auth-modal__error[hidden],
.shk-auth-modal__ok[hidden] {
  display: none !important;
}

.shk-auth-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.shk-auth-modal__submit,
.shk-auth-modal__actions .btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3rem;
  margin: 0 !important;
  padding: 0.85rem 1.1rem !important;
  border-radius: 999px !important;
  border: 1.5px solid transparent !important;
  font-family: inherit !important;
  font-size: 0.95rem !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.2s var(--am-ease), box-shadow 0.2s, background 0.2s, border-color 0.2s, color 0.2s, opacity 0.2s;
}

.shk-auth-modal__submit,
.shk-auth-modal__actions .btn-primary,
.shk-auth-modal__actions .shk-auth-modal__submit {
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 55%, #0e7490 100%) !important;
  color: #fff !important;
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.28);
}

.shk-auth-modal__submit:hover,
.shk-auth-modal__actions .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(15, 118, 110, 0.34);
  color: #fff !important;
}

.shk-auth-modal__submit:disabled,
.shk-auth-modal__actions .btn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none !important;
}

.shk-auth-modal__secondary,
.shk-auth-modal__actions .btn-ghost {
  background: #fff !important;
  color: var(--am-ink) !important;
  border-color: rgba(15, 35, 45, 0.12) !important;
  box-shadow: none !important;
}

.shk-auth-modal__secondary:hover,
.shk-auth-modal__actions .btn-ghost:hover {
  border-color: var(--am-teal-line) !important;
  color: var(--am-teal) !important;
  background: var(--am-wash) !important;
}

.shk-auth-modal__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.shk-auth-modal__row[hidden] {
  display: none !important;
}

.shk-auth-modal__foot {
  margin: 1.15rem 1.5rem 0;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(15, 35, 45, 0.06);
  text-align: center;
  color: var(--am-soft);
  font-size: 0.75rem;
  line-height: 1.55;
}

.shk-auth-modal__foot strong {
  color: var(--am-teal);
  font-weight: 700;
}

body.shk-auth-modal-open {
  overflow: hidden;
}

@keyframes shkAuthFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shkAuthRise {
  from {
    opacity: 0;
    transform: translateY(1rem) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 520px) {
  .shk-auth-modal {
    align-items: flex-end;
    padding: 0;
  }

  .shk-auth-modal__panel {
    width: 100%;
    max-width: none;
    max-height: min(94vh, 44rem);
    border-radius: 1.35rem 1.35rem 0 0;
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
    animation: shkAuthSheet 0.36s var(--am-ease) both;
  }

  .shk-auth-modal__accent {
    border-radius: 1.35rem 1.35rem 0 0;
  }

  .shk-auth-modal__head {
    padding: 1.2rem 1.15rem 0.25rem;
  }

  .shk-auth-modal__form {
    padding: 0.65rem 1.15rem 0;
  }

  .shk-auth-modal__foot {
    margin-inline: 1.15rem;
  }

  .shk-auth-modal__close {
    top: 0.85rem;
    left: 0.75rem;
  }

  .shk-auth-modal__code-shell input {
    font-size: 1.4rem;
    letter-spacing: 0.34em;
  }
}

@keyframes shkAuthSheet {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shk-auth-modal__backdrop,
  .shk-auth-modal__panel {
    animation: none;
  }

  .shk-auth-modal__submit:hover,
  .shk-auth-modal__actions .btn-primary:hover {
    transform: none;
  }
}
