/* Harbor auth — motion & polish */

.auth-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--d, 0s);
}

.auth-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.brand-panel {
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(63, 181, 162, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 80%, rgba(249, 133, 60, 0.28) 0%, transparent 50%),
    linear-gradient(155deg, #0a2624 0%, #174f49 42%, #1a7a6d 72%, #c0380c 140%);
}

.brand-wave {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  opacity: 0.35;
}

.brand-wave path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 1.2;
  stroke-dasharray: 8 10;
  animation: wave-drift 18s linear infinite;
}

.brand-wave path:nth-child(2) {
  animation-duration: 24s;
  animation-direction: reverse;
  opacity: 0.55;
}

.brand-wave path:nth-child(3) {
  animation-duration: 30s;
  opacity: 0.4;
}

@keyframes wave-drift {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: -360;
  }
}

.float-card {
  animation: float-card 7s ease-in-out infinite;
}

.float-card:nth-child(2) {
  animation-delay: -2.2s;
}

.float-card:nth-child(3) {
  animation-delay: -4s;
}

@keyframes float-card {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.mode-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 1rem;
  background: rgba(236, 238, 242, 0.85);
}

.mode-tabs__thumb {
  position: absolute;
  top: 0.25rem;
  bottom: 0.25rem;
  width: calc(50% - 0.25rem);
  border-radius: 0.8rem;
  background: white;
  box-shadow: 0 4px 14px rgba(34, 38, 47, 0.08);
  inset-inline-start: 0.25rem;
  transition: inset-inline-start 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.mode-tabs[data-mode="signup"] .mode-tabs__thumb {
  inset-inline-start: calc(50% + 0.125rem);
}

.mode-tab {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  padding: 0.7rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #667694;
  transition: color 0.3s ease;
}

.mode-tabs[data-mode="login"] .mode-tab[data-mode="login"],
.mode-tabs[data-mode="signup"] .mode-tab[data-mode="signup"] {
  color: #15423d;
}

.form-panel {
  position: relative;
}

.form-view {
  display: none;
}

.form-view.is-active {
  display: block;
  animation: form-swap 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes form-swap {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* RTL: آیکون چشم سمت چپ، متن/placeholder سمت راست */
.password-field {
  position: relative;
}

.password-field .password-input.field-input {
  direction: rtl;
  text-align: right;
  padding-left: 3rem !important;
  padding-right: 1rem !important;
}

.password-toggle {
  position: absolute;
  top: 50%;
  left: 0.65rem;
  right: auto;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: #8593ae;
  z-index: 2;
  transition: color 0.2s ease, background 0.2s ease;
}

.password-toggle:hover {
  color: #1a7a6d;
  background: rgba(213, 242, 236, 0.7);
}

.strength-bar {
  height: 0.35rem;
  border-radius: 9999px;
  background: #eceef2;
  overflow: hidden;
}

.strength-bar__fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition:
    width 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.4s ease;
}

.strength-bar__fill.level-1 {
  width: 25%;
  background: #e84d0c;
}

.strength-bar__fill.level-2 {
  width: 50%;
  background: #f9853c;
}

.strength-bar__fill.level-3 {
  width: 75%;
  background: #3fb5a2;
}

.strength-bar__fill.level-4 {
  width: 100%;
  background: #1a7a6d;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  border-radius: 0.9rem;
  border: 1px solid rgba(181, 185, 203, 0.75);
  background: rgba(255, 255, 255, 0.85);
  padding: 0.7rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #343947;
  transition: all 0.3s ease;
}

.social-btn:hover {
  border-color: #74cfbf;
  background: #f0faf8;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(26, 122, 109, 0.1);
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  color: #8593ae;
  font-size: 0.75rem;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: linear-gradient(90deg, transparent, #d5dae3, transparent);
}

.shake {
  animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
  10%,
  90% {
    transform: translateX(-2px);
  }
  20%,
  80% {
    transform: translateX(4px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-6px);
  }
  40%,
  60% {
    transform: translateX(6px);
  }
}

.btn-loading {
  pointer-events: none;
  opacity: 0.85;
}

.btn-loading .btn-label {
  opacity: 0;
}

.btn-spinner {
  position: absolute;
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: white;
  border-radius: 9999px;
  animation: spin 0.7s linear infinite;
}

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

.toast {
  position: fixed;
  inset-inline-start: 50%;
  bottom: 1.5rem;
  z-index: 50;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  border-radius: 1rem;
  background: #15423d;
  color: white;
  padding: 0.85rem 1.15rem;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 16px 40px rgba(10, 38, 36, 0.28);
  transition:
    opacity 0.35s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

html[dir="rtl"] .toast {
  transform: translate(50%, 20px);
}

.toast.is-shown {
  opacity: 1;
  transform: translate(-50%, 0);
}

html[dir="rtl"] .toast.is-shown {
  transform: translate(50%, 0);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.8rem;
  color: #515e7a;
  line-height: 1.5;
}

.check-row input {
  margin-top: 0.15rem;
  width: 1rem;
  height: 1rem;
  accent-color: #1a7a6d;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .auth-reveal,
  .form-view.is-active,
  .float-card,
  .brand-wave path {
    animation: none !important;
    transition: none !important;
  }

  .auth-reveal {
    opacity: 1;
    transform: none;
  }
}
