:root {
    --primary: #6F4E37;
    --primary-light: #8B6914;
    --primary-dark: #4A3428;
    --secondary: #D4A574;
    --accent: #C4A77D;
    --success: #4CAF50;
    --danger: #f44336;
    --warning: #FF9800;
    --bg: #FAF7F2;
    --surface: #FFFFFF;
    --text: #2C1810;
    --text-light: #6B5B4F;
    --border: #E8DFD0;
    --shadow: 0 4px 20px rgba(74, 52, 40, 0.08);
    --radius: 16px;
    --radius-sm: 8px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
    --bg: #1a1a2e;
    --surface: #16213e;
    --text: #e0e0e0;
    --text-light: #a0a0b0;
    --border: #2a2a4a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --primary: #c4956a;
    --primary-dark: #a0784c;
}
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    padding-bottom: var(--safe-bottom);
}

/* ============================================ */
/* NAVIGATION */
/* ============================================ */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--surface);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.logo { font-size: 1.5rem; }

.nav-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ============================================ */
/* BUTTONS */
/* ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
    min-height: 44px;
    -webkit-appearance: none;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.97); }

.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }

.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-block { width: 100%; }
.btn-large { padding: 0.875rem 1.5rem; font-size: 1rem; }
.btn-sm { padding: 0.5rem 0.75rem; font-size: 0.8rem; min-height: 36px; }
.btn-icon { padding: 0.5rem; border-radius: 50%; min-width: 44px; min-height: 44px; }

/* ============================================ */
/* HERO */
/* ============================================ */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.hero-content h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    color: var(--primary-dark);
}

.subtitle {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.hero-cta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.phone-mockup {
    background: var(--primary);
    padding: 0.75rem;
    border-radius: 2rem;
    box-shadow: var(--shadow);
    max-width: 260px;
    margin: 0 auto;
}

.phone-screen {
    background: var(--surface);
    border-radius: 1.5rem;
    padding: 1rem;
    text-align: center;
}

.mock-header { font-weight: 700; color: var(--primary); margin-bottom: 0.75rem; font-size: 0.9rem; }

.mock-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1rem;
    border-radius: var(--radius);
}

.mock-stamps {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.stamp { opacity: 0.3; }
.stamp.active { opacity: 1; }

/* ============================================ */
/* FEATURES */
/* ============================================ */
.features {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    text-align: center;
}

.features h2 { font-size: 1.75rem; margin-bottom: 2rem; color: var(--primary-dark); }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.feature-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.feature-card:active { transform: scale(0.98); }

.feature-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }

.feature-card h3 { margin-bottom: 0.5rem; color: var(--primary-dark); font-size: 1.1rem; }

.feature-card p { font-size: 0.9rem; color: var(--text-light); }

/* ============================================ */
/* AUTH PAGES */
/* ============================================ */
.auth-page {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg) 0%, var(--secondary) 100%);
    padding: 1rem;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.auth-header { text-align: center; margin-bottom: 1.5rem; }

.logo-large { font-size: 3rem; display: block; margin-bottom: 0.75rem; }

.auth-header h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }

.auth-header p { font-size: 0.9rem; color: var(--text-light); }

.auth-form { display: flex; flex-direction: column; gap: 1rem; }

.form-group { display: flex; flex-direction: column; gap: 0.375rem; }

.form-group label { font-weight: 600; font-size: 0.85rem; color: var(--text-light); }

.form-group input,
.form-group textarea,
.form-group select {
    padding: 0.75rem 0.875rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.2s;
    width: 100%;
    -webkit-appearance: none;
    min-height: 44px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.auth-footer { text-align: center; margin-top: 1rem; color: var(--text-light); font-size: 0.9rem; }
.auth-footer a { color: var(--primary); font-weight: 600; }

/* ============================================ */
/* DASHBOARD */
/* ============================================ */
.dashboard-page { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    height: -webkit-fill-available;
    z-index: 50;
    transition: transform 0.3s;
}

.sidebar-brand {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
}

.sidebar-nav { flex: 1; padding: 0.5rem 0; overflow-y: auto; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-size: 0.95rem;
}

.nav-item:active,
.nav-item.active {
    background: rgba(111, 78, 55, 0.08);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); }

.shop-info { margin-bottom: 0.75rem; }

.shop-name { font-weight: 700; color: var(--text); font-size: 0.95rem; }
.shop-role { font-size: 0.8rem; color: var(--text-light); }

