/* ==========================================================================
   1. Design System & CSS Variables
   ========================================================================== */
:root {
  --bg-gradient: linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 50%, #F1F5F9 100%);
  --card-bg: rgba(255, 255, 255, 0.95);
  --card-border: #E2E8F0;
  --blue-primary: #4E72FF;
  --blue-hover: #3B82F6;
  --blue-gradient: linear-gradient(135deg, #4E72FF 0%, #3B82F6 100%);
  --text-main: #0F172A;
  --text-muted: #64748B;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-card: 24px;
  --radius-control: 16px;
}

/* ==========================================================================
   2. Base & Reset
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   3. Page Body & Ambient Background Glows
   ========================================================================== */
body {
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 2.5vh, 20px);
  direction: rtl;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(78, 114, 255, 0.12) 0%, rgba(255, 255, 255, 0) 70%);
  top: -120px;
  right: -120px;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
  bottom: 0;
  left: -160px;
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   4. Containers & Cards
   ========================================================================== */
.container,
.status-container {
  width: 100%;
  max-width: 440px;
  z-index: 10;
  margin: auto;
}

body.status-page .status-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto;
}

body.status-page .status-card {
  width: 100%;
}

.smart-card,
.status-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3.5vh, 36px) clamp(20px, 4vw, 28px);
  text-align: center;
  box-shadow: 0 20px 40px -15px rgba(78, 114, 255, 0.08), 0 10px 25px -5px rgba(15, 23, 42, 0.04);
  animation: cardFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  position: relative;
}

/* ==========================================================================
   5. Logo Headers & Pulse Animations
   ========================================================================== */
.logo-container {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 0 auto clamp(12px, 2vh, 24px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-img {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  object-fit: cover;
  position: relative;
  z-index: 2;
  box-shadow: 0 8px 20px rgba(78, 114, 255, 0.12);
  border: 1px solid #E2E8F0;
  background: #ffffff;
  padding: 4px;
}

.pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(78, 114, 255, 0.25), rgba(59, 130, 246, 0.15));
  animation: pulse 2s infinite ease-in-out;
  z-index: 1;
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}

.brand-logo {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  border: 1px solid #E2E8F0;
  background: #ffffff;
  padding: 3px;
}

/* ==========================================================================
   6. Status Badge & Icon Indicators
   ========================================================================== */
.status-badge-container {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-icon-wrapper {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  animation: iconPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.status-success {
  background: rgba(34, 197, 94, 0.08);
  border: 1.5px solid rgba(34, 197, 94, 0.25);
  color: #16A34A;
  box-shadow: 0 12px 28px -6px rgba(34, 197, 94, 0.20), 0 4px 12px rgba(34, 197, 94, 0.06);
}

.status-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1.5px solid rgba(239, 68, 68, 0.25);
  color: #DC2626;
  box-shadow: 0 12px 28px -6px rgba(239, 68, 68, 0.18), 0 4px 12px rgba(239, 68, 68, 0.05);
}

.status-help {
  background: rgba(78, 114, 255, 0.08);
  border: 1.5px solid rgba(78, 114, 255, 0.25);
  color: #4E72FF;
  box-shadow: 0 12px 28px -6px rgba(78, 114, 255, 0.20), 0 4px 12px rgba(78, 114, 255, 0.06);
}

/* ==========================================================================
   7. Typography & Text Elements
   ========================================================================== */
h1, h2, h1.status-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

h1.status-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
}

p.subtitle, p.status-message {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: clamp(14px, 2.5vh, 28px);
  font-weight: 400;
}

p.status-message {
  line-height: 1.7;
  margin-bottom: 0;
}

/* ==========================================================================
   8. Progress Loader
   ========================================================================== */
.loader-bar {
  width: 100%;
  height: 4px;
  background: rgba(226, 232, 240, 0.8);
  border-radius: 4px;
  overflow: hidden;
  margin: 0 auto clamp(12px, 2vh, 24px);
  position: relative;
}

.loader-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%;
  background: var(--blue-gradient);
  border-radius: 4px;
  animation: loadingBar 1.6s infinite ease-in-out;
}

/* ==========================================================================
   9. Action Group & Buttons
   ========================================================================== */
.action-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #E2E8F0;
}

.btn-gold,
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  background: var(--blue-gradient);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 16px;
  border-radius: var(--radius-md);
  text-decoration: none;
  box-shadow: 0 10px 20px -5px rgba(78, 114, 255, 0.35);
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
  margin-bottom: 20px;
}

.btn-action {
  font-size: 15px;
  padding: 15px 24px;
  border-radius: var(--radius-control);
  margin-bottom: 0;
  box-shadow: 0 10px 22px -5px rgba(78, 114, 255, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-gold:hover,
.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -5px rgba(78, 114, 255, 0.45);
  color: #FFFFFF;
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  background: #F8FAFC;
  border: 1px solid var(--card-border);
  color: var(--text-main);
  font-weight: 500;
  font-size: 15px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.25s ease;
}

.btn-outline:hover {
  background: #EFF6FF;
  border-color: #CBD5E1;
  transform: translateY(-1px);
}

/* ==========================================================================
   10. Desktop View & QR Code Box
   ========================================================================== */
.desktop-qr-box {
  background: rgba(239, 246, 255, 0.7);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: clamp(12px, 1.8vh, 20px);
  margin-bottom: clamp(12px, 2vh, 24px);
}

.qr-img {
  width: 170px;
  height: 170px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  padding: 10px;
  margin: 0 auto clamp(6px, 1vh, 12px);
  display: block;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.qr-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   11. App Store Badges Group
   ========================================================================== */
.store-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: clamp(10px, 1.8vh, 20px);
}

.store-badges a {
  display: inline-block;
  transition: transform 0.2s ease, opacity 0.2s ease;
  text-decoration: none;
}

.store-badges a:hover {
  transform: translateY(-3px);
  opacity: 0.95;
}

.store-badges img {
  height: 52px;
  width: auto;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  display: block;
}

/* ==========================================================================
   12. Footer
   ========================================================================== */
footer.brand-footer {
  margin-top: clamp(12px, 2vh, 24px);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================================
   13. Keyframe Animations
   ========================================================================== */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(0.92);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.16);
    opacity: 0.25;
  }
  100% {
    transform: scale(0.92);
    opacity: 0.8;
  }
}

@keyframes loadingBar {
  0% { left: -50%; width: 30%; }
  50% { width: 60%; }
  100% { left: 100%; width: 30%; }
}

@keyframes iconPop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   14. Responsive Media Queries
   ========================================================================== */
@media (max-width: 480px) {
  body { padding: 16px; }
  .smart-card, .status-card {
    padding: 28px 20px;
  }
  .brand-logo { width: 52px; height: 52px; }
  .status-icon-wrapper { width: 84px; height: 84px; }
  h1.status-title { font-size: 22px; }
  p.status-message { font-size: 14px; }
  .store-badges {
    flex-direction: column;
    gap: 10px;
  }
  .store-badges img {
    height: 48px;
    width: 100%;
    max-width: 200px;
  }
}
