/* ============================================================
   WELCOME — Premium Design
   Direction: quiet boutique ledger — deep ink, brass accent,
   a medallion emblem under a slow beacon ring, framed like a
   gallery label. No glassmorphism, no stock SaaS gradients.
   Version: 2.0.0
   ============================================================ */

:root {
  --pw-ink-900: #0b0a08;
  --pw-ink-800: #17140f;
  --pw-line: rgba(201, 166, 107, 0.28);
  --pw-line-soft: rgba(201, 166, 107, 0.14);
  --pw-gold-200: #f1e0b8;
  --pw-gold-300: #e2c48c;
  --pw-gold-400: #d4af7a;
  --pw-gold-600: #b9915a;
  --pw-gold-900: #1a1509;
  --pw-ivory: #f6f1e7;
  --pw-ivory-muted: rgba(246, 241, 231, 0.62);
  --pw-font-display: 'Playfair Display', 'Cairo', 'Inter', serif;
  --pw-font-body: 'Inter', 'Cairo', sans-serif;
}

/* ── Base layout override (auth2 layout reset) ── */
html, body, body::before {
  background: #0f0f1a !important;
  background-image: none !important;
  min-height: 100vh;
  overflow: hidden;
}

html { overflow: hidden; }

.container-fluid, .container {
  background: transparent !important;
  max-width: 100% !important;
  padding: 0 !important;
  overflow: hidden;
}

.right-col {
  background: transparent !important;
  overflow: hidden;
  position: relative;
  z-index: 1;
  padding-top: 40px !important;
}

.tw-absolute, .tw-dw-dropdown {
  display: none !important;
}

.right-col .row {
  display: none !important;
}

.eq-height-row {
  min-height: 0 !important;
  height: auto !important;
}

h1, h2 {
  color: #ffffff !important;
}

/* ── Background: Same as login-form-panel + currency symbols ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    url("../../img/pos-pattern.svg") repeat,
    radial-gradient(ellipse 80% 60% at 50% 50%, rgba(212, 175, 122, 0.06), transparent 60%),
    radial-gradient(circle at 30% 30%, rgba(16, 185, 129, 0.03), transparent 40%),
    radial-gradient(circle at 70% 70%, rgba(212, 175, 122, 0.03), transparent 40%),
    linear-gradient(180deg, #0f0f1a 0%, #111128 50%, #0d1b2a 100%);
}

/* ── Floating Glow Orb — center ── */
.pw-stage::after {
  content: '';
  position: fixed;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 122, 0.1), transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
  filter: blur(50px);
  animation: pw-orb-pulse 6s ease-in-out infinite;
}

@keyframes pw-orb-pulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
}

/* ── Gallery corner frame ── */
.pw-frame {
  position: fixed;
  inset: 28px;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  animation: pw-frame-in 1.1s ease 0.5s forwards;
}

.pw-frame-corner {
  position: absolute;
  width: 26px;
  height: 26px;
}

.pw-frame-corner--tl { top: 0; left: 0; border-top: 1px solid var(--pw-line); border-left: 1px solid var(--pw-line); }
.pw-frame-corner--tr { top: 0; right: 0; border-top: 1px solid var(--pw-line); border-right: 1px solid var(--pw-line); }
.pw-frame-corner--bl { bottom: 0; left: 0; border-bottom: 1px solid var(--pw-line); border-left: 1px solid var(--pw-line); }
.pw-frame-corner--br { bottom: 0; right: 0; border-bottom: 1px solid var(--pw-line); border-right: 1px solid var(--pw-line); }

@keyframes pw-frame-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Stage ── */
.pw-stage {
  position: relative;
  min-height: 88vh;
}

/* ── Emblem — same design as login ── */
.welcome-logo {
  position: relative;
  z-index: 1;
  width: 180px;
  height: 180px;
  background: rgba(212, 175, 122, 0.08);
  border: 2px solid rgba(212, 175, 122, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  box-shadow:
    0 0 0 8px rgba(212, 175, 122, 0.05),
    0 0 40px rgba(212, 175, 122, 0.15),
    0 20px 60px rgba(0, 0, 0, 0.4);
  opacity: 0;
  animation: pw-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

.welcome-logo img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  position: relative;
  z-index: 2;
}

.welcome-logo::before {
  content: '';
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0%, rgba(212, 175, 122, 0.3) 10%, transparent 20%);
  animation: pw-rotate 8s linear infinite;
  opacity: 0.6;
}