.main-content { flex: 1; margin-left: 260px; padding: 1rem; min-height: 100vh; }

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    gap: 0.5rem;
    flex-wrap: wrap;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
    padding: 0.25rem;
    min-width: 44px;
    min-height: 44px;
}

/* ============================================ */
/* SECTIONS */
/* ============================================ */
.section { display: none; animation: fadeIn 0.3s; }
.section.active { display: block; }

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

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-icon { font-size: 1.5rem; margin-bottom: 0.375rem; }

.stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); }

.stat-label { color: var(--text-light); font-size: 0.8rem; }

/* Charts */
.charts-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1rem;
}

.chart-card {
    background: var(--surface);
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.chart-card h3 { margin-bottom: 0.75rem; color: var(--primary-dark); font-size: 1.1rem; }

.activity-list { max-height: 250px; overflow-y: auto; }

.activity-item {
    display: flex;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.activity-item:last-child { border-bottom: none; }

/* Tables */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.section-header h3 { font-size: 1.1rem; }

.search-bar { margin-bottom: 0.75rem; }

.search-bar input {
    width: 100%;
    max-width: 100%;
    padding: 0.625rem 0.875rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 0.95rem;
    min-height: 44px;
}

.table-container {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 600px;
}

.data-table th,
.data-table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: rgba(111, 78, 55, 0.05);
    font-weight: 600;
    color: var(--primary-dark);
    white-space: nowrap;
}

/* Broadcast */
.broadcast-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 100%;
}

.broadcast-preview {
    margin: 1rem 0;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.preview-box {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    min-height: 50px;
    font-size: 0.9rem;
}

.history-list { margin-top: 1.5rem; }

.history-item { padding: 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }

/* Settings */
.settings-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 100%;
}

/* ============================================ */
/* MODALS */
/* ============================================ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.modal.hidden { display: none; }

.modal-content {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 400px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-content h3 { margin-bottom: 1rem; font-size: 1.2rem; }

.modal-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; }

.qr-modal { text-align: center; }

/* ============================================ */
/* SCANNER PAGE */
/* ============================================ */
.scanner-page {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    background: var(--bg);
}

.scanner-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 0.75rem;
}

.scanner-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.scanner-header h1 { font-size: 1.25rem; }

.scanner-wrapper {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    aspect-ratio: 1;
    max-height: 70vh;
}

#reader {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

#reader video {
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
}

.scanner-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.scan-frame {
    width: 200px;
    height: 200px;
    border: 3px solid var(--primary);
    border-radius: var(--radius);
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.4);
}

.scanner-overlay p {
    margin-top: 0.75rem;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.scan-result {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-top: 1rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.customer-found h3 { margin-bottom: 0.75rem; color: var(--primary-dark); font-size: 1.2rem; }

.stamp-display {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0.75rem 0;
    color: var(--primary);
}

.stamp-visual {
    display: flex;
    justify-content: center;
    gap: 0.375rem;
    font-size: 1.5rem;
    margin: 0.75rem 0;
    flex-wrap: wrap;
}

.reward-badge {
    background: linear-gradient(135deg, var(--warning), #F57C00);
    color: white;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    margin: 0.75rem 0;
    font-size: 0.95rem;
}

.reward-badge.hidden { display: none; }

.action-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    flex-direction: column;
}

.manual-entry {
    margin-top: 1.5rem;
    text-align: center;
    padding: 1.25rem;
    background: var(--surface);
    border-radius: var(--radius);
}

.manual-entry .form-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-direction: column;
}

/* ============================================ */
/* CUSTOMER PAGE */
/* ============================================ */
.customer-page {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 0.75rem;
}

.customer-container {
    width: 100%;
    max-width: 380px;
}

.loyalty-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1.25rem;
    text-align: center;
}

.card-header h2 { font-size: 1.2rem; }
.card-header p { font-size: 0.85rem; opacity: 0.9; }

.card-body { padding: 1.25rem; }

.customer-info { text-align: center; margin-bottom: 1.25rem; }

.customer-info h3 { color: var(--primary-dark); font-size: 1.3rem; }
.customer-info p { font-size: 0.9rem; color: var(--text-light); }

.qr-section {
    text-align: center;
    margin-bottom: 1.25rem;
    background: #fff;
    padding: 1rem;
    border-radius: var(--radius-sm);
}

