@import url('style.css');

/* ============================================
   Modern Design System - ภูกุ้มข้าวปี 2568
   ============================================ */

:root {
    --primary: #f7c948;
    --primary-dark: #dba629;
    --secondary: #fff3d4;
    --text-dark: #3a2a0f;
    --text-light: #907341;
    --bg-light: #fff9ec;
    --bg-white: #ffffff;
    --border: #f2e3c5;
    --shadow-sm: 0 2px 8px rgba(217, 154, 29, 0.08);
    --shadow-md: 0 4px 16px rgba(217, 154, 29, 0.12);
    --shadow-lg: 0 8px 32px rgba(217, 154, 29, 0.16);
    --shadow-xl: 0 16px 48px rgba(217, 154, 29, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.phukumbua-page {
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ============================================
   Floating Back Button
   ============================================ */

.back-floating-btn {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid var(--border);
    border-radius: 50px;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-floating-btn:hover {
    transform: translateX(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
    background: var(--bg-white);
}

.back-floating-btn i {
    font-size: 16px;
}

/* ============================================
   Hero Section
   ============================================ */

.hero-section {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh; /* Support dynamic viewport height */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 140px 24px 80px;
    overflow-x: hidden;
    overflow-y: visible;
    width: 100%;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/0022.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(58, 42, 15, 0.4) 0%,
        rgba(58, 42, 15, 0.2) 50%,
        rgba(58, 42, 15, 0.4) 100%
    );
    z-index: 1;
}

.hero-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(247, 201, 72, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 243, 212, 0.1) 0%, transparent 50%);
    z-index: 1;
    animation: patternFloat 20s ease-in-out infinite;
}

@keyframes patternFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -20px) scale(1.1); }
}

.hero-content {
    position: relative;
    z-index: 1001;
    text-align: center;
    max-width: 900px;
    width: 100%;
    padding: 0 20px;
    animation: heroFadeIn 1s ease-out;
    overflow: visible;
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title-wrapper {
    margin-bottom: 24px;
    width: 100%;
    overflow: visible;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 16px;
    overflow: visible;
    word-wrap: break-word;
    white-space: normal;
}

.hero-title .title-line {
    display: block;
    letter-spacing: 2px;
    white-space: normal;
    word-break: keep-all;
    overflow: visible;
}

.hero-title .title-line.highlight {
    background: linear-gradient(135deg, var(--primary), #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
    width: 100%;
    text-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.2),
        0 2px 10px rgba(0, 0, 0, 0.15);
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
}

.title-decoration {
    width: 120px;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    margin: 0 auto;
    border-radius: 2px;
    animation: decorationExpand 1.5s ease-out 0.5s both;
}

@keyframes decorationExpand {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 120px;
        opacity: 1;
    }
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 48px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    font-weight: 400;
}

.hero-cta-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 18px 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 50px;
    color: var(--text-dark);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 
        0 8px 24px rgba(217, 154, 29, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-cta-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 12px 32px rgba(217, 154, 29, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.hero-cta-btn:active {
    transform: translateY(-2px) scale(0.98);
}

.hero-cta-btn .btn-icon {
    transition: transform 0.3s ease;
}

.hero-cta-btn:hover .btn-icon {
    transform: translateX(4px);
}

.hero-cta-btn .btn-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.hero-cta-btn:hover .btn-glow {
    transform: translateX(100%);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.scroll-dot {
    width: 8px;
    height: 40px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    animation: scrollBounce 1.5s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    50% {
        transform: translateY(10px);
        opacity: 1;
    }
}

/* ============================================
   Success Screen
   ============================================ */

.success-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, var(--bg-light), var(--secondary));
}

.success-content {
    text-align: center;
    max-width: 600px;
    animation: successFadeIn 0.8s ease-out;
}

@keyframes successFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-icon-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 32px;
}

