/* CSS Variables */
:root {
    --espresso: #2d1b14;
    --cream: #f5e6d3;
    --copper: #b8763a;
    --teal: #0c4a4a;
    --teal-hover: #083636;
    --text-dark: #1a100c;
    --white: #ffffff;
    --error: #dc2626;
}

/* Reset & Basics */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--cream);
    line-height: 1.6;
    min-height: 100vh;
    display: block; /* Avoids center clipping on tall content */
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Background Elements */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: -2;
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, rgba(45, 27, 20, 0.8) 0%, rgba(12, 74, 74, 0.85) 100%);
    z-index: -1;
}

/* Layout Container */
.container {
    max-width: 600px;
    margin: 40px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Typography */
h1 {
    font-family: 'Bitter', serif;
    font-size: 3.2rem;
    font-weight: 900;
    line-height: 1.1;
    text-align: center;
    margin-bottom: 16px;
    color: var(--white);
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

h1 span {
    color: var(--copper);
    font-style: italic;
}

.subtitle {
    font-size: 1.15rem;
    text-align: center;
    color: rgba(245, 230, 211, 0.8);
    font-weight: 400;
    margin-bottom: 50px;
}

/* 3D Gift Card Visual */
.gift-card-wrapper {
    perspective: 1200px;
    margin: 0 auto -60px; /* Overlaps the form */
    z-index: 10;
    width: 100%;
    max-width: 320px;
    display: flex;
    justify-content: center;
}

.gift-card {
    width: 280px;
    height: 440px;
    border-radius: 16px;
    background-size: cover;
    background-position: center;
    position: relative;
    box-shadow: 
        20px 30px 40px rgba(0, 0, 0, 0.5), 
        inset 0 0 0 1px rgba(255, 255, 255, 0.15),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    transform: rotateY(-8deg) rotateX(4deg);
    animation: float 6s ease-in-out infinite;
    overflow: hidden;
}

.gc-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
}

.gc-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px 24px;
}

.gc-top {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gc-logo {
    font-family: 'Bitter', serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--white);
    letter-spacing: 0.5px;
}

.gc-type {
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.7);
    font-weight: 600;
}

.gc-middle {
    text-align: left;
}

.gc-value {
    font-family: 'Bitter', serif;
    font-weight: 900;
    font-size: 5rem;
    color: var(--white);
    line-height: 1;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.gc-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

@keyframes float {
    0% { transform: translateY(0px) rotateY(-8deg) rotateX(4deg); }
    50% { transform: translateY(-15px) rotateY(-5deg) rotateX(2deg); }
    100% { transform: translateY(0px) rotateY(-8deg) rotateX(4deg); }
}

/* Form Card */
.form-card {
    background: var(--cream);
    border-radius: 24px;
    padding: 80px 32px 40px; /* Extra top padding for overlap */
    width: 100%;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    color: var(--text-dark);
    z-index: 5;
}

.badge {
    position: absolute;
    top: -15px;
    right: -10px;
    background: var(--copper);
    color: var(--white);
    padding: 10px 16px;
    border-radius: 99px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 8px 20px rgba(184, 118, 58, 0.4);
    transform: rotate(4deg);
    z-index: 15;
}

/* Form Elements */
.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--espresso);
}

input[type="email"], select, input[type="text"] {
    width: 100%;
    padding: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--text-dark);
    background-color: var(--white);
    border: 2px solid rgba(45, 27, 20, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

input[type="email"]:focus, select:focus, input[type="text"]:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(12, 74, 74, 0.1);
}

/* Custom Select Styling */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%232d1b14' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 48px;
    cursor: pointer;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 18px;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.primary-btn {
    background: var(--teal);
    color: var(--white);
    box-shadow: 0 10px 25px rgba(12, 74, 74, 0.3);
}

.primary-btn:hover:not(:disabled) {
    background: var(--teal-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(12, 74, 74, 0.4);
}

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

/* Status & Alerts */
.alert {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
}

.alert.error {
    background-color: rgba(220, 38, 38, 0.1);
    color: var(--error);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.status-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 24px;
}

/* Post-Entry State */
.success-header {
    text-align: center;
    margin-bottom: 30px;
}

.check-icon {
    width: 64px;
    height: 64px;
    background: var(--teal);
    color: white;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 20px;
    box-shadow: 0 10px 20px rgba(12, 74, 74, 0.2);
}

.success-header h2 {
    font-family: 'Bitter', serif;
    font-size: 2rem;
    color: var(--espresso);
    margin-bottom: 8px;
}

.success-header p {
    color: #555;
}

.bonus-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 30px 0;
    color: #888;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bonus-divider::before, .bonus-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.bonus-divider span {
    padding: 0 16px;
}

.bonus-text {
    font-size: 0.95rem;
    margin-bottom: 16px;
    text-align: center;
    color: var(--espresso);
}

.share-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
}

.share-input-group input {
    flex: 1;
    background: #fdfaf6;
}

.secondary-btn {
    background: var(--copper);
    color: white;
    width: auto;
    padding: 0 24px;
    font-size: 1rem;
}

.secondary-btn:hover {
    background: #a16430;
}

.social-actions {
    display: grid;
    gap: 12px;
}

.btn-social {
    padding: 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-social:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.btn-insta {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
}

.btn-tiktok {
    background: #000;
    color: white;
}

.btn-newsletter {
    background: var(--espresso);
    color: var(--cream);
}

/* Rules Accordion */
.rules-container {
    width: 100%;
    margin-top: 60px;
    margin-bottom: 40px;
}

.rules-toggle {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--cream);
    padding: 16px 24px;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.rules-toggle:hover {
    background: rgba(255,255,255,0.1);
}

.rules-toggle svg {
    transition: transform 0.3s ease;
}

.rules-container.open .rules-toggle {
    border-radius: 12px 12px 0 0;
    border-bottom-color: transparent;
}

.rules-container.open .rules-toggle svg {
    transform: rotate(180deg);
}

.rules-content {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.15);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 24px;
    font-size: 0.85rem;
    color: rgba(245, 230, 211, 0.7);
    display: none;
}

.rules-container.open .rules-content {
    display: block;
}

.rules-content p {
    margin-bottom: 12px;
}

.rules-content p:last-child {
    margin-bottom: 0;
}

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

/* SDK Powered By Slot */
#wbx-powered-by-slot {
    width: 100%;
    margin-top: auto;
    padding-bottom: 20px;
}

/* Media Queries */
@media (max-width: 600px) {
    h1 { font-size: 2.5rem; }
    .gift-card { width: 240px; height: 380px; }
    .gc-value { font-size: 4rem; }
    .form-card { padding: 60px 24px 30px; margin-top: -40px; }
    .badge { right: 0; transform: rotate(0); top: -20px; border-radius: 8px; width: 100%; text-align: center; }
}
