/* =====================================================
   Orchid - Authentication pages shared styles
   Namespace: .auth-*
   Used by: login, register, forgot-password, reset-password,
            lock-screen, two-factor
   ===================================================== */

.auth-body {
  --auth-indigo: #4f46e5;
  --auth-violet: #8b5cf6;
  --auth-cyan: #22d3ee;
  --auth-fuchsia: #d946ef;
  --auth-success: #10b981;
  --auth-danger: #ef4444;
  --auth-warning: #f59e0b;
  min-height: 100vh;
  background-color: var(--orchid-bg);
  overflow-x: hidden;
}

/* ---------- Shell ---------- */
.auth-shell {
  display: grid;
  grid-template-columns: 6fr 4fr;
  min-height: 100vh;
  position: relative;
}
@media (max-width: 991.98px) {
  .auth-shell { grid-template-columns: 1fr; }
}

/* ---------- Hero panel (left) ---------- */
.auth-hero {
  position: relative;
  overflow: hidden;
  padding: 2.5rem 3rem;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 15% 20%, rgba(217, 70, 239, .35), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(34, 211, 238, .32), transparent 45%),
    linear-gradient(135deg, #4338ca 0%, #6d28d9 40%, #0e7490 100%);
  isolation: isolate;
}
@media (max-width: 991.98px) {
  .auth-hero { display: none; }
}

/* Animated overlay dots grid */
.auth-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, .18) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse at center, #000 45%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 45%, transparent 80%);
  animation: auth-drift 22s linear infinite;
  z-index: -1;
  opacity: .55;
}
@keyframes auth-drift {
  0%   { transform: translate3d(0, 0, 0); }
  50%  { transform: translate3d(-24px, -18px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

/* Floating decorative orbs */
.auth-hero::after {
  content: '';
  position: absolute;
  right: -120px; bottom: -140px;
  width: 380px; height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .22), transparent 70%);
  filter: blur(20px);
  z-index: -1;
  animation: auth-float 12s ease-in-out infinite;
}
@keyframes auth-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(-20px, -30px, 0); }
}

.auth-hero__brand {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -.02em;
  font-size: 1.375rem;
}
.auth-hero__brand-mark {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .16);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .22);
}
.auth-hero__brand-mark svg { width: 26px; height: 26px; }

.auth-hero__body {
  max-width: 520px;
  margin: 2rem 0;
}
.auth-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.auth-hero__title {
  font-size: clamp(1.9rem, 3vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.02em;
  margin-bottom: 1rem;
}
.auth-hero__lead {
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, .85);
  margin-bottom: 1.5rem;
}

/* Feature bullets */
.auth-hero__features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .75rem;
}
.auth-hero__features li {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  font-size: .95rem;
  color: rgba(255, 255, 255, .92);
}
.auth-hero__features i {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .18);
  border-radius: 8px;
  font-size: .875rem;
}

/* Testimonial card */
.auth-hero__testimonial {
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(12px);
  border-radius: 18px;
  padding: 1.25rem 1.4rem;
  max-width: 520px;
}
.auth-hero__testimonial p {
  font-size: 1rem;
  line-height: 1.55;
  margin: 0 0 .9rem 0;
  color: #fff;
  font-weight: 500;
}
.auth-hero__testimonial-footer {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.auth-hero__testimonial-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f472b6, #a78bfa);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: .875rem;
  border: 2px solid rgba(255, 255, 255, .3);
}
.auth-hero__testimonial-meta { line-height: 1.3; }
.auth-hero__testimonial-name { font-weight: 700; font-size: .9rem; color: #fff; }
.auth-hero__testimonial-role { font-size: .78rem; color: rgba(255, 255, 255, .75); }

/* ---------- Form panel (right) ---------- */
.auth-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  background-color: var(--orchid-surface);
  overflow-y: auto;
}
@media (min-width: 576px) {
  .auth-panel { padding: 2.5rem 2.5rem; }
}
@media (min-width: 992px) {
  .auth-panel { padding: 2rem 3rem; }
}

