/*
 * Fold Certification — Certificate + Challenge Gold v0.8.390
 * Presentation only. No result logic, classification logic, scoring, or gates live here.
 */

/* ------------------------------------------------
   VERIFIED CERTIFICATE — MIDNIGHT, SAPPHIRE, GOLD
   ------------------------------------------------ */

html body:not(.wp-admin) .fold-verify-hero {
    background:
        radial-gradient(circle at 88% 8%, rgba(210, 168, 74, .10), transparent 30%),
        linear-gradient(145deg, rgba(13, 41, 71, .96), rgba(2, 7, 14, .995) 62%) !important;
    border-color: #315b87 !important;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .36), inset 0 1px 0 rgba(255, 255, 255, .035) !important;
}

html body:not(.wp-admin) .fold-verify-hero::before {
    background: linear-gradient(120deg, transparent, rgba(210, 168, 74, .055), transparent) !important;
}

html body:not(.wp-admin) .fold-verify-seal {
    background: #0d2947 !important;
    background-image: none !important;
    border: 1px solid #d2a84a !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055) !important;
    text-shadow: none !important;
}

html body:not(.wp-admin) .fold-verify-certbox,
html body:not(.wp-admin) .fold-verify-score,
html body:not(.wp-admin) .fold-verify-classification,
html body:not(.wp-admin) .fold-verify-tile,
html body:not(.wp-admin) .fold-verify-report,
html body:not(.wp-admin) .fold-verify-report-box {
    background: rgba(7, 24, 43, .88) !important;
    background-image: none !important;
    border-color: #315b87 !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035) !important;
}

html body:not(.wp-admin) .fold-verify-certbox > span,
html body:not(.wp-admin) .fold-verify-score > span,
html body:not(.wp-admin) .fold-verify-classification > span,
html body:not(.wp-admin) .fold-verify-tile > span,
html body:not(.wp-admin) .fold-verify-report h5 {
    color: #e7c979 !important;
    -webkit-text-fill-color: #e7c979 !important;
    text-shadow: none !important;
}

html body:not(.wp-admin) .fold-verify-certbox > strong,
html body:not(.wp-admin) .fold-verify-score > strong,
html body:not(.wp-admin) .fold-verify-classification > strong,
html body:not(.wp-admin) .fold-verify-tile > strong,
html body:not(.wp-admin) .fold-verify-report h4 {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: none !important;
}

