/* The sign-in page: the website's brand panel on one side, the form on the other. */
:root {
  --auth-teal-950: #042f2c;
  --auth-teal-800: #0b5f59;
  --auth-teal-700: #0f766e;
  --auth-teal-600: #0f9488;
  --auth-teal-400: #2dd4bf;
  --auth-teal-200: #99f6e4;
  --auth-mint: #effcf9;
  --auth-ink: #0b1f24;
  --auth-muted: #5b6b70;
  --auth-line: #dbe5e6;
  --auth-accent: #f97316;
}

html,
body.auth {
  min-height: 100%;
}

body.auth {
  margin: 0;
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  color: var(--auth-ink);
  background: #f4f8f8;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---- Brand panel */
.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.5rem clamp(2rem, 5vw, 4.5rem);
  overflow: hidden;
  color: #fff;
  background: radial-gradient(130% 120% at 85% 5%, #14b8a6 0%, #0f766e 38%, #042f2c 100%);
  isolation: isolate;
}

.auth-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.auth-blob {
  position: absolute;
  border-radius: 50%;
  animation: auth-drift 14s ease-in-out infinite alternate;
}

.auth-blob-1 { width: 30rem; height: 30rem; inset-inline-end: -10rem; top: -10rem; background: radial-gradient(circle, rgba(153, 246, 228, 0.45), transparent 70%); }
.auth-blob-2 { width: 24rem; height: 24rem; inset-inline-start: -8rem; bottom: -8rem; background: radial-gradient(circle, rgba(45, 212, 191, 0.4), transparent 70%); animation-duration: 18s; }
.auth-blob-3 { width: 12rem; height: 12rem; inset-inline-end: 22%; bottom: 18%; background: radial-gradient(circle, rgba(249, 115, 22, 0.35), transparent 70%); animation-duration: 11s; }

@keyframes auth-drift {
  to { transform: translate3d(2rem, 1.5rem, 0) scale(1.12); }
}

.auth-pulse {
  position: absolute;
  inset-inline: 0;
  bottom: 14%;
  width: 100%;
  height: 120px;
  opacity: 0.45;
}

.auth-pulse path {
  fill: none;
  stroke: #99f6e4;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: auth-draw 3s ease-out 0.4s forwards, auth-glow 2.6s ease-in-out 3.4s infinite;
}

@keyframes auth-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes auth-glow {
  50% { stroke: #fff; filter: drop-shadow(0 0 6px rgba(153, 246, 228, 0.9)); }
}

.auth-floats {
  position: absolute;
  inset: 0;
}

.auth-float {
  position: absolute;
  display: grid;
  place-items: center;
  width: 3.6rem;
  height: 3.6rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 1.1rem;
  backdrop-filter: blur(6px);
  animation: auth-bob 7s ease-in-out infinite;
}

.auth-float svg,
.auth-feature-icon svg {
  width: 1.6rem;
  height: 1.6rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-float:nth-of-type(1) { inset-inline-end: 9%; top: 17%; }
.auth-float:nth-of-type(2) { inset-inline-end: 24%; top: 9%; width: 3rem; height: 3rem; animation-delay: -2s; }
.auth-float:nth-of-type(3) { inset-inline-end: 7%; top: 42%; width: 3.1rem; height: 3.1rem; animation-delay: -4s; }
.auth-float:nth-of-type(4) { inset-inline-end: 16%; bottom: 26%; animation-delay: -1s; }
.auth-float:nth-of-type(5) { inset-inline-end: 34%; bottom: 8%; width: 2.8rem; height: 2.8rem; animation-delay: -5s; }

@keyframes auth-bob {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(0, -16px, 0) rotate(4deg); }
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  align-self: flex-start;
  color: #fff;
  text-decoration: none;
}

.auth-logo img {
  border-radius: 27%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 10px 24px -8px rgba(0, 0, 0, 0.4);
}

.auth-logo span {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.auth-logo strong {
  font-size: 1.6rem;
  font-weight: 800;
}

.auth-logo small {
  margin-top: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: var(--auth-teal-200);
}

.auth-pitch {
  max-width: 30rem;
}

.auth-pitch h1 {
  margin-bottom: 0.9rem;
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  font-weight: 800;
  line-height: 1.3;
  animation: auth-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both;
}

.auth-pitch p {
  margin-bottom: 2rem;
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.85);
  animation: auth-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both;
}

.auth-pitch ul {
  display: grid;
  gap: 0.9rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.auth-pitch li {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-weight: 500;
  animation: auth-rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) var(--delay, 0ms) both;
}

.auth-feature-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0.9rem;
}

@keyframes auth-rise {
  from { opacity: 0; transform: translate3d(0, 24px, 0); }
}

.auth-brand-foot {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ---- Form side */
.auth-main {
  display: flex;
  flex-direction: column;
  padding: 1.5rem clamp(1.25rem, 4vw, 3rem) 2.5rem;
  background:
    radial-gradient(60% 40% at 100% 0%, rgba(45, 212, 191, 0.12), transparent 70%),
    radial-gradient(50% 40% at 0% 100%, rgba(249, 115, 22, 0.07), transparent 70%),
    #f4f8f8;
}

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.auth-back,
.auth-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--auth-muted);
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--auth-line);
  border-radius: 999px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.auth-back:hover,
.auth-lang:hover,
.auth-lang:focus-visible {
  color: var(--auth-teal-700);
  border-color: var(--auth-teal-400);
}

.auth-back svg,
.auth-lang svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[dir="rtl"] .auth-back svg {
  transform: scaleX(-1);
}

