/* ==========================================================================
   Oxford Training College International Limited (Jordan - Co. No. 14676558)
   Award-Level Luxurious Design System & Interactive Stylesheet
   ========================================================================== */

/* Google Fonts Import: Tajawal & IBM Plex Sans Arabic */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Tajawal:wght@300;400;500;700;800;900&display=swap');

:root {
  /* Core Color Palette */
  --bg-midnight: #060D1F;
  --bg-deep-navy: #091534;
  --bg-royal-blue: #0E2A66;
  --bg-card-glass: rgba(8, 20, 50, 0.74);
  --bg-card-border: rgba(111, 168, 255, 0.18);

  /* Light Glow Accents */
  --glow-electric: #2F6BFF;
  --glow-sky: #6FA8FF;
  --glow-ambient: rgba(47, 107, 255, 0.16);

  /* Warm Champagne Gold Hierarchy */
  --gold-primary: #D8B56A;
  --gold-highlight: #F3DFA6;
  --gold-dark: #A4833B;
  --gold-glow: rgba(216, 181, 106, 0.35);
  --gold-glow-subtle: rgba(216, 181, 106, 0.12);

  /* Typography Colors */
  --text-pure-white: #FFFFFF;
  --text-muted: #B9C4DD;
  --text-dim: #7E8DAA;

  /* Status Colors */
  --status-success: #3DDC97;
  --status-success-bg: rgba(61, 220, 151, 0.12);
  --status-error: #FF6B6B;
  --status-error-bg: rgba(255, 107, 107, 0.12);

  /* Radii & Transitions */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --radius-full: 9999px;
  --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Typography */
  --font-arabic: 'Tajawal', 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Base Reset & Smooth Render */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-midnight);
  color: var(--text-pure-white);
  font-family: var(--font-arabic);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  position: relative;
  background: radial-gradient(circle at 50% 10%, #0E2A66 0%, #060D1F 80%);
  color: var(--text-pure-white);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-x: hidden;
}

/* Subtle Film Grain Texture Overlay */
.film-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Fullscreen Layered Background */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* Ambient Slow Morphing Aurora Glow */
.ambient-aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  transition: opacity 1.2s ease;
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
  mix-blend-mode: screen;
  animation: auroraMorph 24s infinite alternate ease-in-out;
}

.blob-1 {
  width: 650px;
  height: 650px;
  top: -150px;
  right: -100px;
  background: radial-gradient(circle, var(--glow-electric) 0%, rgba(14, 42, 102, 0) 70%);
}

.blob-2 {
  width: 750px;
  height: 750px;
  bottom: -200px;
  left: -150px;
  background: radial-gradient(circle, var(--bg-royal-blue) 0%, rgba(6, 13, 31, 0) 70%);
  animation-duration: 32s;
  animation-direction: alternate-reverse;
}

.blob-3 {
  width: 480px;
  height: 480px;
  top: 35%;
  left: 20%;
  background: radial-gradient(circle, var(--gold-glow-subtle) 0%, rgba(216, 181, 106, 0) 70%);
  opacity: 0.18;
  animation-duration: 20s;
}

/* Aurora Reaction on Successful Verification */
.aurora-celebrate {
  animation: auroraFlash 2.5s ease-out forwards;
}

@keyframes auroraMorph {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(60px, -40px) scale(1.15) rotate(45deg); }
  100% { transform: translate(-40px, 60px) scale(0.9) rotate(-30deg); }
}

@keyframes auroraFlash {
  0% { filter: brightness(1); }
  25% { filter: brightness(1.8) drop-shadow(0 0 50px rgba(216, 181, 106, 0.4)); }
  100% { filter: brightness(1); }
}

/* Cursor Spotlight Light Beam */
#cursor-spotlight {
  position: fixed;
  top: -250px;
  left: -250px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(111, 168, 255, 0.08) 0%, rgba(216, 181, 106, 0.03) 35%, transparent 70%);
  pointer-events: none;
  z-index: 2;
  will-change: transform;
  transition: opacity 0.5s ease;
}

/* ==========================================================================
   Custom Cursor (Desktop Only)
   ========================================================================== */
#custom-cursor {
  position: fixed;
  top: -4px;
  left: -4px;
  width: 8px;
  height: 8px;
  background-color: var(--gold-highlight);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  box-shadow: 0 0 10px var(--gold-primary);
  will-change: transform;
}