.qr-section img,
.qr-section canvas {
    max-width: 180px !important;
    width: 180px !important;
    height: 180px !important;
    margin: 0 auto;
}

.qr-section p {
    margin-top: 0.5rem;
    color: var(--text-light);
    font-size: 0.85rem;
}

.stamps-section { margin-bottom: 1.25rem; }

.stamps-section h4 { margin-bottom: 0.5rem; color: var(--primary-dark); font-size: 0.95rem; }

.stamps-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

.stamp-slot {
    aspect-ratio: 1;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.stamp-slot.filled {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.stamps-text { text-align: center; font-weight: 600; color: var(--text-light); font-size: 0.9rem; }

.rewards-section {
    text-align: center;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
}

.rewards-section h4 { margin-bottom: 0.375rem; color: var(--primary-dark); font-size: 0.95rem; }

.reward-count { font-size: 1.75rem; font-weight: 700; color: var(--success); }

.history-section,
.messages-section {
    margin-bottom: 1rem;
}

.history-section h4,
.messages-section h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
    font-size: 0.95rem;
}

/* ============================================ */
/* TOAST */
/* ============================================ */
.toast {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    padding: 0.875rem 1rem;
    background: var(--danger);
    color: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    z-index: 300;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.toast.success { background: var(--success); }

.toast.hidden { display: none; }

/* ============================================ */
/* FOOTER */
/* ============================================ */
.footer {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--text-light);
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
}

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

.empty { text-align: center; color: var(--text-light); padding: 1.5rem; font-size: 0.9rem; }

.help-text { color: var(--text-light); margin-bottom: 0.75rem; font-size: 0.85rem; }

/* ============================================ */
/* RESPONSIVE - TABLETS */
/* ============================================ */
@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 1.5rem 1rem;
    }
    
    .hero-content h1 { font-size: 1.75rem; }
    
    .hero-cta { justify-content: center; }
    
    .phone-mockup { max-width: 200px; }
    
    .navbar { padding: 0.5rem 0.75rem; }
    
    .nav-links { width: 100%; justify-content: center; }
    
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.open { transform: translateX(0); }
    
    .main-content { margin-left: 0; }
    
    .menu-toggle { display: block; }
    
    .charts-row { grid-template-columns: 1fr; }
    
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    
    .features h2 { font-size: 1.5rem; }
    
    .feature-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================ */
/* RESPONSIVE - MOBILE PHONES */
/* ============================================ */
@media (max-width: 480px) {
    .navbar { flex-direction: column; gap: 0.5rem; }
    
    .nav-links { gap: 0.375rem; }
    
    .nav-links .btn { font-size: 0.75rem; padding: 0.5rem 0.625rem; min-height: 38px; }
    
    .hero-content h1 { font-size: 1.5rem; }
    
    .subtitle { font-size: 0.9rem; }
    
    .hero-cta { flex-direction: column; width: 100%; }
    
    .hero-cta .btn { width: 100%; }
    
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
    
    .stat-card { padding: 1rem; }
    
    .stat-value { font-size: 1.5rem; }
    
    .feature-grid { grid-template-columns: 1fr; }
    
    .auth-card { padding: 1.25rem; }
    
    .auth-header h1 { font-size: 1.3rem; }
    
    .section-header { flex-direction: column; align-items: flex-start; }
    
    .section-header .btn { width: 100%; }
    
    .data-table { font-size: 0.75rem; }
    
    .data-table th, .data-table td { padding: 0.5rem 0.375rem; }
    
    .modal-content { padding: 1.25rem; }
    
    .scanner-container { padding: 0.5rem; }
    
    .scan-frame { width: 160px; height: 160px; }
    
    .stamp-visual { font-size: 1.25rem; gap: 0.25rem; }
    
    .customer-container { max-width: 100%; }
    
    .loyalty-card { border-radius: var(--radius-sm); }
    
    .qr-section img,
    .qr-section canvas {
        max-width: 150px !important;
        width: 150px !important;
        height: 150px !important;
    }
    
    .toast { left: 0.5rem; right: 0.5rem; bottom: 0.5rem; }
}

/* ============================================ */
/* IPHONE SAFE AREA */
/* ============================================ */
@supports (padding: max(0px)) {
    .auth-page,
    .scanner-page,
    .customer-page,
    .dashboard-page {
        padding-bottom: max(1rem, var(--safe-bottom));
    }
    
    .toast {
        bottom: max(1rem, calc(var(--safe-bottom) + 0.5rem));
    }
}
/* ============================================ */
/* HOW IT WORKS SECTION */
/* ============================================ */
.how-it-works {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 2rem 1rem;
    text-align: center;
}