.success-icon {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    color: var(--text-dark);
    box-shadow: var(--shadow-xl);
    animation: iconBounce 0.8s ease-out 0.3s both;
}

@keyframes iconBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-ripple {
    position: absolute;
    inset: -20px;
    border: 3px solid var(--primary);
    border-radius: 50%;
    animation: rippleExpand 2s ease-out infinite;
}

@keyframes rippleExpand {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

.success-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.success-message {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 40px;
    line-height: 1.8;
}

.success-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Certificate Card */
.success-card-certificate {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto 32px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.success-card-certificate img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.success-card-overlay {
    position: absolute;
    left: var(--overlay-left, 64%);
    top: var(--overlay-top, auto);
    bottom: var(--overlay-bottom, 16%);
    transform: translate(var(--overlay-translate-x, -50%), var(--overlay-translate-y, 0));
    display: grid;
    gap: var(--overlay-gap, 0.35rem);
    width: var(--overlay-width, 48%);
    text-align: var(--overlay-text-align, center);
    align-items: var(--overlay-align-items, center);
    justify-items: var(--overlay-justify-items, center);
    font-family: 'Kanit', 'Sarabun', sans-serif;
    color: #003D7A;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.success-card-overlay-name {
    font-size: var(--overlay-name-size, clamp(1.1rem, 3.6vw, 2.2rem));
    line-height: var(--overlay-name-line-height, 1.1);
    font-weight: 600;
    letter-spacing: 0.03em;
}

.success-card-overlay-prayer {
    font-size: var(--overlay-prayer-size, clamp(0.9rem, 2.5vw, 1.5rem));
    line-height: var(--overlay-prayer-line-height, 0.8);
    white-space: pre-line;
}

.btn-download-certificate {
    align-self: center;
    padding: 0.9rem 2.1rem;
    font-size: 1.05rem;
    gap: 0.55rem;
    margin-bottom: 24px;
}

.btn-download-certificate.is-loading {
    opacity: 0.75;
    pointer-events: none;
}

@media (max-width: 640px) {
    .success-card-overlay {
        left: var(--overlay-mobile-left, var(--overlay-left, 50%));
        top: var(--overlay-mobile-top, var(--overlay-top, auto));
        bottom: var(--overlay-mobile-bottom, auto);
        transform: translate(
            var(--overlay-mobile-translate-x, var(--overlay-translate-x, -50%)),
            var(--overlay-mobile-translate-y, var(--overlay-translate-y, 0))
        );
        width: var(--overlay-mobile-width, var(--overlay-width, 80%));
        gap: var(--overlay-mobile-gap, var(--overlay-gap, 0.5rem));
        text-align: var(--overlay-mobile-text-align, var(--overlay-text-align, center));
        align-items: var(--overlay-mobile-align-items, var(--overlay-align-items, center));
        justify-items: var(--overlay-mobile-justify-items, var(--overlay-justify-items, center));
    }

    .success-card-overlay-name {
        font-size: var(--overlay-mobile-name-size, var(--overlay-name-size, clamp(1.2rem, 5vw, 1.8rem)));
        line-height: var(--overlay-mobile-name-line-height, var(--overlay-name-line-height, 1.15));
    }

    .success-card-overlay-prayer {
        font-size: var(--overlay-mobile-prayer-size, var(--overlay-prayer-size, clamp(1rem, 4.5vw, 1.4rem)));
        line-height: var(--overlay-mobile-prayer-line-height, var(--overlay-prayer-line-height, 1.25));
    }
}

/* ============================================
   Main Form Section
   ============================================ */

.main-form-section {
    padding: 80px 24px;
    background: var(--bg-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.error-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #fff5f5;
    border-left: 4px solid #e53e3e;
    border-radius: 8px;
    color: #c53030;
    margin-bottom: 32px;
    animation: alertSlideIn 0.3s ease-out;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   Form Cards
   ============================================ */

.form-card {
    background: var(--bg-white);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 32px;
    overflow: hidden;
    animation: cardFadeIn 0.6s ease-out;
}

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

.card-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 32px;
    background: linear-gradient(135deg, var(--secondary), var(--bg-light));
    border-bottom: 2px solid var(--border);
}

.header-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--text-dark);
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.header-content {
    flex: 1;
}

.card-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: 0.95rem;
    color: var(--text-light);
}

.card-body {
    padding: 32px;
}

/* ============================================
   Payment Section
   ============================================ */

.payment-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 32px;
    margin-bottom: 32px;
}

