:root {
    --primary: #6366F1;
    --primary-hover: #5558E6;
    --primary-bg: #EEF2FF;
    --primary-border: #C7D2FE;
    --success: #10B981;
    --success-bg: #ECFDF5;
    --success-border: #A7F3D0;
    --success-text: #065F46;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    min-height: 100dvh;
}

.page-wrapper {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: white;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 17px;
    color: var(--gray-900);
    letter-spacing: -0.01em;
}

.header-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: var(--success-text);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* Main */
.main {
    flex: 1;
    padding: 0 20px;
}

/* Hero */
.hero {
    text-align: center;
    padding: 28px 0 24px;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 20px;
}

.hero-tag-icon {
    color: var(--primary);
    font-size: 11px;
}

.hero-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 32px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--gray-900);
    margin-bottom: 12px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 15px;
    color: var(--gray-500);
    line-height: 1.6;
    max-width: 320px;
    margin: 0 auto 28px;
}

/* Gift Card */
.card-visual {
    perspective: 800px;
    margin-bottom: 28px;
}

.card-3d {
    transform: rotateX(8deg) rotateY(-4deg);
    transition: transform 0.4s ease;
}

.card-visual:hover .card-3d {
    transform: rotateX(2deg) rotateY(-1deg);
}

.card-face {
    position: relative;
    background: linear-gradient(145deg, #1E1B4B 0%, #312E81 40%, #4338CA 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    overflow: hidden;
    aspect-ratio: 1.6 / 1;
    max-width: 320px;
    margin: 0 auto;
    box-shadow: 
        0 20px 40px rgba(99, 102, 241, 0.25),
        0 0 0 1px rgba(255,255,255,0.1) inset;
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
}

.card-brand {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.6);
}

.card-type {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.1);
    padding: 3px 8px;
    border-radius: 4px;
}

.card-amount {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 52px;
    font-weight: 800;
    color: white;
    text-align: center;
    margin: 16px 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: relative;
    letter-spacing: -0.02em;
}

.card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    position: relative;
}

.card-dots {
    display: flex;
    gap: 6px;
}

.card-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
}

.card-dots span:first-child {
    background: rgba(255,255,255,0.5);
}

.card-label {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.5px;
}

/* Stats Row */
.stats-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.stat {
    flex: 1;
    text-align: center;
}

.stat-value {
    display: block;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--gray-400);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-divider {
    width: 1px;
    height: 32px;
    background: var(--gray-200);
}

/* Progress */
.progress-section {
    margin-bottom: 8px;
}

.progress-track {
    height: 6px;
    background: var(--gray-200);
    border-radius: 100px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #8B5CF6);
    border-radius: 100px;
    transition: width 1s ease;
}

/* Email Section */
.email-section {
    padding: 0 0 28px;
}

.email-container {
    background: linear-gradient(135deg, var(--primary-bg) 0%, #F5F3FF 100%);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-xl);
    padding: 24px;
}

.email-header {
    text-align: center;
    margin-bottom: 20px;
}

.email-header h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.email-header p {
    font-size: 14px;
    color: var(--gray-500);
}

.email-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.email-input-wrapper {
    display: flex;
    background: white;
    border: 2px solid var(--primary-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.email-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.email-input-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 16px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    color: var(--gray-900);
    background: transparent;
    min-width: 0;
}

.email-input-wrapper input::placeholder {
    color: var(--gray-400);
}

.email-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    position: relative;
}

.email-submit:hover {
    background: var(--primary-hover);
}

.email-submit:active {
    transform: scale(0.98);
}

.email-btn-arrow {
    flex-shrink: 0;
}

.btn-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.email-meta {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.email-trust {
    font-size: 12px;
    color: var(--gray-500);
}

/* Tasks Section */
.tasks-section {
    padding: 0 0 28px;
}

.entries-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--success-bg) 0%, #D1FAE5 100%);
    border: 1.5px solid var(--success-border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
}

.entries-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--success-text);
}

.entries-hint {
    display: block;
    font-size: 12px;
    color: #047857;
    opacity: 0.7;
    margin-top: 1px;
}

.entries-value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 36px;
    font-weight: 800;
    color: var(--success-text);
    line-height: 1;
    transition: transform 0.2s ease;
}

.entries-value.bump {
    animation: bump 0.3s ease;
}

@keyframes bump {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.tasks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.tasks-header h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
}

.tasks-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-bg);
    padding: 4px 10px;
    border-radius: 100px;
}

/* Task Grid */
.task-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: white;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-user-select: none;
    user-select: none;
}

.task-card:hover {
    border-color: var(--primary-border);
    background: var(--primary-bg);
}

.task-card:active {
    transform: scale(0.98);
}

.task-card.completed {
    opacity: 0.5;
    pointer-events: none;
    background: var(--gray-50);
}

.task-card.completed .task-action svg {
    display: none;
}

.task-card.completed .task-action::after {
    content: '✓';
    color: var(--success);
    font-weight: 700;
    font-size: 16px;
}

