:root {
    --primary-color: #9f7aea;
    --primary-glow: rgba(159, 122, 234, 0.5);
    --secondary-glow: rgba(79, 70, 229, 0.6);
    --background-color: #0c0a18;
    --text-color: #e2e8f0;
    --text-color-muted: #94a3b8;
    --card-background: rgba(23, 20, 44, 0.5);
    --border-color: rgba(255, 255, 255, 0.1);
    --font-family: 'Poppins', sans-serif;
}

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

html, body {
    height: 100%;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-x: hidden;
}

.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://offertabs.s3.amazonaws.com/offer/dp6jr3/69c0622a54e1a3.83838812.jpg');
    background-size: cover;
    background-position: center;
    z-index: -2;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent, var(--background-color) 75%);
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 650px;
    text-align: center;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3), 0 0 0 1px var(--border-color);
    transform: perspective(1000px) rotateX(0deg);
    transition: transform 0.3s ease;
}

.header {
    margin-bottom: 2.5rem;
}

h1, h2, h3 {
    font-weight: 600;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(135deg, #a78bfa, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1rem;
}

.description {
    color: var(--text-color-muted);
    font-size: 1.1rem;
    line-height: 1.7;
    max-width: 500px;
    margin: 0 auto;
}

#countdown-section h2 {
    font-size: 1rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-color-muted);
    margin-bottom: 1.5rem;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 12px;
    width: 90px;
}

.time-value {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1;
}

.time-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-color-muted);
    letter-spacing: 1px;
}

#form-section {
    margin-top: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

input[type="email"]::placeholder {
    color: var(--text-color-muted);
}

input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-glow);
}

button[type="submit"] {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--font-family);
    color: #fff;
    background: linear-gradient(135deg, #7c3aed, var(--primary-color));
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px var(--primary-glow);
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: translateY(0);
}

.error-message {
    color: #fca5a5;
    background-color: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    padding: 0.75rem;
    border-radius: 8px;
    margin-top: 1rem;
}

/* Thank You State */
.thank-you-container h2 {
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #a78bfa, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.coupon-wrapper {
    margin-top: 2.5rem;
    background-color: rgba(0,0,0,0.2);
    padding: 1.5rem;
    border-radius: 16px;
}

.coupon-wrapper h3 {
    font-weight: 400;
    color: var(--text-color-muted);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.coupon-code-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.3);
    border: 1px dashed var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 12px;
}

#coupon-code {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--primary-color);
}

#copy-code-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
}
#copy-code-button:hover {
    background: #8b5cf6;
}
#copy-code-button svg {
    width: 16px;
    height: 16px;
}

.share-panel {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.share-link-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

#share-url {
    flex-grow: 1;
    background-color: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color-muted);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

#copy-link-button {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#copy-link-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}


/* Status State */
#status-message {
    font-size: 1.5rem;
    line-height: 1.6;
    color: var(--text-color-muted);
}

#wbx-powered-by-slot {
    margin-top: 2rem;
    width: 100%;
}

.hidden {
    display: none !important;
}

@media (min-width: 640px) {
    .form-group {
        flex-direction: row;
    }
    input[type="email"] {
        flex-grow: 1;
    }
    button[type="submit"] {
        width: auto;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (max-width: 640px) {
    body {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 5vh;
    }
    .container {
        padding: 2rem 1.5rem;
    }
    h1 {
        font-size: 2rem;
    }
    .description {
        font-size: 1rem;
    }
    .countdown-timer {
        gap: 0.5rem;
    }
    .time-block {
        width: 70px;
        padding: 0.75rem 0.5rem;
    }
    .time-value {
        font-size: 1.75rem;
    }
    .time-label {
        font-size: 0.65rem;
    }
    #coupon-code {
        font-size: 1.2rem;
    }
}
