/* ==========================================================================
   FutureSeed Earth Foundation - Falling Leaf Donate Button & Modal
   Theme: Forest Green (#0B2F23), Emerald (#1bbd36 / #22c55e), Gold (#D4AF37)
   ========================================================================== */

:root {
    --fs-brand-dark: #0B2F23;
    --fs-brand-forest: #123D2E;
    --fs-brand-leaf: #1bbd36;
    --fs-brand-leaf-light: #22c55e;
    --fs-brand-leaf-bright: #4ade80;
    --fs-brand-cream: #F4F1E8;
    --fs-brand-gold: #D4AF37;
    --fs-brand-gold-glow: rgba(212, 175, 55, 0.4);
    --fs-brand-black: #050706;
    --fs-modal-radius: 24px;
    --fs-card-radius: 16px;
    --fs-leaf-size: 64px;
}

/* ==========================================================================
   1. Falling Leaf Floating Button (Bottom-Left Positioned)
   ========================================================================== */
.fs-leaf-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.fs-leaf-btn-wrapper {
    position: fixed;
    bottom: 28px;
    left: 28px;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    pointer-events: auto;
    opacity: 0;
    visibility: hidden;
    transform-origin: center center;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), 
                visibility 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.fs-leaf-btn-wrapper.fs-active {
    opacity: 1;
    visibility: visible;
}

/* Fall Animation Container */
.fs-falling-leaf-actor {
    position: fixed;
    top: -120px;
    left: 25vw;
    width: var(--fs-leaf-size);
    height: var(--fs-leaf-size);
    pointer-events: none;
    z-index: 10000;
    will-change: transform, opacity;
    display: none;
}

.fs-falling-leaf-actor.is-falling {
    display: block;
}

/* Main Leaf Button - Organic Sculpted Shape */
.fs-leaf-btn {
    position: relative;
    width: var(--fs-leaf-size);
    height: var(--fs-leaf-size);
    border-radius: 60% 20% 60% 50% / 50% 30% 60% 50%;
    background: radial-gradient(circle at 35% 30%, rgba(34, 197, 94, 0.25) 0%, rgba(11, 47, 35, 0.95) 75%),
                linear-gradient(145deg, #164b36 0%, #061e16 100%);
    border: 1.5px solid rgba(134, 239, 172, 0.45);
    box-shadow: 0 12px 28px -4px rgba(5, 7, 6, 0.65), 
                0 0 25px 3px rgba(34, 197, 94, 0.4),
                inset 0 1px 2px rgba(255, 255, 255, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    outline: none;
    transform: rotate(-10deg);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.4s ease, 
                border-color 0.4s ease;
}

.fs-leaf-btn:focus-visible {
    outline: 3px solid var(--fs-brand-leaf-bright);
    outline-offset: 4px;
}

/* Idle Floating / Swaying Physics */
.fs-leaf-btn-wrapper.fs-active .fs-leaf-btn {
    animation: fsLeafIdleSway 5.5s ease-in-out infinite;
}

.fs-leaf-btn-wrapper.fs-active:hover .fs-leaf-btn {
    animation: fsLeafHoverSway 1.4s ease-in-out infinite alternate;
    transform: scale(1.12) rotate(6deg);
    border-color: rgba(212, 175, 55, 0.85);
    box-shadow: 0 16px 36px -2px rgba(5, 7, 6, 0.75), 
                0 0 35px 8px rgba(34, 197, 94, 0.65),
                0 0 20px 2px var(--fs-brand-gold-glow);
}

.fs-leaf-svg {
    width: 44px;
    height: 44px;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45));
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fs-leaf-btn-wrapper:hover .fs-leaf-svg {
    transform: scale(1.15) rotate(4deg);
}

/* Subtle Leaf Ambient Pulse Glow */
.fs-leaf-pulse {
    position: absolute;
    inset: -8px;
    border-radius: 60% 20% 60% 50% / 50% 30% 60% 50%;
    border: 2px solid rgba(74, 222, 128, 0.7);
    opacity: 0;
    pointer-events: none;
    animation: fsPulseRing 3.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}

/* "Donate" Floating Pill Label */
.fs-leaf-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(11, 47, 35, 0.95) 0%, rgba(5, 25, 18, 0.98) 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1.5px solid rgba(74, 222, 128, 0.3);
    border-radius: 99px;
    color: var(--fs-brand-cream);
    font-family: 'Poppins', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    box-shadow: 0 10px 28px -4px rgba(5, 7, 6, 0.5),
                0 0 18px 1px rgba(27, 189, 54, 0.2);
    cursor: pointer;
    user-select: none;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.fs-leaf-label i {
    color: var(--fs-brand-gold);
    font-size: 1rem;
    filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.6));
    transition: transform 0.35s ease;
}