html body:not(.wp-admin) .fold-verify-subtitle,
html body:not(.wp-admin) .fold-verify-classification small,
html body:not(.wp-admin) .fold-verify-report p,
html body:not(.wp-admin) .fold-verify-report-box li {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

html body:not(.wp-admin) .fold-verify-note,
html body:not(.wp-admin) .fold-verify-disclaimer {
    background: rgba(13, 41, 71, .64) !important;
    border-color: #315b87 !important;
    color: #dbeafe !important;
    box-shadow: none !important;
}

/* Default achievement pills stay sapphire. */
html body:not(.wp-admin) .fold-verify-achievement,
html body:not(.wp-admin) .fold-verify-achievement.fold-result-tool-functional,
html body:not(.wp-admin) .fold-verify-achievement.fold-result-partial {
    background: #0d2947 !important;
    background-image: none !important;
    border: 1px solid #315b87 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055) !important;
    text-shadow: none !important;
}

/*
 * Every Fold-Certified / Complete Fold Certification achievement is gold.
 * Both classes are covered so the presentation remains correct even if one
 * of the two labels changes while the official classification remains complete.
 */
html body:not(.wp-admin) .fold-verify-achievement.fold-certified,
html body:not(.wp-admin) .fold-verify-achievement.fold-result-complete {
    background: linear-gradient(135deg, #6d4d12 0%, #a97b22 52%, #6d4d12 100%) !important;
    background-color: #6d4d12 !important;
    border: 1px solid #e7c979 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .20), 0 0 18px rgba(210, 168, 74, .20) !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .45) !important;
}

/* Complete certification receives a gold edge without turning the score gold. */
html body:not(.wp-admin) .fold-result-complete .fold-verify-score,
html body:not(.wp-admin) .fold-result-complete.fold-verify-classification {
    background: rgba(13, 41, 71, .92) !important;
    background-image: none !important;
    border-color: rgba(210, 168, 74, .78) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045) !important;
}

html body:not(.wp-admin) .fold-result-complete .fold-verify-score > strong {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* The official Complete Fold Certification outcome also reads as a gold pill. */
html body:not(.wp-admin) .fold-result-complete.fold-verify-classification > strong {
    display: inline-flex !important;
    align-items: center !important;
    width: fit-content !important;
    max-width: 100% !important;
    padding: 9px 14px !important;
    border: 1px solid #e7c979 !important;
    border-radius: 999px !important;
    background: #6d4d12 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16) !important;
    font-size: clamp(15px, 2.2vw, 22px) !important;
    text-shadow: none !important;
}

/* Integrity failures remain red and are never repainted as an achievement. */
html body:not(.wp-admin) .fold-verify-achievement.fold-result-integrity-fail {
    background: #641c25 !important;
    background-image: none !important;
    border-color: #f87171 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: none !important;
}

html body:not(.wp-admin) .fold-result-integrity-fail .fold-verify-score,
html body:not(.wp-admin) .fold-result-integrity-fail.fold-verify-classification {
    background: rgba(68, 15, 23, .78) !important;
    background-image: none !important;
    border-color: #f87171 !important;
}

/* ------------------------------------------------
   CHALLENGE READY — GOLD ANIMATION
   ------------------------------------------------ */

html body:not(.wp-admin) .fold-share-ready {
    background: linear-gradient(180deg, #17130b 0%, #070c15 100%) !important;
    background-color: #17130b !important;
    border: 1px solid #e7c979 !important;
    color: #f5dc95 !important;
    -webkit-text-fill-color: #f5dc95 !important;
    box-shadow: 0 0 8px rgba(210, 168, 74, .54), 0 0 20px rgba(210, 168, 74, .25), inset 0 0 8px rgba(231, 201, 121, .12) !important;
    animation: foldReadyGoldPulse 1.8s ease-in-out infinite !important;
}

html body:not(.wp-admin) .fold-share-ready::before {
    background: conic-gradient(
        from 0deg,
        transparent 0 16%,
        #e7c979 18% 20%,
        transparent 22% 47%,
        #d2a84a 49% 51%,
        transparent 53% 78%,
        #f5dc95 80% 82%,
        transparent 84% 100%
    ) !important;
    filter: blur(2px) !important;
    opacity: .78 !important;
    animation: foldReadyGoldArc 2.4s linear infinite !important;
}

html body:not(.wp-admin) .fold-share-ready::after {
    border-color: rgba(210, 168, 74, .34) !important;
    box-shadow: 0 0 12px rgba(210, 168, 74, .45), 0 0 26px rgba(210, 168, 74, .22) !important;
    animation: foldReadyGoldSpark 1.35s steps(2, end) infinite !important;
}

@keyframes foldReadyGoldPulse {
    0%, 100% {
        transform: translateY(0);
        text-shadow: 0 0 5px rgba(231, 201, 121, .48);
        box-shadow: 0 0 7px rgba(210, 168, 74, .45), 0 0 16px rgba(210, 168, 74, .22), inset 0 0 8px rgba(231, 201, 121, .10);
    }
    50% {
        transform: translateY(-1px);
        text-shadow: 0 0 10px rgba(245, 220, 149, .90);
        box-shadow: 0 0 13px rgba(231, 201, 121, .82), 0 0 28px rgba(210, 168, 74, .44), inset 0 0 12px rgba(231, 201, 121, .18);
    }
}

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

@keyframes foldReadyGoldSpark {
    0%, 100% { opacity: .45; transform: scale(1); }
    25% { opacity: .92; transform: scale(1.03); }
    50% { opacity: .35; transform: scale(.99); }
    75% { opacity: .78; transform: scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
    html body:not(.wp-admin) .fold-share-ready,
    html body:not(.wp-admin) .fold-share-ready::before,
    html body:not(.wp-admin) .fold-share-ready::after {
        animation: none !important;
    }
}

@media print {
    html body:not(.wp-admin) .fold-verify-achievement.fold-certified,
    html body:not(.wp-admin) .fold-verify-achievement.fold-result-complete,
    html body:not(.wp-admin) .fold-result-complete.fold-verify-classification > strong {
        color: #000000 !important;
        -webkit-text-fill-color: #000000 !important;
        background: #e7c979 !important;
        border-color: #8b691d !important;
        box-shadow: none !important;
    }
}