.auth-panel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.auth-panel__brand-sm {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  color: var(--orchid-text);
  font-weight: 700;
  letter-spacing: -.02em;
}
.auth-panel__brand-sm svg { width: 26px; height: 26px; }
.auth-panel__brand-sm span {
  background: linear-gradient(90deg, #4f46e5, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1.15rem;
}

.auth-panel__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 0;
}

.auth-panel__footer {
  text-align: center;
  color: var(--orchid-text-muted);
  font-size: .8125rem;
  padding-top: 1.25rem;
}

/* ---------- Form heading ---------- */
.auth-form__eyebrow {
  color: var(--auth-indigo);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .5rem;
}
.auth-form__title {
  font-size: clamp(1.6rem, 2.2vw, 2rem);
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0 0 .5rem 0;
  color: var(--orchid-text);
}
.auth-form__subtitle {
  color: var(--orchid-text-muted);
  margin-bottom: 1.75rem;
  font-size: .95rem;
}

/* ---------- Form controls ---------- */
.auth-form .form-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--orchid-text);
  margin-bottom: .375rem;
}
.auth-form .form-control,
.auth-form .form-select {
  border-radius: 12px;
  padding: .7rem .95rem;
  border: 1px solid var(--orchid-border);
  background-color: var(--orchid-surface);
  color: var(--orchid-text);
  font-size: .925rem;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
.auth-form .form-control::placeholder { color: var(--orchid-text-muted); opacity: .8; }
.auth-form .form-control:focus,
.auth-form .form-select:focus {
  border-color: var(--auth-indigo);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
  background-color: var(--orchid-surface);
  color: var(--orchid-text);
}
.auth-form .form-control.is-invalid,
.auth-form .form-select.is-invalid {
  border-color: var(--auth-danger);
}
.auth-form .form-control.is-invalid:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, .14);
}
.auth-form .invalid-feedback {
  font-size: .8rem;
  margin-top: .35rem;
}

/* Input group with icon */
.auth-field {
  position: relative;
  margin-bottom: 1.1rem;
}
.auth-field__toggle {
  position: absolute;
  right: .4rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--orchid-text-muted);
  padding: .45rem .55rem;
  border-radius: 8px;
  transition: color 150ms ease, background-color 150ms ease;
  z-index: 3;
}
.auth-field__toggle:hover {
  color: var(--orchid-text);
  background-color: var(--orchid-hover);
}
.auth-field .form-control[type="password"],
.auth-field .form-control[data-auth-password] {
  padding-right: 2.75rem;
}

/* Row: remember + forgot */
.auth-form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -.25rem 0 1.25rem 0;
  flex-wrap: wrap;
}
.auth-form__row .form-check-label {
  font-size: .875rem;
  color: var(--orchid-text);
}
.auth-form__row a {
  font-size: .875rem;
  font-weight: 600;
  color: var(--auth-indigo);
  text-decoration: none;
}
.auth-form__row a:hover { text-decoration: underline; }

/* Primary CTA */
.auth-btn-primary {
  --auth-btn-h: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  height: var(--auth-btn-h);
  padding: 0 1.25rem;
  border-radius: 12px;
  border: 0;
  color: #fff;
  font-weight: 600;
  font-size: .95rem;
  background: linear-gradient(120deg, #4f46e5 0%, #7c3aed 55%, #06b6d4 100%);
  background-size: 200% 100%;
  background-position: 0% 50%;
  box-shadow: 0 12px 24px -12px rgba(79, 70, 229, .55);
  transition: background-position 350ms ease, transform 120ms ease, box-shadow 200ms ease;
  cursor: pointer;
}
.auth-btn-primary:hover:not(:disabled) {
  background-position: 100% 50%;
  color: #fff;
}
.auth-btn-primary:active:not(:disabled) { transform: translateY(1px); }
.auth-btn-primary:disabled {
  opacity: .7;
  cursor: not-allowed;
  box-shadow: none;
}
.auth-btn-primary .spinner-border {
  width: 1.1rem;
  height: 1.1rem;
  border-width: .18em;
}

/* Divider "OR" */
.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.5rem 0 1rem;
  color: var(--orchid-text-muted);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--orchid-border);
}

