/* Base Variables */
:root {
    --primary: #d05c14; /* Warm terracotta/orange */
    --primary-hover: #b04c0e;
    --secondary: #2f4f4f; /* Ash/Agave dark green */
    --bg-dark: #1a1a1a;
    --text-dark: #2d3748;
    --text-light: #718096;
    --white: #ffffff;
    --error: #e53e3e;
    --success: #38a169;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background-color: var(--bg-dark);
    /* Premium background with gradient overlay for text legibility */
    background-image: linear-gradient(135deg, rgba(26, 26, 26, 0.8) 0%, rgba(47, 79, 79, 0.6) 100%), url("https://offertabs.s3.amazonaws.com/offer/v5odjn/site/media/69d81afc6b9eb5.87382978.jpg");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* Layout */
.page-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    width: 100%;
}

.main-content {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Glassmorphism Card */
.card-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

/* Optional decorative accent on card */
.card-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
}

/* Typography */
.brand-header {
    text-align: center;
    margin-bottom: 24px;
}

.eyebrow {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--primary);
    margin-bottom: 12px;
}

.brand-logo {
    max-width: 100%;
    width: 260px;
    height: auto;
    margin: 10px auto 16px;
    display: block;
}

.brand-header h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--secondary);
    line-height: 1.1;
    margin-bottom: 8px;
    font-weight: 700;
}

.brand-header h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-style: italic;
    color: var(--text-dark);
    font-weight: 600;
}

.description {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 36px;
    font-size: 1.1rem;
    line-height: 1.7;
}

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

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

.form-group input {
    width: 100%;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    background: var(--white);
    color: var(--text-dark);
}

.form-group input::placeholder {
    color: #a0aec0;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(208, 92, 20, 0.15);
}

/* Buttons */
.btn-primary, .btn-secondary {
    width: 100%;
    padding: 18px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none; /* For <a> tags used as buttons */
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    margin-top: 16px;
    box-shadow: 0 4px 6px -1px rgba(208, 92, 20, 0.3), 0 2px 4px -1px rgba(208, 92, 20, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(208, 92, 20, 0.4), 0 4px 6px -2px rgba(208, 92, 20, 0.2);
    color: var(--white);
}

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

.btn-secondary {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    margin-top: 16px;
}

.btn-secondary:hover {
    background-color: rgba(208, 92, 20, 0.05);
    color: var(--primary);
}

.btn-sm {
    padding: 10px 24px;
    font-size: 0.95rem;
    width: max-content;
    align-self: center;
}

#redeem-btn {
    background-color: #00628b;
    color: var(--white);
    border: 2px solid #00628b;
    transition: all 0.3s ease;
}

#redeem-btn:hover {
    background-color: #004c6d;
    border-color: #004c6d;
}

/* Button Groups */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.action-buttons .btn-primary,
.action-buttons .btn-secondary {
    margin-top: 0; /* Remove default top margin inside button groups */
}

.result-action-buttons {
    margin-bottom: 24px;
}

/* Alerts & Status Messages */
.error-text {
    color: var(--error);
    font-size: 0.95rem;
    margin-bottom: 20px;
    text-align: center;
    background: #fff5f5;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #fed7d7;
}

.status-message {
    text-align: center;
    padding: 30px 20px;
    font-size: 1.3rem;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--secondary);
    background: #f7fafc;
    border-radius: 12px;
}

/* Result View / Coupon Styles */
.coupon-box {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    margin-bottom: 24px;
    position: relative;
}

.coupon-code {
    font-family: 'Inter', monospace;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--secondary);
    letter-spacing: 2px;
    word-break: break-all;
    display: block;
    margin-bottom: 16px;
}

.qr-container {
    text-align: center;
    margin-bottom: 32px;
    padding: 24px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
}

.qr-instructions {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.qr-container img {
    max-width: 180px;
    height: auto;
    border-radius: 8px;
}

.terms {
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
    line-height: 1.6;
}

.terms p {
    margin-bottom: 8px;
}

.small-terms {
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 20px;
    line-height: 1.5;
}

/* Loader Animation */
.loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Powered By Element Reset */
#wbx-powered-by-slot {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .card-container {
        padding: 40px 24px;
        border-radius: 16px;
    }
    
    .brand-header h1 {
        font-size: 2.4rem;
    }
    
    .coupon-code {
        font-size: 1.8rem;
    }
}