/**
 * Ratna Aura — shared Login / Register auth UI
 * Navy chrome + animated diamond SVG behind form, scrollable card, mobile bottom margin
 */

:root {
  --ra-auth-navy: #0a1f3d;
  --ra-auth-navy-2: #00162e;
  --ra-auth-navy-deep: #000b1e;
  --gold: #d4af37;
  --gold-light: #f5ecd4;
  --gold-dark: #8b6914;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #1a3352;
  --slate-800: #00162e;
  --slate-900: #000b1e;
}

html {
  height: 100%;
}

body.ra-auth-body {
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100%;
  min-height: 100dvh;
  margin: 0;
  display: flex;
  background: var(--ra-auth-navy);
  overflow-x: hidden;
  color: var(--slate-700);
}

.ra-auth-body * {
  box-sizing: border-box;
}

.auth-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Left branding panel */
.auth-image {
  flex: 0 0 42%;
  background:
    linear-gradient(145deg, rgba(10, 31, 61, 0.92), rgba(0, 22, 46, 0.94)),
    url('https://images.unsplash.com/photo-1515562141207-7a88fb7ce338?w=1200&q=80') center/cover;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

.auth-image::before {
  content: '';
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.12) 0%, transparent 55%);
  animation: raAuthPulse 10s ease-in-out infinite;
}

@keyframes raAuthPulse {
  0%, 100% { transform: scale(1); opacity: 0.45; }
  50% { transform: scale(1.12); opacity: 0.85; }
}

.auth-image-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 420px;
}

.auth-image .auth-logo,
.auth-image-content .auth-logo {
  width: 160px;
  max-width: 70%;
  height: auto;
  margin-bottom: 1.5rem;
  mix-blend-mode: screen;
  background: transparent !important;
  filter: drop-shadow(0 4px 18px rgba(212, 175, 55, 0.28));
}

.auth-image h2 {
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.75rem;
}

.auth-image h2 span {
  color: var(--gold);
}

.auth-image p {
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.55;
  margin: 0;
}

.auth-image .back-home {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 2;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.auth-image .back-home:hover {
  color: var(--gold);
}

.floating-diamond {
  position: absolute;
  font-size: 1.5rem;
  opacity: 0.35;
  animation: raFloatDiamond 7s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.floating-diamond:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.floating-diamond:nth-child(2) { top: 20%; right: 12%; animation-delay: 1s; }
.floating-diamond:nth-child(3) { bottom: 28%; left: 16%; animation-delay: 2s; }
.floating-diamond:nth-child(4) { bottom: 14%; right: 10%; animation-delay: 3s; }
.floating-diamond:nth-child(5) { top: 48%; left: 6%; animation-delay: 4s; }

@keyframes raFloatDiamond {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.25; }
  50% { transform: translateY(-14px) rotate(8deg); opacity: 0.5; }
}

/* Middle / right form stage — animated diamond SVG bg */
.auth-form-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  max-width: none;
  background: var(--ra-auth-navy);
}

.auth-form-section::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-color: var(--ra-auth-navy-deep);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='140' viewBox='0 0 120 140'%3E%3Cpath d='M60 8 L108 50 L60 132 L12 50 Z' fill='none' stroke='%23d4af37' stroke-opacity='0.18' stroke-width='1.2'/%3E%3Cpath d='M60 28 L92 50 L60 108 L28 50 Z' fill='none' stroke='%23d4af37' stroke-opacity='0.1' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 110px 128px;
  animation: raDiamondDrift 28s linear infinite;
}

.auth-form-section::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 50% 40%, rgba(212, 175, 55, 0.12), transparent 70%),
    radial-gradient(ellipse 90% 70% at 80% 90%, rgba(10, 31, 61, 0.9), transparent 60%);
  animation: raAuthGlow 8s ease-in-out infinite;
}

@keyframes raDiamondDrift {
  0% { background-position: 0 0; }
  100% { background-position: 110px 128px; }
}

@keyframes raAuthGlow {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

/* Scrollable form card */
.auth-form-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 1.15rem;
  box-shadow: 0 20px 60px rgba(0, 11, 30, 0.45);
  padding: 1.5rem 1.5rem 1.35rem;
  max-height: min(92vh, 920px);
  max-height: min(92dvh, 920px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.55) transparent;
}

.auth-form-wrapper::-webkit-scrollbar {
  width: 6px;
}
.auth-form-wrapper::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.55);
  border-radius: 999px;
}

.auth-form-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.auth-form-logo img {
  height: 52px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  mix-blend-mode: normal;
  filter: none;
}

.auth-header {
  margin-bottom: 1.25rem;
  text-align: center;
}

.auth-header h1 {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--slate-800);
  margin: 0 0 0.35rem;
}

.auth-header p {
  color: var(--slate-500);
  font-size: 0.95rem;
  margin: 0;
}

.mobile-logo {
  display: none;
}

.mobile-back-btn {
  display: none;
  position: fixed;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 50;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  background: rgba(10, 31, 61, 0.75);
  color: #ffd700;
  text-decoration: none;
  border: 1px solid rgba(212, 175, 55, 0.35);
  backdrop-filter: blur(8px);
}

.mobile-back-btn:hover {
  background: var(--gold);
  color: var(--ra-auth-navy-deep);
}

/* —— Mobile / tablet —— */
@media (max-width: 992px) {
  body.ra-auth-body {
    background: var(--ra-auth-navy);
    align-items: stretch;
  }

  .auth-container {
    flex-direction: column;
    min-height: 100dvh;
    justify-content: flex-start;
    align-items: center;
    padding: 4.25rem 1rem 2.5rem;
  }

  .auth-image {
    display: none !important;
  }

  .mobile-back-btn {
    display: inline-flex;
  }

  .mobile-logo {
    display: none !important; /* logo lives inside form card */
  }

  .auth-form-section {
    width: 100%;
    flex: 1;
    justify-content: flex-start;
    padding: 0;
    background: transparent;
    overflow: visible;
  }

  .auth-form-section::before,
  .auth-form-section::after {
    position: fixed;
    inset: 0;
    z-index: 0;
  }

  .auth-form-wrapper {
    max-width: 440px;
    width: 100%;
    max-height: none;
    margin: 0 auto 2.75rem; /* bottom margin for mobile */
    padding: 1.35rem 1.2rem 1.5rem;
  }

  .auth-form-logo img {
    height: 46px;
  }

  .auth-header h1 {
    font-size: 1.4rem;
  }
}

@media (max-width: 576px) {
  .auth-container {
    padding: 3.75rem 0.75rem 2.25rem;
  }

  .auth-form-wrapper {
    margin-bottom: 3rem;
    padding: 1.15rem 1rem 1.35rem;
    border-radius: 1rem;
  }

  .auth-form-logo img {
    height: 42px;
  }

  .auth-header h1 {
    font-size: 1.28rem;
  }

  .auth-header p {
    font-size: 0.875rem;
  }
}

@media (max-width: 380px) {
  .auth-form-wrapper {
    margin-bottom: 3.25rem;
  }
}