/* Social buttons */
.auth-social {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .625rem;
}
.auth-social__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  height: 46px;
  padding: 0 .75rem;
  border-radius: 12px;
  background-color: var(--orchid-surface);
  border: 1px solid var(--orchid-border);
  color: var(--orchid-text);
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, transform 120ms ease;
}
.auth-social__btn:hover {
  background-color: var(--orchid-hover);
  border-color: var(--orchid-text-muted);
  color: var(--orchid-text);
}
.auth-social__btn:active { transform: translateY(1px); }
.auth-social__btn i { font-size: 1.15rem; }
.auth-social__btn--google i { color: #ea4335; }
.auth-social__btn--github i { color: var(--orchid-text); }
[data-bs-theme="dark"] .auth-social__btn--github i { color: #fff; }
.auth-social__btn--apple i { color: var(--orchid-text); }
[data-bs-theme="dark"] .auth-social__btn--apple i { color: #fff; }

/* Password strength meter */
.auth-strength {
  margin-top: -.5rem;
  margin-bottom: 1rem;
}
.auth-strength__bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: .35rem;
}
.auth-strength__bar {
  height: 6px;
  border-radius: 3px;
  background: var(--orchid-border);
  transition: background-color 200ms ease;
}
.auth-strength[data-level="1"] .auth-strength__bar:nth-child(-n+1) { background: var(--auth-danger); }
.auth-strength[data-level="2"] .auth-strength__bar:nth-child(-n+2) { background: var(--auth-warning); }
.auth-strength[data-level="3"] .auth-strength__bar:nth-child(-n+3) { background: #3b82f6; }
.auth-strength[data-level="4"] .auth-strength__bar { background: var(--auth-success); }
.auth-strength__label {
  font-size: .75rem;
  color: var(--orchid-text-muted);
  font-weight: 500;
  display: flex;
  justify-content: space-between;
}
.auth-strength__label-text { font-weight: 600; }
.auth-strength[data-level="1"] .auth-strength__label-text { color: var(--auth-danger); }
.auth-strength[data-level="2"] .auth-strength__label-text { color: var(--auth-warning); }
.auth-strength[data-level="3"] .auth-strength__label-text { color: #3b82f6; }
.auth-strength[data-level="4"] .auth-strength__label-text { color: var(--auth-success); }

/* Terms checkbox row */
.auth-form .form-check-input {
  border-radius: 5px;
  border-color: var(--orchid-border);
}
.auth-form .form-check-input:checked {
  background-color: var(--auth-indigo);
  border-color: var(--auth-indigo);
}
.auth-form .form-check-input:focus {
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .18);
  border-color: var(--auth-indigo);
}

/* ---------- OTP inputs ---------- */
.auth-otp {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .625rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 380px) {
  .auth-otp { gap: .375rem; }
}
.auth-otp__input {
  height: 60px;
  width: 100%;
  border-radius: 12px;
  border: 1.5px solid var(--orchid-border);
  background-color: var(--orchid-surface);
  color: var(--orchid-text);
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  padding: 0;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 100ms ease;
  font-variant-numeric: tabular-nums;
}
.auth-otp__input:focus {
  outline: 0;
  border-color: var(--auth-indigo);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .15);
  transform: translateY(-1px);
}
.auth-otp__input.is-filled {
  border-color: var(--auth-indigo);
  background: linear-gradient(180deg, rgba(79, 70, 229, .06), rgba(34, 211, 238, .04));
}
.auth-otp__input.is-invalid {
  border-color: var(--auth-danger);
  animation: auth-shake .35s ease;
}
@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

.auth-resend {
  text-align: center;
  font-size: .875rem;
  color: var(--orchid-text-muted);
  margin-top: .25rem;
}
.auth-resend button {
  background: transparent;
  border: 0;
  color: var(--auth-indigo);
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}
.auth-resend button:disabled {
  color: var(--orchid-text-muted);
  cursor: not-allowed;
}
.auth-resend button:not(:disabled):hover { text-decoration: underline; }

/* ---------- Lock screen ---------- */
.auth-lock {
  text-align: center;
}
.auth-lock__avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #d946ef 100%);
  box-shadow: 0 20px 40px -18px rgba(99, 102, 241, .6);
  position: relative;
}
.auth-lock__avatar::after {
  content: '\F33A';
  font-family: 'bootstrap-icons';
  position: absolute;
  right: -4px; bottom: -4px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--orchid-surface);
  color: var(--auth-warning);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: normal;
  border: 3px solid var(--orchid-surface);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .12);
}
.auth-lock__name {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--orchid-text);
  margin: 0;
}
.auth-lock__meta {
  color: var(--orchid-text-muted);
  font-size: .875rem;
  margin-bottom: 1.5rem;
}

