/* =====================================================================
   90FPS+ GPU-Accelerated Stylesheet — Church & Community Restoration
   Composited Transforms & Opacity Only | Zero Layout Thrashing
   ===================================================================== */
:root {
    --bg-midnight: #070a12;
    --card-glass: rgba(15, 22, 38, 0.74);
    --border-glass: rgba(212, 175, 55, 0.16);
    --gold-primary: #d4af37;
    --gold-bright: #f5c451;
    --gold-glow: rgba(212, 175, 55, 0.42);
    --sapphire-glow: rgba(56, 189, 248, 0.25);
    --emerald-glow: rgba(16, 185, 129, 0.35);
    --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 1. Ambient Sanctuary Orbs (GPU Composited) */
.ambient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(85px);
    pointer-events: none;
    z-index: 0;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    animation: floatCathedralOrb 26s infinite alternate ease-in-out;
}

.orb-gold {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.14) 0%, transparent 70%);
    top: -8%;
    right: -6%;
}

.orb-sapphire {
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.14) 0%, rgba(16, 185, 129, 0.08) 50%, transparent 70%);
    bottom: -8%;
    left: -6%;
    animation-delay: -13s;
}

@keyframes floatCathedralOrb {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(24px, -28px, 0) scale(1.06); }
}

/* 2. Glass Panels */
.glass-panel {
    background: rgba(13, 19, 34, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(212, 175, 55, 0.16);
    box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.65),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
    transform: translate3d(0, 0, 0);
}

/* Motivational Quote Rotator */
.quote-rotator {
    transition: opacity 0.45s var(--ease-spring), transform 0.45s var(--ease-spring);
    will-change: opacity, transform;
}

.quote-rotator.is-changing {
    opacity: 0;
    transform: translate3d(0, -10px, 0);
}

/* Story Tabs */
.story-tab {
    transition: transform 0.25s var(--ease-spring), background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
    will-change: transform;
}

.story-tab.active {
    background: rgba(212, 175, 55, 0.18);
    border-color: var(--gold-bright);
    color: #fde68a;
    transform: translate3d(0, -2px, 0);
}

.story-body-fade {
    transition: opacity 0.35s var(--ease-spring), transform 0.35s var(--ease-spring);
    will-change: opacity, transform;
}

.story-body-fade.switching {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
}

/* 3. Shimmering GPU Progress Bar */
.progress-track {
    position: relative;
    height: 16px;
    background: rgba(9, 13, 24, 0.92);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.75);
}

.progress-fill {
    position: relative;
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #b48a1e 0%, #d4af37 45%, #fde68a 100%);
    box-shadow: 0 0 22px var(--gold-glow);
    transition: width 1.15s var(--ease-spring);
    will-change: width;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.55) 50%,
        transparent 100%
    );
    transform: translate3d(-100%, 0, 0);
    animation: shimmerSweep 2.3s infinite linear;
    will-change: transform;
}

@keyframes shimmerSweep {
    0% { transform: translate3d(-100%, 0, 0); }
    100% { transform: translate3d(100%, 0, 0); }
}

/* 4. Interactive Amount Cards */
.amount-card {
    position: relative;
    background: rgba(22, 32, 56, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.35s var(--ease-bounce),
                background-color 0.25s ease,
                border-color 0.25s ease,
                box-shadow 0.35s ease;
    will-change: transform;
    cursor: pointer;
    overflow: hidden;
}

.amount-card:hover {
    transform: translate3d(0, -4px, 0) scale(1.02);
    background: rgba(28, 41, 71, 0.78);
    border-color: rgba(212, 175, 55, 0.45);
}

.amount-card.active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.22) 0%, rgba(16, 185, 129, 0.14) 100%);
    border-color: var(--gold-bright);
    box-shadow: 0 12px 28px -6px rgba(212, 175, 55, 0.35),
                inset 0 0 18px rgba(212, 175, 55, 0.18);
    transform: translate3d(0, -3px, 0) scale(1.03);
}

