/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --primary: #8c1d1d;
    --primary-hover: #6b1515;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --bg-light: #f1f5f9;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #e2e8f0;
    color: #1e293b;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

/* Typography Helpers */
h1, h2, h3, h4, p { margin-top: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.text-center { text-align: center; }

/* Layout */
.page-wrapper {
    min-height: 100vh;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* The Card */
.gleam-card {
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 600px;
    position: relative;
    margin-bottom: 30px;
}

/* Card Hero Image */
.card-hero {
    width: 100%;
    background: #f8fafc;
}
.card-hero img {
    width: 100%;
    height: auto;
    display: block;
}

/* Prize Banner */
.prize-banner {
    background: var(--primary);
    color: #fff;
    display: flex;
    padding: 20px 30px;
    gap: 20px;
    align-items: center;
}
.prize-left {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    border-right: 1px solid rgba(255,255,255,0.3);
    padding-right: 20px;
}
.prize-left svg {
    width: 40px; height: 40px;
    flex-shrink: 0;
}
.prize-left strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 4px;
}
.prize-left p {
    font-size: 0.85rem;
    margin: 0;
    opacity: 0.9;
}
.prize-right {
    flex: 1;
    text-align: center;
}
.prize-right > span {
    font-weight: 700;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 5px;
}
.prize-box {
    background: #fff;
    color: #000;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.prize-amount {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 5px;
    line-height: 1;
}
.prize-amount span {
    font-size: 0.6rem;
    color: #333;
    font-weight: 600;
    text-align: left;
    text-transform: uppercase;
}

/* Action Header */
.actions-header {
    text-align: center;
    padding: 25px 30px 20px;
    background: #f8f9fa;
}
.actions-header h4 {
    color: var(--primary);
    font-weight: 800;
    font-size: 1.3rem;
    margin-bottom: 5px;
}
.actions-header p {
    font-size: 0.95rem;
    color: #666;
    margin: 0;
}
.step-instructions {
    margin-top: 15px;
    font-size: 0.85rem;
    color: #475569;
    background-color: #f1f5f9;
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px dashed #cbd5e1;
    display: inline-block;
    font-weight: 500;
}

/* Action List */
.action-list {
    background: #fff;
}
.action-row {
    border-bottom: 1px solid #f1f5f9;
}

.row-header {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.row-header:hover {
    background-color: #f8fafc;
}

/* Completed state styling */
.action-row.completed .row-header {
    background-color: #f0fdf4;
}
.action-row.completed .row-label {
    opacity: 0.7;
}
.action-row.completed .row-label strong {
    color: #166534;
    text-decoration: line-through;
}
.action-row.completed .points {
    display: none;
}
.action-row.completed .check-icon {
    display: block !important;
    width: 28px;
    height: 28px;
    color: #16a34a;
}

/* Needs-entry state styling */
.action-row.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    background-color: #fef2f2;
}
@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

.row-icon {
    width: 40px;
    height: 40px;
    background: #333;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    margin-right: 16px;
    flex-shrink: 0;
}
.row-icon svg {
    width: 100%;
    height: 100%;
}
.row-label {
    flex-grow: 1;
}
.row-label strong {
    display: block;
    font-size: 0.95rem;
    color: #1a1a1a;
    text-transform: uppercase;
}
.row-sub {
    font-size: 0.8rem;
    color: #666;
    margin-top: 2px;
}

.row-badge {
    flex-shrink: 0;
    margin-left: 12px;
}
.row-badge .points {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 900;
    line-height: 1;
}
.row-badge .points span {
    font-size: 0.6rem;
    color: #475569;
    font-weight: 700;
    margin-top: 2px;
}

/* Expandable Content */
.row-content {
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}
.content-inner {
    padding: 20px 24px;
}
.content-desc {
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 16px;
}

/* Forms & Inputs */
.input-group {
    margin-bottom: 12px;
}
input[type="text"], input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    color: #0f172a;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(140, 29, 29, 0.1);
}

.error-msg {
    color: #dc2626;
    font-size: 0.85rem;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #fef2f2;
    border-radius: 4px;
    border-left: 3px solid #ef4444;
}

/* Buttons */
.btn {
    display: inline-block;
    width: 100%;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

/* Callout Row */
.callout-row {
    display: flex;
    background: #fff;
    border-top: 2px solid #f1f5f9;
}
.callout-full {
    flex: 1;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}
.callout-full svg {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    color: var(--primary);
}
.callout-full div {
    text-align: left;
}
.callout-full strong {
    font-size: 0.95rem;
    display: block;
    color: #1a1a1a;
}
.callout-full p {
    font-size: 0.8rem;
    margin: 0;
    color: #666;
}

/* Footer */
.card-footer {
    padding: 20px 24px 0;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}
.legal-text {
    font-size: 0.6rem;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
    text-transform: uppercase;
}
.footer-url {
    background: var(--primary);
    color: #fff;
    padding: 12px;
    font-weight: 700;
    margin: 16px -24px 0;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}
.modal-lg {
    max-width: 600px;
}
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #0f172a;
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.modal-body {
    padding: 24px;
    overflow-y: auto;
}
.rules-content {
    font-size: 0.9rem;
    color: #475569;
    white-space: pre-wrap;
}

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

@media (max-width: 600px) {
    .page-wrapper {
        padding: 20px 10px;
    }
    .prize-banner {
        flex-direction: column;
        text-align: center;
    }
    .prize-left {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.3);
        padding-right: 0;
        padding-bottom: 15px;
        flex-direction: column;
    }
}