.task-icon-wrap {
    width: 44px;
    height: 44px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.task-card:hover .task-icon-wrap {
    background: white;
}

.task-info {
    flex: 1;
    min-width: 0;
}

.task-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.task-info p {
    font-size: 12px;
    color: var(--gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.task-time {
    font-size: 11px;
    color: var(--gray-400);
}

.task-reward {
    font-size: 12px;
    font-weight: 700;
    color: var(--success-text);
    background: var(--success-bg);
    padding: 2px 8px;
    border-radius: 100px;
}

.task-action {
    color: var(--gray-400);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.task-card:hover .task-action {
    color: var(--primary);
}

/* Offerwall Frame */
.offerwall-frame {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 500px;
    background: var(--gray-50);
}

.frame-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.frame-loading p {
    font-size: 14px;
    color: var(--gray-400);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* How It Works */
.how-section {
    padding: 28px 0;
    border-top: 1px solid var(--gray-200);
}

.section-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    color: var(--gray-900);
}

.how-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.how-card {
    text-align: center;
    padding: 16px 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.how-step {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    opacity: 0.3;
    margin-bottom: 8px;
}

.how-card h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.how-card p {
    font-size: 11px;
    color: var(--gray-400);
    line-height: 1.4;
}

/* Trust Bar */
.trust-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
    border-top: 1px solid var(--gray-200);
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-500);
}

/* Footer */
.footer {
    padding: 20px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    margin-top: auto;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.footer-inner span {
    font-size: 13px;
    color: var(--gray-400);
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    font-size: 13px;
    color: var(--gray-500);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--gray-900);
}

.footer-legal {
    font-size: 11px;
    color: var(--gray-400);
    line-height: 1.5;
    text-align: center;
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    background: var(--gray-900);
    color: white;
    padding: 12px 20px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast-icon {
    font-size: 16px;
}

/* Mobile - Small screens */
@media (max-width: 380px) {
    .hero-title {
        font-size: 28px;
    }
    
    .card-amount {
        font-size: 44px;
    }
    
    .card-face {
        padding: 20px;
    }
    
    .stats-row {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .how-grid {
        gap: 8px;
    }
    
    .how-card {
        padding: 12px 8px;
    }
    
    .how-card h3 {
        font-size: 12px;
    }
    
    .how-card p {
        font-size: 10px;
    }
    
    .email-container {
        padding: 20px 16px;
    }
    
    .email-submit {
        padding: 14px 14px;
    }
    
    .email-btn-text {
        display: none;
    }
    
    .email-submit svg {
        margin: 0;
    }
    
    .task-card {
        padding: 12px 14px;
        gap: 10px;
    }
    
    .task-icon-wrap {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    
    .task-info p {
        display: none;
    }
    
    .trust-bar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }
}

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
    .footer {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
    
    .toast {
        top: calc(20px + env(safe-area-inset-top));
    }
}

/* Hover only on devices that support it */
@media (hover: hover) {
    .task-card:hover {
        border-color: var(--primary-border);
        background: var(--primary-bg);
    }
    
    .task-card:hover .task-icon-wrap {
        background: white;
    }
    
    .task-card:hover .task-action {
        color: var(--primary);
    }
}

/* Dark mode preference (optional enhancement) */
@media (prefers-color-scheme: dark) {
    /* Keep light theme for consistency/trust */
}

/* ===================== DESKTOP STYLES ===================== */
@media (min-width: 481px) {
    .page-wrapper {
        max-width: 520px;
        margin: 0 auto;
        box-shadow: 0 0 60px rgba(0,0,0,0.08);
        min-height: 100vh;
    }
    
    .hero {
        padding: 36px 0 28px;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .hero-desc {
        font-size: 16px;
    }
    
    .card-face {
        max-width: 340px;
        padding: 28px;
    }
    
    .card-amount {
        font-size: 56px;
    }
    
    .stats-row {
        padding: 20px 24px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .email-container {
        padding: 28px;
    }
    
    .email-header h2 {
        font-size: 20px;
    }
    
    .email-input-wrapper input {
        padding: 16px 20px;
        font-size: 16px;
    }
    
    .email-submit {
        padding: 16px 24px;
    }
    
    .tasks-header h2 {
        font-size: 20px;
    }
    
    .task-card {
        padding: 16px 18px;
        gap: 16px;
    }
    
    .task-icon-wrap {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
    
    .task-info h4 {
        font-size: 15px;
    }
    
    .task-info p {
        font-size: 13px;
    }
    
    .how-section {
        padding: 32px 0;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .how-card {
        padding: 20px 16px;
    }
    
    .how-step {
        font-size: 22px;
    }
    
    .how-card h3 {
        font-size: 14px;
    }
    
    .how-card p {
        font-size: 12px;
    }
    
    .trust-bar {
        gap: 24px;
    }
    
    .trust-item {
        font-size: 13px;
    }
}

/* Large desktop - center nicely */
@media (min-width: 768px) {
    body {
        background: #F3F4F6;
    }
    
    .page-wrapper {
        margin-top: 40px;
        margin-bottom: 40px;
        border-radius: 24px;
        overflow: hidden;
        min-height: auto;
        box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    }
    
    .header {
        border-radius: 24px 24px 0 0;
    }
    
    .footer {
        border-radius: 0 0 24px 24px;
    }
}