/* 5. Magnetic Primary CTA Button */
.magnetic-btn {
    position: relative;
    background: linear-gradient(135deg, #f5c451 0%, #d4af37 55%, #b48a1e 100%);
    color: #070a12;
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 16px 38px -8px rgba(212, 175, 55, 0.55),
                inset 0 1px 1px rgba(255, 255, 255, 0.65);
    transition: box-shadow 0.3s ease, filter 0.3s ease, opacity 0.25s ease;
    will-change: transform;
    overflow: hidden;
    cursor: pointer;
}

.magnetic-btn:hover {
    box-shadow: 0 22px 48px -5px rgba(212, 175, 55, 0.78),
                0 0 24px rgba(253, 230, 138, 0.35);
    filter: brightness(1.05);
}

.magnetic-btn:active {
    transform: scale(0.97) !important;
}

.magnetic-btn:disabled,
.magnetic-btn[aria-disabled="true"] {
    opacity: 0.45;
    filter: grayscale(1);
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none;
}

.magnetic-btn:disabled:hover,
.magnetic-btn[aria-disabled="true"]:hover {
    filter: grayscale(1);
    box-shadow: none;
}

.magnetic-btn:disabled:active,
.magnetic-btn[aria-disabled="true"]:active {
    transform: none !important;
}

/* Ripple Wave */
.ripple-wave {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    transform: scale(0);
    animation: rippleExpand 0.65s var(--ease-spring) forwards;
    pointer-events: none;
    will-change: transform, opacity;
}

@keyframes rippleExpand {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 6. Architectural Restoration Canvas */
.restoration-stage {
    position: relative;
    border-radius: 1.5rem;
    background: radial-gradient(circle at 50% 85%, rgba(212, 175, 55, 0.14) 0%, rgba(10, 15, 28, 0.95) 70%);
    border: 1px solid rgba(212, 175, 55, 0.25);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8), 0 20px 40px -15px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    transform: translateZ(0);
    will-change: transform;
}

#restoration-canvas {
    display: block;
    width: 100%;
    height: 290px;
    will-change: transform;
}

/* 7. Staggered Reveal */
.reveal-item {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
    transition: opacity 0.75s var(--ease-spring), transform 0.75s var(--ease-spring);
    will-change: opacity, transform;
}

.reveal-item.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* 8. Celebration Particle Canvas */
#celebration-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* 9. View Transitions & 3D Credit Card */
.view-transition {
    transition: opacity 0.48s var(--ease-spring), transform 0.48s var(--ease-spring);
    will-change: opacity, transform;
}

.view-hidden {
    display: none !important;
    opacity: 0;
    transform: translate3d(0, 22px, 0) scale(0.985);
}

.view-active {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

.cc-scene {
    perspective: 1400px;
    width: 100%;
    max-width: 410px;
    height: 245px;
    margin: 0 auto;
}

.cc-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.72s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform;
}

.cc-card-inner.is-flipped {
    transform: rotateY(180deg);
}

.cc-face {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 1.4rem;
    overflow: hidden;
    border: 1px solid rgba(253, 230, 138, 0.35);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.82),
                inset 0 1px 1px rgba(255, 255, 255, 0.35);
    background: linear-gradient(135deg, #1b2744 0%, #0d1324 52%, #241b0a 100%);
}

.cc-face::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 82% 18%, rgba(245, 196, 81, 0.28) 0%, transparent 55%),
                radial-gradient(circle at 15% 85%, rgba(56, 189, 248, 0.2) 0%, transparent 50%);
    pointer-events: none;
}

.cc-glare {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 25%, rgba(255, 255, 255, 0.14) 50%, transparent 75%);
    transform: translate3d(-100%, 0, 0);
    animation: cardSheen 6s infinite ease-in-out;
    pointer-events: none;
}

@keyframes cardSheen {
    0%, 60% { transform: translate3d(-100%, 0, 0); }
    100% { transform: translate3d(100%, 0, 0); }
}

.cc-back {
    transform: rotateY(180deg);
}

.cc-chip {
    width: 46px;
    height: 34px;
    border-radius: 7px;
    background: linear-gradient(135deg, #fde68a 0%, #d4af37 55%, #926c15 100%);
    border: 1px solid rgba(255, 255, 255, 0.45);
    position: relative;
    overflow: hidden;
}

.cc-chip::after {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(7, 10, 18, 0.35);
    border-radius: 3px;
}

.checkout-input {
    background: rgba(9, 13, 24, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.2);
    transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.checkout-input:focus {
    border-color: var(--gold-bright);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.16);
    outline: none;
}

.checkout-input.input-error {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18);
}

select.checkout-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23f5c451'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    background-size: 1rem;
}

html[dir="ltr"] select.checkout-input {
    background-position: right 0.75rem center;
}

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

.spinner-90fps {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(7, 10, 18, 0.25);
    border-top-color: #070a12;
    border-radius: 50%;
    animation: spin90 0.7s linear infinite;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}