.qr-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.qr-wrapper {
    position: relative;
    padding: 24px;
    background: var(--bg-light);
    border: 2px dashed var(--border);
    border-radius: 16px;
    text-align: center;
}

.qr-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    gap: 12px;
    color: var(--text-light);
}

.qr-placeholder i {
    font-size: 64px;
    color: var(--primary);
    opacity: 0.5;
}

.static-qr-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.static-qr-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.bank-info {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 20px;
}

.bank-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.bank-item i {
    font-size: 24px;
    color: var(--primary);
    margin-top: 4px;
}

.bank-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 4px;
}

.bank-account {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
    letter-spacing: 1px;
}

.bank-name {
    font-size: 0.95rem;
    color: var(--text-light);
}

.total-display {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 16px;
    color: var(--text-dark);
    box-shadow: var(--shadow-md);
}

.total-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 600;
}

.total-amount {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.package-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-header {
    margin-bottom: 8px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.section-title i {
    color: var(--primary);
}

.modern-select {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-white);
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-dark);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%233a2a0f' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    padding-right: 48px;
    transition: all 0.3s ease;
}

.modern-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(247, 201, 72, 0.1);
}

.package-description {
    padding: 16px 20px;
    background: var(--secondary);
    border-radius: 12px;
    color: var(--text-dark);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* ============================================
   Items Selection
   ============================================ */

.items-selection {
    margin-top: 24px;
}

.items-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.items-title i {
    color: var(--primary);
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.item-card {
    position: relative;
    cursor: pointer;
}

.item-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.item-card-content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.item-card:hover .item-card-content {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.item-card input[type="checkbox"]:checked + .item-card-content {
    background: var(--secondary);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.item-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-white);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary);
    flex-shrink: 0;
    overflow: hidden;
}

.item-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.item-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.item-check {
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    font-size: 12px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.item-card input[type="checkbox"]:checked + .item-card-content .item-check {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   Upload Section
   ============================================ */

.upload-section {
    margin-top: 32px;
}

.upload-header {
    margin-bottom: 20px;
}

.upload-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.upload-title i {
    color: var(--primary);
}

.upload-area {
    position: relative;
}

.file-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 48px 24px;
    background: var(--bg-light);
    border: 3px dashed var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-label:hover {
    border-color: var(--primary);
    background: var(--secondary);
}

.upload-icon {
    width: 80px;
    height: 80px;
    background: var(--bg-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.upload-text {
    text-align: center;
}

.upload-main-text {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.upload-sub-text {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
}

.image-preview {
    position: relative;
    margin-top: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.remove-image-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #e53e3e;
    font-size: 18px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.remove-image-btn:hover {
    background: #e53e3e;
    color: white;
    transform: scale(1.1);
}

/* ============================================
   Donor Information
   ============================================ */

.donor-fields {
    margin-top: 24px;
}

.form-row {
    margin-bottom: 24px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-label i {
    color: var(--primary);
}

.required {
    color: #e53e3e;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-white);
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(247, 201, 72, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.switch-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.switch-slider {
    position: relative;
    width: 52px;
    height: 28px;
    background: var(--border);
    border-radius: 14px;
    transition: all 0.3s ease;
}

.switch-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.switch-label input[type="checkbox"]:checked + .switch-slider {
    background: var(--primary);
}

.switch-label input[type="checkbox"]:checked + .switch-slider::before {
    transform: translateX(24px);
}

.switch-text {
    font-weight: 600;
    color: var(--text-dark);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    color: var(--text-dark);
    font-weight: 700;
    font-size: 14px;
}

.checkbox-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.checkbox-text i {
    color: var(--primary);
}

.confirm-row {
    padding: 24px;
    background: var(--bg-light);
    border-radius: 12px;
    margin-top: 8px;
}

.confirm-checkbox {
    font-size: 1.05rem;
}

/* ============================================
   Form Actions
   ============================================ */

.form-actions {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    padding-top: 32px;
    margin-top: 32px;
    border-top: 2px solid var(--border);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-cancel {
    background: var(--bg-white);
    color: var(--text-dark);
    border: 2px solid var(--border);
}

.btn-cancel:hover {
    background: var(--bg-light);
    border-color: var(--text-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-submit {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--text-dark);
    box-shadow: var(--shadow-md);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-submit .btn-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.btn-submit:hover .btn-shine {
    transform: translateX(100%);
}

.btn-home,
.btn-donate-again {
    padding: 14px 28px;
    background: var(--bg-white);
    color: var(--text-dark);
    border: 2px solid var(--border);
}

.btn-donate-again {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    color: var(--text-dark);
}

.btn-home:hover,
.btn-donate-again:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ============================================
   Modal
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(58, 42, 15, 0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: modalFadeIn 0.3s ease-out;
    cursor: pointer;
}

.modal-overlay.active {
    display: flex;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-container {
    background: var(--bg-white);
    border-radius: 24px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    position: relative;
    z-index: 2001;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    background: linear-gradient(135deg, var(--secondary), var(--bg-light));
    border-bottom: 2px solid var(--border);
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.modal-title i {
    color: var(--primary);
}

.modal-close {
    width: 40px;
    height: 40px;
    background: var(--bg-white);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-dark);
    font-size: 18px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--primary);
    transform: rotate(90deg);
}

.modal-body {
    padding: 32px;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
}

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.package-card-modal {
    position: relative;
    cursor: pointer;
}

.package-card-modal input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.package-card-content {
    position: relative;
    padding: 32px 24px;
    background: var(--bg-light);
    border: 3px solid var(--border);
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.package-card-modal:hover .package-card-content {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.package-card-modal input[type="radio"]:checked + .package-card-content {
    background: var(--secondary);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.package-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--text-dark);
    margin: 0 auto 16px;
    box-shadow: var(--shadow-md);
}

.package-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
    line-height: 1.4;
}

.package-badge {
    display: inline-block;
    padding: 8px 16px;
    background: var(--bg-white);
    border: 2px solid var(--primary);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.package-check {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    font-size: 14px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.package-card-modal input[type="radio"]:checked + .package-card-content .package-check {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   Scroll to Top Button
   ============================================ */

.scroll-top-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-dark);
    font-size: 20px;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    transition: all 0.3s ease;
}

.scroll-top-btn.show {
    display: flex;
}

.scroll-top-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (min-width: 1024px) {
    .hero-section {
        padding: 160px 32px 100px;
    }
    
    .hero-content {
        max-width: 1000px;
        padding: 0 40px;
    }
    
    .hero-title {
        font-size: clamp(4rem, 8vw, 7rem);
        line-height: 1.8;
    }
    
    .hero-title .title-line {
        letter-spacing: 4px;
    }
}

@media (min-width: 1440px) {
    .hero-section {
        padding: 180px 48px 120px;
    }
    
    .hero-content {
        max-width: 1200px;
        padding: 0 60px;
    }
    
    .hero-title {
        font-size: clamp(5rem, 8vw, 8rem);
    }
}

@media (max-width: 968px) {
    .payment-grid {
        grid-template-columns: 1fr;
    }
    
    .qr-section {
        order: 2;
    }
    
    .package-section {
        order: 1;
    }
}

@media (max-width: 768px) {
    .hero-section {
        min-height: 100vh;
        min-height: 100dvh; /* Dynamic viewport height for mobile */
        padding: 80px 16px 60px;
    }
    
    .hero-background {
        background-attachment: scroll; /* Fix for mobile */
        background-size: cover;
        background-position: center center;
    }
    
    .hero-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
        line-height: 1.4;
        overflow: visible;
    }
    
    .hero-title .title-line {
        white-space: normal;
        word-break: keep-all;
        overflow: visible;
    }
    
    .hero-content {
        padding: 0 16px;
        max-width: 100%;
    }
    
    .back-floating-btn span {
        display: none;
    }
    
    .back-floating-btn {
        padding: 12px;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        justify-content: center;
    }
    
    .main-form-section {
        padding: 40px 16px;
    }
    
    .card-header {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }
    
    .card-body {
        padding: 24px;
    }
    
    .items-grid {
        grid-template-columns: 1fr;
    }
    
    .packages-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .success-actions {
        flex-direction: column;
    }
    
    .scroll-top-btn {
        width: 48px;
        height: 48px;
        bottom: 24px;
        right: 24px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        min-height: 100vh;
        min-height: 100dvh; /* Dynamic viewport height for mobile */
        padding: 60px 12px 40px;
    }
    
    .hero-background {
        background-attachment: scroll;
        background-size: cover;
        background-position: center center;
    }
    
    .hero-overlay,
    .hero-pattern {
        width: 100%;
        height: 100%;
    }
    
    .hero-content {
        padding: 0;
        width: 100%;
    }
    
    .hero-title {
        font-size: clamp(2rem, 12vw, 3.5rem);
        margin-bottom: 12px;
        line-height: 1.4;
        overflow: visible;
    }
    
    .hero-title .title-line {
        white-space: normal;
        word-break: keep-all;
        overflow: visible;
    }
    
    .hero-content {
        padding: 0 12px;
        max-width: 100%;
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 4vw, 1.2rem);
        margin-bottom: 32px;
    }
    
    .hero-cta-btn {
        padding: 14px 28px;
        font-size: 0.95rem;
        width: 100%;
        max-width: 300px;
    }
    
    .scroll-indicator {
        bottom: 20px;
    }
    
    .card-title {
        font-size: 1.5rem;
    }
    
    .total-amount {
        font-size: 1.5rem;
    }
    
    .modal-container {
        border-radius: 16px;
        margin: 12px;
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
}

/* Mobile Landscape Orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 40px 16px;
    }
    
    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
        margin-bottom: 8px;
        line-height: 1.4;
        overflow: visible;
    }
    
    .hero-title .title-line {
        white-space: normal;
        word-break: keep-all;
        overflow: visible;
    }
    
    .hero-subtitle {
        font-size: clamp(0.9rem, 3vw, 1.1rem);
        margin-bottom: 24px;
    }
    
    .hero-cta-btn {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
    
    .scroll-indicator {
        display: none;
    }
}

/* Very Small Mobile Devices */
@media (max-width: 360px) {
    .hero-section {
        padding: 50px 12px 30px;
    }
    
    .hero-title {
        font-size: clamp(1.8rem, 14vw, 2.5rem);
        line-height: 1.4;
        overflow: visible;
    }
    
    .hero-title .title-line {
        white-space: normal;
        word-break: keep-all;
        overflow: visible;
    }
    
    .hero-content {
        padding: 0 12px;
        max-width: 100%;
    }
    
    .hero-subtitle {
        font-size: clamp(0.9rem, 4.5vw, 1rem);
        margin-bottom: 24px;
    }
    
    .hero-cta-btn {
        padding: 12px 24px;
        font-size: 0.9rem;
        max-width: 100%;
    }
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .back-floating-btn,
    .scroll-top-btn,
    .modal-overlay {
        display: none !important;
    }
}