.dropdown-item.active,
.dropdown-item:active {
  background-color: var(--auth-teal-700);
}

.auth-card {
  width: min(100%, 27rem);
  margin: auto;
  padding: 2.5rem clamp(1.5rem, 4vw, 2.5rem) 2rem;
  background: #fff;
  border: 1px solid rgba(219, 229, 230, 0.8);
  border-radius: 1.6rem;
  box-shadow: 0 30px 70px -35px rgba(4, 47, 44, 0.45);
  animation: auth-rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.auth-card-logo {
  display: block;
  margin: 0 auto 1rem;
  border-radius: 27%;
  box-shadow: 0 14px 30px -12px rgba(15, 118, 110, 0.75);
}

.auth-card h2 {
  margin-bottom: 0.35rem;
  font-size: 1.65rem;
  font-weight: 800;
  text-align: center;
  color: var(--auth-teal-950);
}

.auth-sub {
  margin-bottom: 1.75rem;
  text-align: center;
  color: var(--auth-muted);
}

.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
  color: #9f1d1d;
  background: #fdf0f0;
  border: 1px solid #f5c9c9;
  border-radius: 0.9rem;
  animation: auth-shake 0.45s ease;
}

.auth-error svg {
  flex: none;
  width: 1.3rem;
  height: 1.3rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

@keyframes auth-shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

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

.auth-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.auth-input {
  position: relative;
  display: flex;
  align-items: center;
  background: #f7fafa;
  border: 1.5px solid var(--auth-line);
  border-radius: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-input:focus-within {
  background: #fff;
  border-color: var(--auth-teal-600);
  box-shadow: 0 0 0 4px rgba(15, 148, 136, 0.15);
}

.auth-input.is-invalid {
  border-color: #d03b3b;
  box-shadow: 0 0 0 4px rgba(208, 59, 59, 0.12);
}

.auth-input > svg {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-inline-start: 0.95rem;
  fill: none;
  stroke: #8a9aa0;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s ease;
}

.auth-input:focus-within > svg {
  stroke: var(--auth-teal-600);
}

.auth-input input {
  flex: 1;
  min-width: 0;
  padding: 0.85rem 0.8rem;
  font-size: 1rem;
  color: var(--auth-ink);
  background: transparent;
  border: 0;
  outline: none;
}

[dir="rtl"] .auth-input input[dir="ltr"] {
  text-align: right;
}

.auth-eye {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  margin-inline-end: 0.3rem;
  padding: 0;
  color: #8a9aa0;
  background: transparent;
  border: 0;
  border-radius: 0.7rem;
}

.auth-eye:hover,
.auth-eye:focus-visible {
  color: var(--auth-teal-700);
  background: var(--auth-mint);
  outline: none;
}

.auth-eye svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-eye .eye-closed,
.auth-eye.is-shown .eye-open {
  display: none;
}

.auth-eye.is-shown .eye-closed {
  display: block;
}

.auth-caps {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #b45309;
}

.auth-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  margin-top: 1.6rem;
  padding: 0.9rem 1rem;
  font-size: 1.08rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--auth-teal-600), var(--auth-teal-800));
  border: 0;
  border-radius: 999px;
  box-shadow: 0 14px 30px -14px rgba(15, 118, 110, 0.95);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.auth-submit:hover,
.auth-submit:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px -14px rgba(15, 118, 110, 1);
  filter: brightness(1.05);
  outline: none;
}

.auth-submit > svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

[dir="rtl"] .auth-submit > svg {
  transform: scaleX(-1);
}

.auth-submit:hover > svg {
  transform: translateX(4px);
}

[dir="rtl"] .auth-submit:hover > svg {
  transform: scaleX(-1) translateX(4px);
}

/* While the sign-in is on its way, a spinner instead of the arrow. */
.auth-submit-busy {
  display: none;
  width: 1.2rem;
  height: 1.2rem;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}

.auth-submit.is-busy {
  pointer-events: none;
  filter: saturate(0.8);
}

.auth-submit.is-busy .auth-submit-busy {
  display: block;
}

.auth-submit.is-busy > svg {
  display: none;
}

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

.auth-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.8rem 1rem;
  margin-top: 1.5rem;
  font-size: 0.88rem;
  color: var(--auth-muted);
  background: var(--auth-mint);
  border-radius: 0.9rem;
}

.auth-hint svg {
  flex: none;
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.15rem;
  fill: none;
  stroke: var(--auth-teal-600);
  stroke-width: 2;
  stroke-linecap: round;
}

/* ---- Phones and small tablets: the brand panel becomes a band above the form. */
@media (max-width: 899.98px) {
  .auth-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .auth-brand {
    gap: 1.25rem;
    padding: 1.5rem 1.25rem 4.5rem;
  }

  .auth-pitch h1 {
    font-size: 1.6rem;
  }

  .auth-pitch p {
    margin-bottom: 0;
    font-size: 1rem;
  }

  .auth-pitch ul,
  .auth-brand-foot,
  .auth-float:nth-of-type(n + 3) {
    display: none;
  }

  .auth-main {
    padding-top: 0;
  }

  .auth-topbar {
    position: absolute;
    top: 1.5rem;
    inset-inline-end: 1.25rem;
  }

  .auth-back {
    display: none;
  }

  .auth-lang {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.3);
  }

  .auth-card {
    margin-top: -3rem;
    margin-bottom: 0;
  }

  .auth-card-logo {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .auth-pulse path {
    stroke-dashoffset: 0;
  }
}