#cursor-follower {
  position: fixed;
  top: -20px;
  left: -20px;
  width: 40px;
  height: 40px;
  border: 1.5px solid rgba(216, 181, 106, 0.45);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
  will-change: transform;
}

#cursor-follower.cursor-hover {
  top: -30px;
  left: -30px;
  width: 60px;
  height: 60px;
  border-color: var(--gold-highlight);
  background-color: rgba(216, 181, 106, 0.08);
}

@media (pointer: coarse) {
  #custom-cursor, #cursor-follower, #cursor-spotlight {
    display: none !important;
  }
}

/* ==========================================================================
   Intro Screen / Cinematic Curtain Reveal
   ========================================================================== */
#intro-curtain {
  position: fixed;
  inset: 0;
  background-color: #040916;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

#intro-curtain.dismissed {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.04);
}

.intro-content {
  text-align: center;
  position: relative;
  z-index: 2;
  padding: 0 20px;
}

.intro-gold-line {
  width: 0;
  height: 2px;
  margin: 0 auto 24px;
  background: linear-gradient(90deg, transparent, var(--gold-highlight), var(--gold-primary), transparent);
  animation: drawLine 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes drawLine {
  0% { width: 0; opacity: 0; }
  50% { opacity: 1; }
  100% { width: 280px; opacity: 1; }
}

.intro-title-ar {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-pure-white);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeInRise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

.intro-title-en {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gold-primary);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeInRise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

.intro-meta {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
  opacity: 0;
  animation: fadeInRise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.7s forwards;
}

.skip-intro-btn {
  margin-top: 36px;
  background: transparent;
  border: 1px solid rgba(216, 181, 106, 0.3);
  color: var(--gold-highlight);
  font-family: var(--font-arabic);
  font-size: 0.85rem;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.skip-intro-btn:hover {
  background: rgba(216, 181, 106, 0.15);
  border-color: var(--gold-primary);
}

@keyframes fadeInRise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Header: Minimal Text-Only Floating Brand
   NO LOGO, Text only (Arabic large, English smaller)
   ========================================================================== */
.site-header {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-text-wrapper {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-name-ar {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-pure-white);
  letter-spacing: -0.3px;
  line-height: 1.25;
  background: linear-gradient(180deg, #FFFFFF 30%, #E0E7FF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-name-en {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--gold-primary);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.header-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(14, 42, 102, 0.45);
  border: 1px solid rgba(111, 168, 255, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-muted);
  backdrop-filter: blur(12px);
}

.tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--gold-highlight);
  box-shadow: 0 0 8px var(--gold-primary);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.6; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* ==========================================================================
   Main Portal Layout: Single Screen & Hero
   ========================================================================== */
.main-wrapper {
  position: relative;
  z-index: 5;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px 20px 40px;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.hero-titles {
  text-align: center;
  margin-bottom: 32px;
  max-width: 680px;
  transition: all 0.4s ease;
}

/* Compact hero when certificate result is active */
body.state-result-active .hero-titles {
  margin-bottom: 16px;
}

body.state-result-active .hero-subtitle {
  display: none;
}

body.state-result-active .hero-h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  margin-bottom: 6px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(216, 181, 106, 0.08);
  border: 1px solid rgba(216, 181, 106, 0.25);
  border-radius: var(--radius-full);
  color: var(--gold-highlight);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 18px;
}

.hero-badge svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.hero-h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -1px;
  color: var(--text-pure-white);
  margin-bottom: 14px;
}

.hero-h1-gold {
  background: linear-gradient(135deg, var(--gold-highlight) 20%, var(--gold-primary) 70%, #A4833B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.7;
}

/* ==========================================================================
   Verification Card: Frosted Glass, Animated Border Beam, 3D Physics
   ========================================================================== */
.card-container {
  width: 100%;
  max-width: 580px;
  perspective: 1200px;
  margin: 0 auto;
  transition: max-width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

body.state-result-active .card-container {
  max-width: 1040px;
}

.portal-card {
  position: relative;
  width: 100%;
  background: var(--bg-card-glass);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-radius: var(--radius-xl);
  padding: 44px 38px;
  box-shadow: 
    0 30px 60px -15px rgba(6, 13, 31, 0.8),
    0 0 0 1px rgba(111, 168, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 0 30px rgba(47, 107, 255, 0.08);
  animation: cardBreathe 8s infinite alternate ease-in-out;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  overflow: hidden;
}

@keyframes cardBreathe {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

/* Traveling Gold Border Beam */
.card-border-beam {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  padding: 1.5px;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.card-border-beam::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    transparent 0deg,
    transparent 280deg,
    var(--gold-highlight) 330deg,
    var(--gold-primary) 360deg
  );
  animation: rotateBeam 6s linear infinite;
}

@keyframes rotateBeam {
  100% { transform: rotate(360deg); }
}

/* Card Shake on Error */
.card-shake {
  animation: shakeKeyframes 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakeKeyframes {
  10%, 90% { transform: translate3d(-3px, 0, 0); }
  20%, 80% { transform: translate3d(5px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* Scanning Light Sweep on Verification */
.scanner-light {
  position: absolute;
  top: -100px;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(180deg, transparent, rgba(243, 223, 166, 0.3), var(--glow-electric), transparent);
  pointer-events: none;
  opacity: 0;
  z-index: 20;
}

.scanner-light.active {
  opacity: 1;
  animation: scanSweep 1.2s ease-in-out infinite;
}

@keyframes scanSweep {
  0% { top: -60px; }
  100% { top: 105%; }
}

/* ==========================================================================
   Verification Form & Inputs
   ========================================================================== */
.verify-form {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-pure-white);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.label-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 400;
}

.input-glow-wrapper {
  position: relative;
  width: 100%;
}

.cert-input {
  width: 100%;
  padding: 18px 54px 18px 22px;
  background: rgba(6, 13, 31, 0.7);
  border: 1.5px solid rgba(111, 168, 255, 0.22);
  border-radius: var(--radius-md);
  color: var(--text-pure-white);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, var(--font-arabic);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-align: right;
  direction: ltr; /* numbers & codes typed cleanly */
  transition: var(--transition-smooth);
  outline: none;
}

.cert-input::placeholder {
  color: rgba(185, 196, 221, 0.45);
  font-weight: 400;
  letter-spacing: normal;
  text-align: right;
  direction: rtl;
}

.cert-input:focus {
  border-color: var(--gold-primary);
  background: rgba(8, 20, 50, 0.9);
  box-shadow: 
    0 0 0 4px var(--gold-glow),
    0 0 25px rgba(216, 181, 106, 0.2),
    inset 0 0 12px rgba(216, 181, 106, 0.1);
}

.cert-input.input-error {
  border-color: var(--status-error);
  box-shadow: 0 0 0 4px var(--status-error-bg), 0 0 20px rgba(255, 107, 107, 0.3);
}

.input-icon {
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  color: var(--text-dim);
  pointer-events: none;
  transition: var(--transition-smooth);
}

.cert-input:focus ~ .input-icon {
  color: var(--gold-highlight);
}

/* Typing Sparks Effect */
#typing-sparks {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  pointer-events: none;
  height: 1px;
}

.typing-spark {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--gold-highlight);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--gold-primary);
  animation: sparkFly 0.55s ease-out forwards;
}

@keyframes sparkFly {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0.1);
    opacity: 0;
  }
}

/* Error Alert Message */
.error-msg-box {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--status-error-bg);
  border: 1px solid rgba(255, 107, 107, 0.35);
  border-radius: var(--radius-sm);
  color: #FFA5A5;
  font-size: 0.88rem;
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
}

.error-msg-box.visible {
  display: flex;
}

.error-msg-box svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: var(--status-error);
}

/* ==========================================================================
   Submit Button: Gold Gradient, Magnetic, Hover Fill Sweep & Shine
   ========================================================================== */
.verify-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 18px 30px;
  background: linear-gradient(135deg, var(--gold-highlight) 0%, var(--gold-primary) 50%, #B89243 100%);
  border: none;
  border-radius: var(--radius-md);
  color: #060D1F;
  font-family: var(--font-arabic);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 
    0 12px 28px -6px rgba(216, 181, 106, 0.45),
    0 4px 12px rgba(6, 13, 31, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  overflow: hidden;
  user-select: none;
}

.verify-btn:hover {
  box-shadow: 
    0 16px 36px -4px rgba(216, 181, 106, 0.6),
    0 6px 16px rgba(6, 13, 31, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.verify-btn:active {
  transform: scale(0.98);
}

.verify-btn:focus-visible {
  outline: 3px solid var(--text-pure-white);
  outline-offset: 3px;
}

/* Periodic Soft Shine Sweep */
.btn-shine-sweep {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.45),
    transparent
  );
  transform: skewX(-25deg);
  animation: btnPeriodicShine 5s infinite;
  pointer-events: none;
}

@keyframes btnPeriodicShine {
  0%, 75% { left: -100%; }
  100% { left: 160%; }
}

.btn-icon {
  width: 20px;
  height: 20px;
  stroke: #060D1F;
  stroke-width: 2.2;
}

/* Button Loading / Spinner State */
.btn-spinner {
  display: none;
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(6, 13, 31, 0.3);
  border-top-color: #060D1F;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-loading .btn-text-content {
  display: none;
}

.btn-loading .btn-spinner {
  display: inline-block;
}

.btn-loading .btn-loading-text {
  display: inline-block !important;
}

.btn-loading-text {
  display: none;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* Demo quick chips for immediate testing */
.demo-hints {
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid rgba(111, 168, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.demo-chip {
  background: rgba(14, 42, 102, 0.4);
  border: 1px solid rgba(111, 168, 255, 0.2);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.demo-chip:hover {
  background: rgba(216, 181, 106, 0.15);
  border-color: var(--gold-primary);
  color: var(--gold-highlight);
}

/* ==========================================================================
   Verification Result Card (Dynamic In-Place Transformation)
   ========================================================================== */
#result-card {
  display: none;
  width: 100%;
  background: var(--bg-card-glass);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  box-shadow: 
    0 30px 60px -15px rgba(6, 13, 31, 0.85),
    0 0 0 1px rgba(216, 181, 106, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#result-card.revealing {
  animation: revealResultCard 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#result-card.fade-out {
  opacity: 0;
  transform: scale(0.96);
}

@keyframes revealResultCard {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Result Header & Self-Drawing Checkmark */
.result-header {
  text-align: center;
  margin-bottom: 28px;
}

.checkmark-circle-wrapper {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  position: relative;
}

.checkmark-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.checkmark-ring {
  stroke: var(--gold-primary);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: drawRing 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

.checkmark-check {
  stroke: var(--gold-highlight);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: drawCheck 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

@keyframes drawRing {
  to { stroke-dashoffset: 0; }
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

.result-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-pure-white);
  margin-bottom: 8px;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
}

.status-badge.status-active {
  background: var(--status-success-bg);
  border: 1px solid rgba(61, 220, 151, 0.3);
  color: var(--status-success);
}

.status-badge.status-active .status-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--status-success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--status-success);
}

.status-badge.status-revoked {
  background: var(--status-error-bg);
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: var(--status-error);
}

.status-badge.status-revoked .status-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--status-error);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--status-error);
}

/* ==========================================================================
   Certificate Showcase Viewer (ONLY The Certificate Document)
   ========================================================================== */
.cert-display-wrapper {
  width: 100%;
  margin-bottom: 24px;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 
    0 24px 60px -10px rgba(0, 0, 0, 0.85),
    0 0 0 1.5px rgba(216, 181, 106, 0.4),
    0 0 40px rgba(216, 181, 106, 0.15);
  background: #060D1F;
}

.cert-viewer-frame {
  width: 100%;
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #040916;
  border-radius: inherit;
}

.cert-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: inherit;
}

.cert-fallback-iframe {
  width: 100%;
  height: 650px;
  border: none;
  border-radius: inherit;
  display: block;
}

.cert-loading-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(6, 13, 31, 0.95);
  z-index: 10;
  color: var(--gold-highlight);
}

.cert-spinner {
  width: 46px;
  height: 46px;
  border: 3.5px solid rgba(216, 181, 106, 0.2);
  border-top-color: var(--gold-highlight);
  border-radius: 50%;
  animation: spinnerRotate 0.8s linear infinite;
}

.cert-loading-text {
  font-size: 0.95rem;
  color: var(--gold-highlight);
  font-weight: 600;
  letter-spacing: 0.3px;
}

@keyframes spinnerRotate {
  to { transform: rotate(360deg); }
}

/* Revocation Notice */
.revoked-notice {
  display: none;
  background: var(--status-error-bg);
  border: 1px solid rgba(255, 107, 107, 0.4);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
  color: #FFA5A5;
  font-size: 0.95rem;
  line-height: 1.6;
}

.revoked-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #FF6B6B;
  font-size: 1.05rem;
}

