/* رویش پنل — auth password + captcha (mobile-first) */
:root {
  --auth-primary: #0f766e;
  --auth-primary-deep: #115e59;
  --auth-on-primary: #ffffff;
  --auth-secondary: #1e3a5f;
  --auth-bg: #f0fdfa;
  --auth-fg: #0f2f2c;
  --auth-muted: #4b6b66;
  --auth-border: #99f6e4;
  --auth-surface: #ffffff;
  --auth-danger: #dc2626;
  --auth-ring: #0f766e;
  --auth-radius: 1rem;
  --auth-font-display: "Markazi Text", "Vazirmatn", Tahoma, sans-serif;
  --auth-font-body: "Vazirmatn", Tahoma, sans-serif;
  --auth-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --auth-safe-b: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body.auth-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--auth-font-body);
  color: var(--auth-fg);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(20, 184, 166, 0.18), transparent 55%),
    radial-gradient(90% 70% at 0% 100%, rgba(15, 118, 110, 0.12), transparent 50%),
    linear-gradient(165deg, #ecfdf8 0%, var(--auth-bg) 45%, #e0f2fe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1.25rem, var(--auth-safe-b));
  touch-action: manipulation;
  overflow-x: hidden;
}

.auth-shell {
  width: min(100%, 26rem);
}

.auth-panel {
  background: var(--auth-surface);
  border: 1px solid color-mix(in srgb, var(--auth-border) 70%, transparent);
  border-radius: var(--auth-radius);
  padding: clamp(1.25rem, 4vw, 1.85rem);
  box-shadow: 0 12px 40px rgba(15, 47, 44, 0.07);
}

.auth-brand {
  text-align: center;
  margin-bottom: 1.25rem;
}

.auth-brand__name {
  margin: 0;
  font-family: var(--auth-font-display);
  font-size: clamp(2rem, 7vw, 2.45rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--auth-primary);
  letter-spacing: -0.02em;
}

.auth-brand__tag {
  margin: 0.35rem 0 0;
  color: var(--auth-muted);
  font-size: 0.9rem;
}

.auth-title {
  margin: 0 0 0.35rem;
  font-family: var(--auth-font-display);
  font-size: clamp(1.35rem, 4.5vw, 1.65rem);
  font-weight: 700;
  text-align: center;
  color: var(--auth-secondary);
}

.auth-lead {
  margin: 0 0 1.25rem;
  text-align: center;
  color: var(--auth-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.auth-alert {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.auth-alert--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.auth-alert--info {
  background: #f0fdfa;
  color: var(--auth-primary-deep);
  border: 1px solid var(--auth-border);
}

.auth-field {
  margin-bottom: 1rem;
}

.auth-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--auth-fg);
}

.auth-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--auth-muted);
}

.auth-input {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--auth-border);
  border-radius: 0.75rem;
  background: #fff;
  color: var(--auth-fg);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 180ms var(--auth-ease), box-shadow 180ms var(--auth-ease);
}

.auth-input:focus {
  outline: none;
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-ring) 28%, transparent);
}

.auth-input--ltr {
  direction: ltr;
  text-align: left;
  letter-spacing: 0.04em;
}

.auth-input--otp {
  text-align: center;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  padding-inline-start: 0.55rem;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.75rem;
  background: var(--auth-primary);
  color: var(--auth-on-primary);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 180ms var(--auth-ease), transform 160ms var(--auth-ease), opacity 160ms var(--auth-ease);
}

.auth-btn:hover:not(:disabled) {
  background: var(--auth-primary-deep);
}

.auth-btn:active:not(:disabled) {
  transform: translateY(1px);
}

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

.auth-btn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--auth-ring) 45%, transparent);
  outline-offset: 2px;
}

.auth-btn.is-loading {
  pointer-events: none;
  opacity: 0.8;
}

.auth-btn__spinner {
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}

.auth-link-row {
  margin-top: 1.15rem;
  text-align: center;
}

.auth-link {
  color: var(--auth-primary);
  font-size: 0.9rem;
  text-decoration: none;
  font-weight: 600;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-meta {
  margin: 0 0 1rem;
  text-align: center;
  color: var(--auth-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.auth-meta strong {
  color: var(--auth-fg);
  font-weight: 700;
}

.auth-resend {
  margin-top: 0.85rem;
  text-align: center;
}

.auth-resend__btn {
  min-height: 44px;
  padding: 0.4rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--auth-primary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-resend__btn:disabled {
  color: var(--auth-muted);
  text-decoration: none;
  cursor: not-allowed;
}

.auth-resend__hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--auth-muted);
}

.auth-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 0.35rem;
  color: var(--auth-muted);
  font-size: 0.85rem;
  text-decoration: none;
}

.auth-back:hover {
  color: var(--auth-primary);
}

.auth-captcha {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: center;
}

.auth-captcha__img-wrap {
  display: block;
  line-height: 0;
  padding: 0;
  margin: 0;
  border-radius: 0.65rem;
  overflow: hidden;
  border: 1px solid var(--auth-border);
  background: #f8fafc;
  cursor: pointer;
}

.auth-captcha__img {
  display: block;
  width: 160px;
  height: 52px;
  cursor: pointer;
}

.auth-captcha__input {
  margin: 0;
}

@media (max-width: 380px) {
  .auth-captcha {
    grid-template-columns: 1fr;
  }

  .auth-captcha__img {
    width: 100%;
    height: auto;
  }
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-btn,
  .auth-input,
  .auth-btn__spinner {
    transition: none !important;
    animation: none !important;
  }
}

@media (max-width: 380px) {
  .auth-panel {
    padding: 1.1rem;
  }

  .auth-input--otp {
    letter-spacing: 0.22em;
    font-size: 1.25rem;
  }
}