.how-it-works h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.section-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.steps-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Step Cards */
.step-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    width: 240px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(40px);
    position: relative;
    border: 2px solid transparent;
}

.step-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.step-card:nth-child(1) { transition-delay: 0.1s; }
.step-card:nth-child(3) { transition-delay: 0.3s; }
.step-card:nth-child(5) { transition-delay: 0.5s; }
.step-card:nth-child(7) { transition-delay: 0.7s; }

.step-card:hover {
    transform: translateY(-10px) scale(1.03);
    border-color: var(--primary);
    box-shadow: 0 12px 40px rgba(111, 78, 55, 0.2);
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0 auto 1rem;
    transition: all 0.3s;
}

.step-card:hover .step-number {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.step-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    transition: transform 0.3s;
}

.step-card:hover .step-icon {
    transform: scale(1.2);
    animation: bounce 0.5s ease;
}

.step-card h3 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.step-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Animated Arrows */
.step-arrow {
    font-size: 2.5rem;
    color: var(--primary);
    font-weight: 700;
    animation: arrowPulse 1.5s infinite;
    display: flex;
    align-items: center;
}

@keyframes arrowPulse {
    0%, 100% { opacity: 0.3; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(8px); }
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.3); }
    50% { transform: scale(0.9); }
    70% { transform: scale(1.1); }
}

/* ============================================ */
/* RESPONSIVE - HOW IT WORKS */
/* ============================================ */
@media (max-width: 1100px) {
    .steps-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .step-arrow {
        transform: rotate(90deg);
        animation: arrowDown 1.5s infinite;
    }
    
    .step-card {
        width: 100%;
        max-width: 350px;
    }
}

@keyframes arrowDown {
    0%, 100% { opacity: 0.3; transform: rotate(90deg) translateX(0); }
    50% { opacity: 1; transform: rotate(90deg) translateX(8px); }
}

@media (max-width: 480px) {
    .how-it-works h2 { font-size: 1.75rem; }
    .step-card { padding: 1.5rem 1rem; }
    .step-icon { font-size: 2.5rem; }
}
/* ============================================ */
/* 3D ANIMATED STAMPS MOCKUP */
/* ============================================ */
.animated-stamps {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 2.5rem;
    perspective: 500px;
}

.animated-stamps .stamp {
    opacity: 0.15;
    transform: scale(0.7) rotateY(90deg);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-block;
    filter: grayscale(100%) blur(2px);
    text-shadow: 0 0 0 transparent;
}

.animated-stamps .stamp.active {
    opacity: 1;
    transform: scale(1) rotateY(0deg);
    animation: stamp3D 0.7s ease forwards;
    filter: grayscale(0%) blur(0px);
    text-shadow: 0 3px 6px rgba(0,0,0,0.3), 0 0 20px rgba(111, 78, 55, 0.3);
}

@keyframes stamp3D {
    0% { 
        transform: scale(0) rotateY(180deg) rotateX(90deg); 
        opacity: 0;
        text-shadow: 0 0 0 transparent;
    }
    40% { 
        transform: scale(1.4) rotateY(-20deg) rotateX(-10deg); 
        opacity: 1;
    }
    70% { 
        transform: scale(0.9) rotateY(10deg) rotateX(5deg); 
    }
    100% { 
        transform: scale(1) rotateY(0deg) rotateX(0deg); 
        opacity: 1;
        text-shadow: 0 4px 8px rgba(0,0,0,0.3), 0 0 25px rgba(111, 78, 55, 0.4);
    }
}