.revoked-icon {
  width: 22px;
  height: 22px;
  stroke: #FF6B6B;
}

.print-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(216, 181, 106, 0.35);
  border-radius: var(--radius-md);
  color: var(--gold-highlight);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-family: inherit;
}

.print-btn:hover {
  background: rgba(216, 181, 106, 0.15);
  border-color: var(--gold-highlight);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(216, 181, 106, 0.2);
}

.print-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

/* ==========================================================================
   Action Buttons: Download, View & Re-verify
   ========================================================================== */
.result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-row {
  display: flex;
  gap: 12px;
}

.download-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--gold-highlight) 0%, var(--gold-primary) 100%);
  border: none;
  border-radius: var(--radius-md);
  color: #060D1F;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 24px -4px rgba(216, 181, 106, 0.4);
  transition: var(--transition-smooth);
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -4px rgba(216, 181, 106, 0.55);
}

.download-btn svg {
  width: 20px;
  height: 20px;
  stroke: #060D1F;
}

.view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 20px;
  background: rgba(14, 42, 102, 0.5);
  border: 1px solid rgba(111, 168, 255, 0.28);
  border-radius: var(--radius-md);
  color: var(--text-pure-white);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-smooth);
}

.view-btn:hover {
  background: rgba(14, 42, 102, 0.85);
  border-color: var(--gold-primary);
  color: var(--gold-highlight);
}

