/* =========================================
   VARIABLES & RESET
   ========================================= */
:root {
    --primary: #FF007A;
    --primary-hover: #D90068;
    --secondary: #00E5FF;
    --accent: #FFEA00;
    
    --bg-dark: #120A1F;
    --glass-bg: rgba(20, 10, 35, 0.7);
    --glass-border: rgba(255, 255, 255, 0.15);
    
    --text-main: #FFFFFF;
    --text-muted: rgba(255, 255, 255, 0.7);
    
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --radius-lg: 24px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-dark);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    overflow-x: hidden;
    position: relative;
}

/* =========================================
   UTILITIES
   ========================================= */
.hidden {
    display: none !important;
}

/* =========================================
   BACKGROUND
   ========================================= */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Use the generated vibrant abstract image */
    background-image: url('https://offertabs.s3.amazonaws.com/offer/8zbdcj/69bde49b8f7499.48135545.jpg');
    background-size: cover;
    background-position: center;
    z-index: -2;
}
.bg-layer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(18, 10, 31, 0.4) 0%, var(--bg-dark) 100%);
    z-index: -1;
}

/* =========================================
   LAYOUT & CONTAINERS
   ========================================= */
.page-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (min-width: 900px) {
    .glass-container {
        flex-direction: row;
        align-items: stretch;
    }
}

.col-content {
    flex: 1;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.col-wheel {
    flex: 1;
    background: rgba(0,0,0,0.2);
    padding: 3rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--glass-border);
}

@media (min-width: 900px) {
    .col-content { padding: 4rem; }
    .col-wheel { border-top: none; border-left: 1px solid var(--glass-border); }
}

/* =========================================
   TYPOGRAPHY & HERO
   ========================================= */
.hero-header {
    margin-bottom: 2.5rem;
}

.badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255, 0, 122, 0.15);
    border: 1px solid rgba(255, 0, 122, 0.3);
    color: #FFA5D8;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

.campaign-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.highlight {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.campaign-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 480px;
}

/* =========================================
   FORMS & INPUTS
   ========================================= */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

input[type="text"],
input[type="email"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    color: white;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 0, 122, 0.2);
}

.error-message {
    background: rgba(239, 68, 68, 0.15);
    color: #FCA5A5;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(239, 68, 68, 0.3);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.disclaimer {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    margin-top: 1.5rem;
}

/* =========================================
   BUTTONS
   ========================================= */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), #D90068);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 1.125rem;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--font-heading);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(255, 0, 122, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(255, 0, 122, 0.4);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: white;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Loader */
.btn-loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* =========================================
   PRIZE WHEEL
   ========================================= */
.wheel-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#wheel-canvas {
    width: 100%;
    height: 100%;
    /* Subtle shadow around the wheel itself */
    border-radius: 50%;
    box-shadow: 0 0 0 8px rgba(255,255,255,0.05), 0 20px 40px rgba(0,0,0,0.5);
    /* Transform origin is center for accurate rotation */
    transform-origin: center center;
}

.wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    z-index: 10;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 15%;
    height: 15%;
    background: var(--bg-dark);
    border: 4px solid var(--glass-border);
    border-radius: 50%;
    z-index: 5;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5), 0 4px 10px rgba(0,0,0,0.4);
}

/* =========================================
   RESULT STATES
   ========================================= */
.result-state {
    text-align: center;
    animation: fadeIn 0.5s ease;
}

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

.result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.result-state h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.prize-name {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 2rem;
}

.lose-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.code-box, .qr-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.code-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.code-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.code-text {
    flex: 1;
    font-family: 'Space Grotesk', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(255,255,255,0.05);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    letter-spacing: 0.1em;
    word-break: break-all;
}

#share-url {
    background: transparent;
    border: none;
    color: white;
    font-size: 1rem;
    flex: 1;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    border-radius: 0;
}

.qr-box img {
    max-width: 150px;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: white;
    padding: 8px;
}

.qr-instruction {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.expiration-text {
    font-size: 0.9rem;
    color: #FCA5A5;
    margin-top: 1rem;
}

.success-note {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 2rem;
}

.share-panel {
    margin-top: 2.5rem;
    text-align: center;
}
.share-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
    margin-bottom: 2rem;
}
.share-panel h3 {
    font-family: var(--font-heading);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}
.share-panel p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* =========================================
   STATUS MESSAGE (ENDED/COMING SOON)
   ========================================= */
.status-message {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}
.status-message h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
.status-message p {
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* =========================================
   MODAL (TERMS & CONDITIONS)
   ========================================= */

/* T&C Link */
#tc-link {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}
#tc-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Modal Layout */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    display: none !important;
    opacity: 0;
}

.modal-content {
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark); /* Solid fallback */
    border-radius: var(--radius-md);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: white;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    text-align: left;
    white-space: pre-wrap; /* added for textarea newlines */
}

.modal-body p {
    margin-bottom: 1rem;
}