.welcome-logo::after {
  content: '';
  position: absolute;
  inset: -34px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 122, 0.16), transparent 68%);
  animation: pw-breathe 4.5s ease-in-out infinite;
  z-index: -1;
}

@keyframes pw-rotate {
  to { transform: rotate(360deg); }
}

@keyframes pw-breathe {
  0%, 100% { opacity: 0.55; transform: scale(0.94); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes pw-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Brand name — Premium English font ── */
.pw-brand {
  position: relative;
  z-index: 1;
  font-family: 'Playfair Display', 'Alexandria', 'Tajawal', Georgia, serif;
  font-weight: 700;
  font-size: clamp(2.5rem, 5.4vw, 3.75rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-align: center;
  color: #ffffff;
  background: linear-gradient(180deg, #ffffff 0%, #f1e0b8 50%, #d4af7a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
  padding: 0 1rem;
  opacity: 0;
  animation: pw-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
  text-shadow: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@supports not (background-clip: text) {
  .pw-brand { color: #f1e0b8; }
}

[dir="rtl"] .pw-brand {
  letter-spacing: 0;
  word-spacing: 0.05em;
}

/* ── Ornamental divider ── */
.pw-divider {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 1.5rem 0;
  opacity: 0;
  animation: pw-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.42s forwards;
}

.pw-divider::before,
.pw-divider::after {
  content: '';
  width: 34px;
  height: 1px;
  background: var(--pw-line);
}

.pw-divider span {
  width: 5px;
  height: 5px;
  transform: rotate(45deg);
  background: var(--pw-gold-400);
  display: block;
}

/* ── Tagline ── */
.pw-tagline {
  position: relative;
  z-index: 1;
  font-family: var(--pw-font-body);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(0.9375rem, 1.6vw, 1.0625rem);
  text-align: center;
  color: var(--pw-gold-300);
  opacity: 0;
  max-width: 32rem;
  margin: 0 0 0.5rem;
  animation: pw-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.42s forwards;
}

/* ── Sign in button — premium style matching page ── */
.welcome-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  margin-top: 3rem !important;
  padding: 1rem 2.5rem;
  border-radius: 999px;
  font-family: var(--pw-font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  background: transparent;
  color: var(--pw-gold-300);
  border: 1px solid rgba(212, 175, 122, 0.3);
  box-shadow:
    0 0 0 4px rgba(212, 175, 122, 0.05),
    0 0 20px rgba(212, 175, 122, 0.08);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  animation: pw-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.56s forwards;
}

.welcome-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, rgba(212, 175, 122, 0.1), rgba(212, 175, 122, 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.welcome-btn:hover {
  color: #ffffff;
  border-color: rgba(212, 175, 122, 0.5);
  box-shadow:
    0 0 0 6px rgba(212, 175, 122, 0.08),
    0 0 30px rgba(212, 175, 122, 0.12);
  transform: translateY(-2px);
}

.welcome-btn:hover::before {
  opacity: 1;
}

.welcome-btn:active {
  transform: translateY(0) scale(0.98);
}

.pw-arrow {
  font-size: 0.875rem;
  line-height: 1;
  transition: transform 0.3s ease;
}

.welcome-btn:hover .pw-arrow {
  transform: translateX(3px);
}

[dir="rtl"] .pw-arrow {
  transform: scaleX(-1);
}

[dir="rtl"] .welcome-btn:hover .pw-arrow {
  transform: scaleX(-1) translateX(3px);
}

/* ── Language switcher (hidden) ── */
.welcome-lang {
  display: none !important;
}

.welcome-lang-dropdown {
  position: relative;
}

.welcome-lang-summary {
  background: transparent;
  border: 1px solid var(--pw-line);
  border-radius: 999px;
  padding: 0.5rem 1.125rem;
  font-family: var(--pw-font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--pw-ivory-muted);
  cursor: pointer;
  list-style: none;
  transition: all 0.25s ease;
}

.welcome-lang-summary::-webkit-details-marker {
  display: none;
}

.welcome-lang-summary::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid var(--pw-gold-400);
  margin-left: 0.5rem;
  vertical-align: middle;
}

.welcome-lang-summary:hover {
  border-color: var(--pw-gold-400);
  color: var(--pw-ivory);
}

.welcome-lang-list {
  position: absolute;
  top: calc(100% + 0.625rem);
  right: 0;
  min-width: 180px;
  background: var(--pw-ink-800);
  border: 1px solid var(--pw-line);
  border-radius: 10px;
  padding: 0.375rem;
  margin: 0;
  list-style: none;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55);
}

.welcome-lang-list li a {
  display: block;
  padding: 0.5625rem 0.75rem;
  border-radius: 6px;
  font-family: var(--pw-font-body);
  font-size: 0.8125rem;
  color: var(--pw-ivory-muted);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.welcome-lang-list li a:hover {
  background: rgba(212, 175, 122, 0.12);
  color: var(--pw-gold-300);
}

/* ── Skip to content link (accessibility) ── */
.pw-skip-link {
  position: fixed;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  padding: 0.75rem 1.5rem;
  background: var(--pw-gold-400);
  color: var(--pw-ink-900);
  font-family: var(--pw-font-body);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 8px 8px;
  transition: top 0.2s ease;
}

.pw-skip-link:focus {
  top: 0;
  outline: 2px solid var(--pw-gold-300);
  outline-offset: 2px;
}

/* ── Focus states (keyboard accessibility) ── */
.welcome-btn:focus-visible,
.welcome-lang-summary:focus-visible,
.welcome-lang-list li a:focus-visible {
  outline: 1.5px solid var(--pw-gold-300);
  outline-offset: 3px;
}

/* ── High contrast mode support ── */
@media (forced-colors: active) {
  .welcome-btn {
    border: 2px solid ButtonText;
  }
  .welcome-btn:focus-visible {
    outline: 2px solid Highlight;
  }
  .welcome-lang-summary {
    border: 2px solid ButtonText;
  }
}

/* ── RTL ── */
[dir="rtl"] .welcome-lang {
  right: auto;
  left: 1.5rem;
}

[dir="rtl"] .welcome-lang-list {
  right: auto;
  left: 0;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .pw-frame,
  .welcome-logo,
  .pw-brand,
  .pw-divider,
  .pw-tagline,
  .welcome-btn,
  .pw-stage::before,
  .pw-stage::after {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .welcome-logo::before,
  .welcome-logo::after {
    animation: none !important;
  }
  .welcome-btn::before {
    display: none;
  }
  .pw-stage::before { opacity: 0.07 !important; }
  .pw-stage::after { opacity: 0.8 !important; filter: blur(40px) !important; }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .pw-frame { inset: 14px; }
  .pw-frame-corner { width: 18px; height: 18px; }
  .welcome-logo { width: 84px; height: 84px; margin-bottom: 1.75rem; }
  .welcome-logo img { width: 46px; height: 46px; }
  .pw-brand { padding: 0 0.5rem; font-size: 2rem; }
  .welcome-btn {
    padding: 0.875rem 2rem;
    margin-top: 2.25rem !important;
    min-height: 44px;
    font-size: 0.875rem;
  }
  .welcome-lang { top: 1rem; right: 1rem; }
  [dir="rtl"] .welcome-lang { left: 1rem; }
  .welcome-lang-summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
  }
  .pw-stage::after {
    width: 250px;
    height: 250px;
    opacity: 0.4;
  }
}

@media (max-width: 380px) {
  .pw-frame { inset: 8px; }
  .pw-frame-corner { width: 14px; height: 14px; }
  .welcome-logo { width: 72px; height: 72px; margin-bottom: 1.5rem; }
  .welcome-logo img { width: 40px; height: 40px; }
  .pw-brand { font-size: 1.75rem; }
  .welcome-btn { padding: 0.75rem 1.5rem; margin-top: 1.75rem !important; }
  .welcome-lang { top: 0.75rem; right: 0.75rem; }
  [dir="rtl"] .welcome-lang { left: 0.75rem; }
}