.fs-leaf-btn-wrapper:hover .fs-leaf-label {
    background: linear-gradient(135deg, rgba(18, 61, 46, 0.98) 0%, rgba(11, 47, 35, 1) 100%);
    border-color: rgba(212, 175, 55, 0.6);
    color: #ffffff;
    transform: translateX(4px);
    box-shadow: 0 12px 32px -2px rgba(11, 47, 35, 0.6),
                0 0 24px 3px rgba(34, 197, 94, 0.35);
}

.fs-leaf-btn-wrapper:hover .fs-leaf-label i {
    transform: scale(1.25) rotate(-5deg);
}

/* Keyframes for Organic Floating */
@keyframes fsLeafIdleSway {
    0%, 100% {
        transform: translateY(0) rotate(-10deg);
    }
    50% {
        transform: translateY(-9px) rotate(-3deg);
    }
}

@keyframes fsLeafHoverSway {
    0% {
        transform: scale(1.12) rotate(-2deg);
    }
    100% {
        transform: scale(1.12) rotate(10deg);
    }
}

@keyframes fsPulseRing {
    0% {
        transform: scale(0.92);
        opacity: 0.85;
    }
    70%, 100% {
        transform: scale(1.45);
        opacity: 0;
    }
}

/* ==========================================================================
   2. Donation Popup Modal (Corner Zoom from Bottom-Left)
   ========================================================================== */
.fs-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 7, 6, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                visibility 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.fs-modal-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

/* Body Scroll Lock */
body.fs-modal-open {
    overflow: hidden !important;
    padding-right: var(--fs-scrollbar-width, 0px);
}

.fs-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 1160px;
    max-height: 90vh;
    background: linear-gradient(145deg, #0e2b21 0%, #061811 100%);
    border: 1px solid rgba(74, 222, 128, 0.25);
    border-radius: var(--fs-modal-radius);
    box-shadow: 0 30px 70px -10px rgba(0, 0, 0, 0.8),
                0 0 60px 2px rgba(27, 189, 54, 0.18);
    overflow-y: auto;
    overflow-x: hidden;
    color: var(--fs-brand-cream);
    transform: scale(0.65) translate(-15%, 15%);
    transform-origin: bottom left;
    opacity: 0;
    transition: transform 0.48s cubic-bezier(0.16, 1, 0.3, 1), 
                opacity 0.38s ease;
}

.fs-modal-backdrop.is-open .fs-modal-dialog {
    transform: scale(1) translate(0, 0);
    opacity: 1;
}

/* Modal Close Button */
.fs-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.25s ease;
}

.fs-modal-close:hover {
    background: rgba(220, 53, 69, 0.85);
    border-color: rgba(220, 53, 69, 0.9);
    transform: rotate(90deg) scale(1.08);
}

.fs-modal-close:focus-visible {
    outline: 2px solid var(--fs-brand-leaf-bright);
    outline-offset: 2px;
}

/* Modal Content Grid */
.fs-modal-body {
    padding: 44px;
}

.fs-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 40px;
    align-items: stretch;
}

/* Left Column: Bank & Info */
.fs-modal-info {
    display: flex;
    flex-direction: column;
}

.fs-modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fs-brand-leaf-bright);
    margin-bottom: 12px;
}

.fs-modal-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1.25;
    color: #ffffff;
    margin-bottom: 14px;
}