.view-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.reset-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  background: transparent;
  border: 1px dashed rgba(185, 196, 221, 0.3);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-arabic);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.reset-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-highlight);
  background: rgba(216, 181, 106, 0.06);
}

.reset-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

/* ==========================================================================
   Footer: Mandatory Legal & Academic Disclaimers
   ========================================================================== */
.site-footer {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 24px 32px;
  text-align: center;
  border-top: 1px solid rgba(111, 168, 255, 0.12);
}

.footer-legal-line {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 6px;
}

.footer-separator {
  margin: 0 8px;
  color: rgba(216, 181, 106, 0.4);
}

.footer-disclaimer {
  font-size: 0.76rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ==========================================================================
   Accessibility & Reduced Motion Mode
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--gold-highlight);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .portal-card {
    animation: none !important;
    transform: none !important;
  }

  .card-border-beam::before {
    animation: none !important;
    background: var(--gold-primary);
    opacity: 0.35;
  }

  .btn-shine-sweep {
    display: none !important;
  }

  .aurora-blob {
    animation: none !important;
  }
}

/* ==========================================================================
   Responsive Adaptations (360px, 375px, 768px, 1024px, 1440px)
   ========================================================================== */
@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 16px 6px;
  }

  .brand-name-ar {
    font-size: 1.18rem;
  }

  .brand-name-en {
    font-size: 0.7rem;
  }

  .main-wrapper {
    padding: 16px 14px 28px;
  }

  .portal-card, #result-card {
    padding: 28px 20px;
    border-radius: var(--radius-lg);
  }

  .cert-input {
    font-size: 1rem;
    padding: 15px 46px 15px 16px;
  }

  .verify-btn {
    padding: 16px 20px;
    font-size: 1.05rem;
  }

  .result-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .btn-row {
    flex-direction: column;
  }

  .footer-legal-line {
    font-size: 0.78rem;
  }
}

@media (min-width: 1440px) {
  .main-wrapper {
    max-width: 1040px;
  }

  .card-container {
    max-width: 620px;
  }

  body.state-result-active .main-wrapper {
    max-width: 1140px;
  }

  body.state-result-active .card-container {
    max-width: 1040px;
  }

  .portal-card, #result-card {
    padding: 48px 42px;
  }
}

/* Print Certificate Cleanly */
@media print {
  body {
    background: #060D1F !important;
  }
  body * {
    visibility: hidden !important;
  }
  #cert-display-wrapper, #cert-display-wrapper * {
    visibility: visible !important;
  }
  #cert-display-wrapper {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .cert-canvas {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
  }
}
