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

:root {
    --primary-color: #c41e3a;
    --primary-dark: #a01a2f;
    --primary-light: #e63950;
    --secondary-color: #2c5530;
    --accent-gold: #f4a261;
    --accent-green: #2a9d8f;
    --background: #f8f9fa;
    --text: #2d3436;
    --text-light: #636e72;
    --border: #dfe6e9;
    --white: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
    --shadow-large: rgba(0, 0, 0, 0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #e63950 0%, #c41e3a 50%, #a01a2f 100%);
    background-attachment: fixed;
    background-color: #c41e3a; /* Fallback for mobile */
    min-height: 100vh;
    color: var(--text);
    line-height: 1.6;
    position: relative;
}

/* Ensure red background on mobile */
@media (max-width: 767px) {
    body {
        background: #c41e3a !important;
        background: linear-gradient(135deg, #e63950 0%, #c41e3a 50%, #a01a2f 100%) !important;
        background-attachment: scroll !important; /* Better for mobile performance */
    }
    
    body::before {
        display: none; /* Disable overlay on mobile for better red visibility */
    }
}

/* Subtle animated background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.page {
    display: none;
    min-height: 100vh;
    padding: 20px 0;
    animation: fadeIn 0.4s ease;
}

.page.active {
    display: block;
}

/* Home Page */
.home-content {
    background: var(--white);
    border-radius: 24px;
    padding: 50px 35px;
    text-align: center;
    box-shadow: 0 20px 60px var(--shadow-large), 0 0 0 1px rgba(255, 255, 255, 0.1);
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.home-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-gold), var(--primary-color));
}

.santa-emoji {
    font-size: 200px;
    line-height: 1;
    margin-bottom: 20px;
    text-align: center;
    animation: float 3s ease-in-out infinite;
    display: block;
}

@media screen and (max-width: 767px) {
    .santa-emoji {
        font-size: 180px !important;
        margin-bottom: 15px;
        display: block !important;
    }
    
    .home-content h1 {
        font-size: 22px !important;
    }
    
    .mobile-only {
        display: inline;
    }
}

.mobile-only {
    display: none !important;
}

.desktop-only {
    display: inline;
}

@media screen and (max-width: 767px) {
    .mobile-only {
        display: inline !important;
    }
    
    .desktop-only {
        display: none !important;
    }
}

.nowrap {
    white-space: nowrap;
}

.christmas-line {
    display: inline-block;
    width: 100%;
    text-align: center;
    margin-left: -1em;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.home-content h1 {
    font-size: 28px;
    color: #c41e3a;
    margin-bottom: 12px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-align: center;
}

.intro-text {
    font-size: 15px;
    color: var(--text-light);
    margin-bottom: 18px;
    text-align: center;
    line-height: 1.4;
}

/* Buttons */
.btn {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    width: 100%;
    max-width: 300px;
    margin: 20px auto 0;
    display: block;
    -webkit-tap-highlight-color: rgba(196, 30, 58, 0.3);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: var(--white);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover:not(:disabled)::before {
    left: 100%;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(196, 30, 58, 0.5);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: var(--white);
    color: var(--text);
    border: 2px solid var(--border);
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--background);
    border-color: var(--text-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* Button Group */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    flex-direction: column;
}

.button-group .btn {
    margin: 0;
    max-width: 100%;
}

@media (min-width: 768px) {
    .button-group {
        flex-direction: row;
        justify-content: center;
    }
    
    .button-group .btn {
        flex: 1;
        max-width: 200px;
    }
}

/* Form Container */
#form-container {
    background: var(--white);
    border-radius: 24px;
    padding: 35px 25px;
    box-shadow: 0 20px 60px var(--shadow-large), 0 0 0 1px rgba(255, 255, 255, 0.1);
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

#form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-gold), var(--primary-color));
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-gold), var(--primary-color));
    background-size: 200% 100%;
    border-radius: 10px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 20%;
    animation: shimmer 2s infinite;
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.3);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 30px;
    font-weight: 500;
}

/* Form Steps */
.form-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.form-step.active {
    display: block;
}

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

.form-step h2 {
    font-size: 28px;
    color: #c41e3a;
    margin-bottom: 8px;
    text-align: center;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.1;
}

.step-description {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 12px;
    margin-top: 0;
    text-align: center;
    line-height: 1.3;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 25px;
    margin-left: -2em;
    margin-right: -2em;
}

.character-grid {
    grid-template-columns: repeat(2, 1fr);
    margin-left: 0;
    margin-right: 0;
}

.option-btn {
    padding: 18px 24px;
    font-size: 17px;
    background: var(--white);
    border: 2.5px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    color: var(--text);
    font-weight: 600;
    position: relative;
    width: 100%;
    max-width: 100%;
    text-align: center;
    -webkit-tap-highlight-color: rgba(196, 30, 58, 0.3);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.option-btn:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.08) 0%, rgba(196, 30, 58, 0.03) 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.2);
}

.option-btn.selected {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: var(--white);
    border-color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.4);
    transform: translateY(-2px);
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.text-input {
    width: 100%;
    padding: 16px 18px;
    font-size: 16px;
    border: 2.5px solid var(--border);
    border-radius: 14px;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--white);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

.text-input select,
select.text-input {
    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='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 12px;
    padding-right: 45px;
    cursor: pointer;
}

.text-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(196, 30, 58, 0.1), 0 4px 12px rgba(196, 30, 58, 0.1);
    transform: translateY(-1px);
}

.text-input::placeholder {
    color: #999;
}

#greeting-who-container {
    margin-top: 20px;
    margin-bottom: 25px;
}

#greeting-who-container label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.hidden {
    display: none;
}

/* Review Content */
.review-content {
    background: linear-gradient(135deg, var(--background) 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid var(--border);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.review-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.review-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.review-item strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.review-item p {
    color: var(--text);
    font-size: 16px;
    margin: 0;
}

/* Thank You */
.thank-you-content {
    text-align: center;
    padding: 20px 0;
}

.thank-you-content h2 {
    font-size: 36px;
    color: #c41e3a;
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.thank-you-content p {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 35px;
    line-height: 1.8;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Tablet and Desktop */
@media (min-width: 768px) {
    .container {
        padding: 40px 20px;
    }

    .home-content {
        padding: 60px 50px;
    }

    .home-content h1 {
        font-size: 32px;
        color: #c41e3a;
        margin-bottom: 14px;
    }

    .intro-text {
        font-size: 16px;
    }

    .options-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #form-container {
        padding: 40px 30px;
    }

    .form-step h2 {
        font-size: 28px;
        color: #c41e3a;
        margin-bottom: 8px;
    }
    
    /* Mobile touch fixes */
    .btn, .option-btn {
        min-height: 44px; /* Minimum touch target size for mobile */
        -webkit-tap-highlight-color: rgba(196, 30, 58, 0.3);
    }
    
    .text-input, select.text-input {
        min-height: 44px; /* Minimum touch target size for mobile */
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Ensure buttons are clickable on mobile */
    button, .btn, .option-btn {
        pointer-events: auto !important;
        -webkit-touch-callout: none;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 700px;
    }
}