/* Different colors for each stamp when active */
.animated-stamps .stamp.stamp-1.active { color: #6F4E37; }
.animated-stamps .stamp.stamp-2.active { color: #8B6914; }
.animated-stamps .stamp.stamp-3.active { color: #A0784C; }
.animated-stamps .stamp.stamp-4.active { color: #C4956A; }
.animated-stamps .stamp.stamp-5.active { color: #D4A574; }
.animated-stamps .stamp.stamp-6.active { color: #FFD700; }

/* Golden glow for the 6th stamp */
.animated-stamps .stamp.stamp-6.active {
    animation: stamp3DGold 0.7s ease forwards;
    text-shadow: 0 4px 12px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 215, 0, 0.4);
}

@keyframes stamp3DGold {
    0% { 
        transform: scale(0) rotateY(180deg); 
        opacity: 0;
    }
    40% { 
        transform: scale(1.5) rotateY(-20deg); 
        opacity: 1;
    }
    70% { 
        transform: scale(0.85) rotateY(10deg); 
    }
    100% { 
        transform: scale(1.1) rotateY(0deg); 
        opacity: 1;
    }
}

/* Bounce effect after appearing */
.animated-stamps .stamp.active {
    animation-fill-mode: forwards;
}

/* Floating animation for active stamps */
@keyframes floatStamp {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.animated-stamps .stamp.active:nth-child(odd) {
    animation: stamp3D 0.7s ease forwards, floatStamp 3s ease-in-out infinite;
}

.animated-stamps .stamp.active:nth-child(even) {
    animation: stamp3D 0.7s ease forwards, floatStamp 3s ease-in-out 0.5s infinite;
}

.mock-counter {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    margin-top: 0.75rem;
    letter-spacing: 0.5px;
}

.mock-counter .count {
    color: #FFD700;
    font-size: 1.4rem;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.mock-reward {
    color: #FFD700;
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    margin-top: 0.75rem;
    animation: reward3D 0.6s ease forwards, rewardPulse 0.8s infinite 0.6s;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.mock-reward.hidden {
    display: none;
}

@keyframes reward3D {
    0% { 
        transform: scale(0) rotateX(90deg); 
        opacity: 0; 
    }
    100% { 
        transform: scale(1) rotateX(0deg); 
        opacity: 1; 
    }
}

@keyframes rewardPulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1); 
    }
    50% { 
        opacity: 0.6; 
        transform: scale(1.1); 
    }
}

/* ============================================ */
/* MOBILE RESPONSIVE */
/* ============================================ */
@media (max-width: 768px) {
    .animated-stamps { 
        font-size: 1.8rem; 
        gap: 0.3rem; 
    }
    .mock-counter { font-size: 0.9rem; }
    .mock-counter .count { font-size: 1.1rem; }
    .mock-reward { font-size: 0.9rem; }
}

@media (max-width: 480px) {
    .animated-stamps { 
        font-size: 1.5rem; 
        gap: 0.25rem; 
    }
}
/* ============================================ */
/* PRICING PAGE */
/* ============================================ */
.pricing-page {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem 1rem;
}

.pricing-header {
    text-align: center;
    margin-bottom: 3rem;
}

.pricing-header h1 {
    font-size: 2.5rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.pricing-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    align-items: start;
}

.pricing-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    transition: all 0.3s;
    position: relative;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

.pricing-card.popular {
    border-color: var(--primary);
    transform: scale(1.05);
}

.pricing-card.popular:hover {
    transform: scale(1.05) translateY(-5px);
}

.popular-badge {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    padding: 0.5rem 2rem;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
}

.plan-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.plan-header h3 {
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.plan-price {
    margin: 1rem 0;
}

.currency {
    font-size: 1.2rem;
    vertical-align: top;
    color: var(--text-light);
}

.amount {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary);
}

.period {
    font-size: 1rem;
    color: var(--text-light);
}

.plan-features {
    list-style: none;
    padding: 0;
    margin-bottom: 1.5rem;
}

.plan-features li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.plan-features li:last-child {
    border-bottom: none;
}

/* Payment Modal */
.payment-modal {
    max-width: 500px;
}

.bank-details {
    background: var(--bg);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    margin: 1rem 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--text-light);
}

.detail-value {
    font-weight: 500;
}

.copyable {
    cursor: pointer;
    color: var(--primary);
    text-decoration: underline;
}

.copyable:hover {
    color: var(--primary-dark);
}

.amount-due {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.or-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.or-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.or-divider span {
    background: var(--surface);
    padding: 0 1rem;
    position: relative;
    color: var(--text-light);
}

.upload-section {
    margin: 1.5rem 0;
}

.receipt-preview {
    margin-top: 1rem;
    text-align: center;
}

.receipt-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
}

@media (max-width: 768px) {
    .pricing-header h1 { font-size: 1.75rem; }
    .pricing-card.popular { transform: none; }
    .pricing-card.popular:hover { transform: translateY(-5px); }
}
