/* OraxSender — clean auth pages (login / register-style)
   Brand: primary #E03C3C, dark #1A237E
*/
:root {
  --auth-primary: #E03C3C;
  --auth-primary-dark: #c42828;
  --auth-dark: #1A237E;
  --auth-text: #1e293b;
  --auth-muted: #64748b;
  --auth-border: rgba(26, 35, 126, 0.1);
  --auth-bg: #f4f6fd;
  --auth-card: #ffffff;
  --auth-gradient-page: linear-gradient(165deg, #fafbfd 0%, #fff8f8 35%, #f0f3fb 70%, #e8ecf9 100%);
  --auth-gradient-accent: radial-gradient(ellipse 80% 55% at 100% 0%, rgba(224, 60, 60, 0.14), transparent 55%),
    radial-gradient(ellipse 65% 45% at 0% 100%, rgba(26, 35, 126, 0.12), transparent 52%);
  --auth-gradient-btn: linear-gradient(135deg, #E03C3C 0%, #cf2a42 48%, #b71c45 100%);
  /* Match SaaS header lang switcher (ox-lang-*) */
  --primary: var(--auth-primary);
  --dark: var(--auth-dark);
  --border: var(--auth-border);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-press: cubic-bezier(0.55, 0, 0.85, 0.45);
  --dur-bounce: 0.72s;
  --dur-press: 0.12s;
}

.auth-clean-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--auth-text);
  background: var(--auth-gradient-page);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.auth-clean-page *,
.auth-clean-page *::before,
.auth-clean-page *::after {
  box-sizing: border-box;
}

/* Soft brand gradient accent (side panel / top stripe) */
.auth-clean-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 130% 90% at 0% 0%, rgba(224, 60, 60, 0.11), transparent 52%),
    radial-gradient(ellipse 100% 80% at 100% 10%, rgba(94, 53, 177, 0.08), transparent 48%),
    radial-gradient(ellipse 90% 60% at 40% 100%, rgba(26, 35, 126, 0.11), transparent 55%),
    var(--auth-gradient-accent);
  animation: auth-ambient 22s cubic-bezier(0.65, 0, 0.35, 1) infinite alternate;
}
.auth-clean-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  mix-blend-mode: soft-light;
}
@keyframes auth-ambient {
  0% { filter: saturate(1) brightness(1); opacity: 1; }
  100% { filter: saturate(1.1) brightness(1.03); opacity: 0.96; }
}

.auth-clean-top {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: 0;
  background: rgba(255, 255, 255, 0.76);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid rgba(26, 35, 126, 0.06);
  box-shadow: 0 4px 24px -8px rgba(26, 35, 126, 0.08);
}
@supports not (backdrop-filter: blur(1px)) {
  .auth-clean-top { background: rgba(255, 255, 255, 0.95); }
}
.auth-clean-top-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
}

.auth-clean-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--auth-dark);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.auth-clean-brand img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.auth-clean-nav {
  display: flex;
  align-items: center;
  gap: 1rem 1.25rem;
  flex-wrap: wrap;
}

.auth-clean-nav a {
  color: var(--auth-muted);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.2s;
}

.auth-clean-nav a:hover {
  color: var(--auth-primary);
}

/* ── Language dropdown (same UX as homepage ox-lang-*) ── */
.auth-clean-top .ox-lang-wrap {
  position: relative;
}
.auth-clean-top .ox-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: #fff;
  color: #374151;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.auth-clean-top .ox-lang-btn:hover {
  border-color: var(--auth-primary);
  color: var(--auth-primary);
  box-shadow: 0 2px 8px rgba(224, 60, 60, 0.12);
}
.auth-clean-top .ox-lang-btn i {
  font-size: 10px;
  opacity: 0.7;
}
.auth-clean-top .ox-lang-flag {
  font-size: 1.1em;
  line-height: 1;
}
.auth-clean-top .ox-lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  min-width: 150px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  z-index: 200;
}
.ox-ltr .auth-clean-top .ox-lang-menu {
  right: 0;
}
.ox-rtl .auth-clean-top .ox-lang-menu {
  left: 0;
}
.auth-clean-top .ox-lang-menu.open {
  display: block;
}
.auth-clean-top .ox-lang-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 500;
  color: var(--auth-dark);
  transition: background 0.15s;
  text-decoration: none;
}
.auth-clean-top .ox-lang-menu a:hover {
  background: #f5f5f5;
}
.auth-clean-top .ox-lang-menu a.active {
  color: var(--auth-primary);
  font-weight: 600;
}

.auth-clean-main {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 3rem;
}

.auth-clean-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  padding: 2.25rem 2rem;
  box-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.06),
    0 18px 40px -12px rgba(26, 35, 126, 0.14),
    0 0 0 1px rgba(224, 60, 60, 0.06);
  border: 1px solid rgba(26, 35, 126, 0.08);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.auth-clean-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(224, 60, 60, 0.2), rgba(26, 35, 126, 0.15), rgba(224, 60, 60, 0.08));
  opacity: 0.35;
  z-index: -1;
  filter: blur(16px);
  pointer-events: none;
}