/* ---------- Success state ---------- */
.auth-success {
  text-align: center;
  padding: 1rem 0;
}
.auth-success__icon {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  margin: 0 auto 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.75rem;
  background: rgba(16, 185, 129, .14);
  color: var(--auth-success);
  animation: auth-pop .45s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes auth-pop {
  0% { transform: scale(.2); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.auth-success__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--orchid-text);
  margin-bottom: .5rem;
}
.auth-success__text {
  color: var(--orchid-text-muted);
  margin-bottom: 1.5rem;
}

/* ---------- Theme toggle floating ---------- */
.auth-theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--orchid-border);
  background-color: var(--orchid-surface);
  color: var(--orchid-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1050;
  transition: background-color 150ms ease, transform 120ms ease, color 150ms ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}
.auth-theme-toggle:hover {
  background-color: var(--orchid-hover);
  color: var(--auth-indigo);
}
.auth-theme-toggle .bi { font-size: 1.1rem; }
.auth-theme-toggle .bi-sun-fill { display: none; }
[data-bs-theme="dark"] .auth-theme-toggle .bi-sun-fill { display: inline; }
[data-bs-theme="dark"] .auth-theme-toggle .bi-moon-stars-fill { display: none; }

/* ---------- Toast overrides ---------- */
.auth-toast-wrap {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
  max-width: calc(100% - 2rem);
}
.auth-toast {
  min-width: 280px;
  padding: .75rem 1rem;
  border-radius: 12px;
  background-color: var(--orchid-surface);
  color: var(--orchid-text);
  border: 1px solid var(--orchid-border);
  box-shadow: 0 20px 40px -20px rgba(15, 18, 32, .25);
  display: flex;
  align-items: center;
  gap: .625rem;
  font-size: .875rem;
  font-weight: 500;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-12px);
  animation: auth-toast-in .32s ease forwards;
}
@keyframes auth-toast-in {
  to { opacity: 1; transform: translateY(0); }
}
.auth-toast.is-leaving {
  animation: auth-toast-out .28s ease forwards;
}
@keyframes auth-toast-out {
  to { opacity: 0; transform: translateY(-12px); }
}
.auth-toast--success i { color: var(--auth-success); }
.auth-toast--danger i  { color: var(--auth-danger); }
.auth-toast--info i    { color: var(--auth-indigo); }
.auth-toast i { font-size: 1.15rem; }

/* ---------- Helpers ---------- */
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--orchid-text-muted);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: color 150ms ease;
  margin-top: 1.25rem;
}
.auth-back:hover { color: var(--auth-indigo); }
.auth-back i { font-size: 1rem; }

.auth-hidden { display: none !important; }

/* Dark tweaks for hero (keep dark colors) */
[data-bs-theme="dark"] .auth-hero {
  background:
    radial-gradient(circle at 15% 20%, rgba(217, 70, 239, .28), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(34, 211, 238, .28), transparent 45%),
    linear-gradient(135deg, #3730a3 0%, #581c87 40%, #155e75 100%);
}
[data-bs-theme="dark"] .auth-panel { background-color: var(--orchid-surface); }
[data-bs-theme="dark"] .auth-social__btn { background-color: var(--orchid-surface); }
