:root {
    --primary: #594236; /* Warm deep brown */
    --primary-light: #8E7465;
    --primary-dark: #3A2A22;
    --accent: #B28F6F; /* Antique gold */
    --accent-hover: #9E7D61;
    --bg-light: #F7F5F0; /* Warm cream */
    --surface: #FFFFFF;
    --text: #2D2724;
    --text-light: #665D58;
    --border: #E8E2D9;
    --error: #D34C4C;
    --success: #4C9F70;
    
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Lora', serif; /* Using a secondary serif for a very bookish feel */
}

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

body {
    font-family: var(--font-sans);
    color: var(--text);
    background-color: var(--bg-light);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    color: var(--primary-dark);
    line-height: 1.2;
}

/* Header */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 0.25rem;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 6rem 1.5rem;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    z-index: 1;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #F7F5F0;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: sans-serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.hero p a {
    color: #FFFFFF;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.hero p a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

/* Countdown Timer */
.countdown-timer {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.cd-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 1rem;
    min-width: 80px;
    color: #fff;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.cd-value {
    font-size: 2.25rem;
    font-weight: 700;
    font-family: var(--font-serif);
    line-height: 1;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.cd-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    font-family: sans-serif;
    opacity: 0.9;
}

.ended-message {
    font-size: 1.25rem;
    font-weight: 600;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* Main Content */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
    width: 100%;
    flex: 1;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: start;
}

@media (min-width: 900px) {
    .grid-layout {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
}

/* Prize Info Column */
.prize-info h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 1rem;
}

.prize-info h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--accent);
}

.prize-desc {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.book-list {
    list-style: none;
    margin-bottom: 2.5rem;
}

.book-list li {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-list li:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(89, 66, 54, 0.08);
}

.book-cover {
    flex-shrink: 0;
    width: 60px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    margin-right: 1.25rem;
    object-fit: cover;
    border: 1px solid rgba(0,0,0,0.05);
}

.book-details {
    flex: 1;
    min-width: 0;
    padding-right: 1rem;
}

.book-details strong {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.125rem;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
}

.book-details span {
    display: block;
    font-size: 0.9375rem;
    color: var(--text-light);
}

.learn-more-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-family: sans-serif;
    font-weight: 600;
    color: var(--primary);
    background-color: transparent;
    border: 1px solid var(--primary);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.learn-more-btn:hover {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(89, 66, 54, 0.15);
}

/* Form Panel */
.form-panel {
    background: var(--surface);
    padding: 3rem;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(45, 39, 36, 0.1);
    border: 1px solid var(--border);
}

.view-section {
    animation: fadeIn 0.5s ease;
}

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

.form-panel h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: center;
}

.form-instructions {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    font-size: 1.125rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-family: sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

input[type="text"]:focus,
input[type="email"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(178, 143, 111, 0.15);
    background: var(--surface);
}

.error-message {
    padding: 1rem;
    background: rgba(211, 76, 76, 0.1);
    border: 1px solid rgba(211, 76, 76, 0.3);
    color: var(--error);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.cta-button {
    width: 100%;
    padding: 1.25rem;
    background: var(--primary);
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    font-family: sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(58, 42, 34, 0.2);
}

.cta-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Success State */
#view-success {
    text-align: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: rgba(76, 159, 112, 0.1);
    color: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

#view-success > p {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.step-two-box {
    background: var(--bg-light);
    border: 1px solid var(--accent);
    border-radius: 16px;
    padding: 2rem;
    text-align: left;
}

.step-two-box h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.step-two-box p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.share-url-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.share-url-container input {
    flex: 1;
    background: var(--surface);
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-light);
}

.secondary-btn {
    padding: 0 1.5rem;
    background: var(--surface);
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.secondary-btn:hover {
    background: var(--primary);
    color: #fff;
}

.social-share-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.social-btn {
    display: block;
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-family: sans-serif;
    font-size: 0.9375rem;
    color: #fff;
    transition: opacity 0.2s;
}

.social-btn:hover {
    opacity: 0.9;
}

.substack-btn { background: #FF6719; }
.fb-btn { background: #1877F2; }
.x-btn { background: #000000; }

.confirm-section {
    margin-top: 2.5rem;
    text-align: center;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.confirm-section p {
    margin-bottom: 1rem;
    color: var(--text-light);
    font-size: 0.9375rem;
}

#confirm-entry-btn {
    width: auto;
    margin: 0 auto;
    padding: 0.75rem 2rem;
}

/* Powered By */
#wbx-powered-by-slot {
    padding: 2rem;
    display: flex;
    justify-content: center;
}

@media (max-width: 600px) {
    .form-panel {
        padding: 2rem 1.5rem;
    }
    .social-share-buttons {
        grid-template-columns: 1fr;
    }
    .hero {
        padding: 4rem 1rem;
    }
    
    .countdown-timer {
        gap: 0.5rem;
    }
    .cd-item {
        padding: 0.75rem 0.5rem;
        min-width: 65px;
    }
    .cd-value {
        font-size: 1.75rem;
    }

    .book-list li {
        flex-wrap: wrap;
    }
    .book-details {
        padding-right: 0;
        flex: 1 1 0%;
    }
    .learn-more-btn {
        margin-top: 1rem;
        flex: 1 1 100%;
    }
}