.fs-modal-desc {
    font-size: 0.95rem;
    line-height: 1.65;
    color: rgba(244, 241, 232, 0.78);
    margin-bottom: 24px;
}

/* Bank Details Card */
.fs-bank-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--fs-card-radius);
    padding: 22px;
    margin-bottom: 20px;
}

.fs-bank-card h4 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--fs-brand-leaf-bright);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fs-bank-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.92rem;
}

.fs-bank-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.fs-bank-label {
    color: rgba(255, 255, 255, 0.6);
}

.fs-bank-val {
    font-weight: 600;
    color: #ffffff;
    text-align: right;
    user-select: all;
}

/* QR Code Card */
.fs-qr-box {
    background: #ffffff;
    border-radius: var(--fs-card-radius);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.fs-qr-img {
    max-width: 120px;
    height: auto;
    border-radius: 8px;
    flex-shrink: 0;
}

.fs-qr-text {
    flex: 1;
}

.fs-qr-title {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--fs-brand-dark);
    margin-bottom: 4px;
}

.fs-qr-upi {
    font-size: 0.88rem;
    font-weight: 600;
    color: #2b5329;
    word-break: break-all;
    user-select: all;
}

.fs-qr-hint {
    font-size: 0.78rem;
    color: #666666;
    margin-top: 4px;
}

/* Right Column: Donation Form */
.fs-form-card {
    background: #ffffff;
    border-radius: var(--fs-card-radius);
    padding: 34px;
    color: #222222;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.fs-form-card h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--fs-brand-dark);
    margin-bottom: 6px;
}

.fs-form-card .fs-form-sub {
    font-size: 0.88rem;
    color: #6c757d;
    margin-bottom: 22px;
}

.fs-form-card .form-floating {
    margin-bottom: 14px;
}

.fs-form-card .form-control {
    border: 1.5px solid #dfe3e8;
    border-radius: 10px;
    font-size: 0.92rem;
    color: #1a1a1a;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.fs-form-card .form-control:focus {
    border-color: var(--fs-brand-leaf);
    box-shadow: 0 0 0 3px rgba(27, 189, 54, 0.15);
}

.fs-form-card .btn-submit {
    background: linear-gradient(135deg, var(--fs-brand-leaf-light) 0%, var(--fs-brand-dark) 100%);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 14px 28px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    margin-top: 8px;
    box-shadow: 0 8px 20px rgba(27, 189, 54, 0.35);
    transition: all 0.3s ease;
    cursor: pointer;
}

.fs-form-card .btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(27, 189, 54, 0.45);
}

.fs-form-card .form-message {
    display: none;
    border-radius: 10px;
    font-size: 0.9rem;
    padding: 12px 16px;
}

/* ==========================================================================
   3. Responsive Media Queries
   ========================================================================== */
@media (max-width: 991px) {
    .fs-modal-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .fs-modal-body {
        padding: 36px 24px;
    }

    .fs-modal-title {
        font-size: 1.8rem;
    }

    .fs-leaf-btn-wrapper {
        bottom: 20px;
        left: 20px;
    }

    :root {
        --fs-leaf-size: 56px;
    }
}

@media (max-width: 576px) {
    .fs-modal-backdrop {
        padding: 12px;
    }

    .fs-modal-dialog {
        max-height: 94vh;
        border-radius: 18px;
    }

    .fs-modal-body {
        padding: 28px 16px;
    }

    .fs-modal-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }

    .fs-modal-title {
        font-size: 1.5rem;
    }

    .fs-form-card {
        padding: 22px 16px;
    }

    .fs-qr-box {
        flex-direction: column;
        text-align: center;
        padding: 18px;
    }

    .fs-leaf-label {
        font-size: 0.84rem;
        padding: 8px 15px;
    }
}

/* ==========================================================================
   4. Accessibility & Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .fs-leaf-btn-wrapper.fs-active .fs-leaf-btn,
    .fs-leaf-pulse {
        animation: none !important;
    }

    .fs-modal-dialog {
        transform: none !important;
        transition: opacity 0.2s ease !important;
    }

    .fs-modal-backdrop {
        transition: opacity 0.2s ease !important;
    }
}