.auth-clean-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  background: linear-gradient(118deg, #E03C3C 0%, #c6285f 42%, #303f9f 78%, #1A237E 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@supports not (background-clip: text) {
  .auth-clean-card h1 {
    color: var(--auth-dark);
    background: none;
  }
}

.auth-clean-sub {
  margin: 0 0 1.75rem;
  font-size: 0.98rem;
  color: var(--auth-muted);
  font-weight: 500;
}

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

.auth-clean-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--auth-text);
}

.auth-clean-field input[type="email"],
.auth-clean-field input[type="password"],
.auth-clean-field input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-clean-field input:focus {
  outline: none;
  border-color: rgba(224, 60, 60, 0.55);
  box-shadow: 0 0 0 3px rgba(224, 60, 60, 0.12);
}

.auth-clean-field .invalid-feedback,
.auth-clean-field .auth-error {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.875rem;
  color: var(--auth-primary);
  font-weight: 600;
}

.auth-clean-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.35rem;
}

.auth-clean-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--auth-muted);
  user-select: none;
}

.auth-clean-check input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--auth-primary);
}

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

.auth-clean-forgot:hover {
  color: var(--auth-primary-dark);
  text-decoration: underline;
}

.auth-clean-submit {
  position: relative;
  width: 100%;
  padding: 0.85rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff !important;
  background: var(--auth-gradient-btn);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
  transition:
    transform var(--dur-bounce) var(--ease-spring),
    box-shadow 0.45s var(--ease-out-smooth),
    filter 0.4s var(--ease-out-smooth);
  box-shadow: 0 6px 20px rgba(224, 60, 60, 0.28);
}
.auth-clean-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    105deg,
    transparent 36%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 64%
  );
  transform: translateX(-120%);
  transition: transform 0.55s var(--ease-out-expo);
  pointer-events: none;
}
.auth-clean-submit:hover::before {
  transform: translateX(120%);
}
.auth-clean-submit::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.45), transparent 66%);
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
.auth-clean-submit:active::after {
  animation: auth-btn-ripple 0.88s var(--ease-out-expo) forwards;
}
@keyframes auth-btn-ripple {
  0% { transform: scale(0); opacity: 0.72; }
  100% { transform: scale(2.55); opacity: 0; }
}

.auth-clean-submit:hover {
  box-shadow: 0 14px 38px rgba(224, 60, 60, 0.45);
  transform: translate3d(0, -7px, 0) scale(1.042);
  filter: brightness(1.07);
}

.auth-clean-submit:active {
  transform: translate3d(0, -1px, 0) scale(0.92);
  transition-duration: var(--dur-press);
  transition-timing-function: var(--ease-press);
}
.auth-clean-submit:focus-visible {
  outline: none;
  box-shadow:
    0 6px 20px rgba(224, 60, 60, 0.28),
    0 0 0 3px rgba(224, 60, 60, 0.35),
    0 0 0 6px rgba(26, 35, 126, 0.1);
}

.auth-clean-footer-note {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--auth-border);
  text-align: center;
  font-size: 0.95rem;
  color: var(--auth-muted);
}

.auth-clean-footer-note a {
  font-weight: 800;
  color: var(--auth-primary);
  text-decoration: none;
}

.auth-clean-footer-note a:hover {
  text-decoration: underline;
}

.auth-clean-foot {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 1rem 1.25rem 1.5rem;
  font-size: 0.85rem;
  color: var(--auth-muted);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.auth-clean-foot strong {
  color: var(--auth-dark);
  font-weight: 700;
}

.auth-clean-alert {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.auth-clean-alert--success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.auth-clean-prose {
  font-size: 0.98rem;
  color: var(--auth-muted);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}
.auth-clean-prose p {
  margin: 0 0 0.75rem;
}
.auth-clean-link-btn {
  display: inline;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 800;
  color: var(--auth-primary);
  cursor: pointer;
  text-decoration: underline;
}
.auth-clean-link-btn:hover {
  color: var(--auth-primary-dark);
}
.auth-clean-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 0.5rem;
}
.auth-clean-actions-row .auth-clean-forgot {
  margin: 0;
}

/* RTL */
[dir="rtl"] .auth-clean-row {
  flex-direction: row-reverse;
}
[dir="rtl"] .auth-clean-check {
  flex-direction: row-reverse;
}
[dir="rtl"] .auth-clean-top-inner {
  flex-direction: row-reverse;
}

@media (max-width: 480px) {
  .auth-clean-card {
    padding: 1.75rem 1.35rem;
  }
  .auth-clean-card h1 {
    font-size: 1.45rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-clean-bg {
    animation: none;
  }
  .auth-clean-submit,
  .auth-clean-submit::before {
    transition: none;
  }
  .auth-clean-submit:hover::before {
    transform: none;
  }
  .auth-clean-submit:hover {
    transform: none;
    filter: none;
    box-shadow: 0 6px 20px rgba(224, 60, 60, 0.28);
  }
  .auth-clean-submit:active {
    transform: none;
  }
  .auth-clean-submit:active::after {
    animation: none;
  }
}
