* {
    box-sizing: border-box;
}

:root {
    --primary: #1ecb9c;
    --primary-dark: #16a085;
    --bg-primary: #0a0e1a;
    --bg-secondary: #111522;
    --bg-card: #1a1f2e;
    --bg-input: #1f2430;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --border-radius: 16px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.4);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-bonus: linear-gradient(135deg, #f093fb 0%, #f5576c 50%, #4facfe 100%);
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--bg-primary);
    background-image: 
        radial-gradient(at 0% 0%, rgba(30, 203, 156, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(102, 126, 234, 0.1) 0px, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    padding: 20px;
    padding-bottom: 100px;
    max-width: 600px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease-in;
}

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

/* HEADER */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 4px;
}

header h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.refresh-btn {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.refresh-btn:hover {
    background: var(--bg-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.refresh-btn:active {
    transform: translateY(0) scale(0.95);
}

.refresh-icon {
    font-size: 20px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.refresh-btn:active .refresh-icon {
    transform: rotate(180deg);
}

/* PAGES */
.page {
    display: none;
    animation: slideOut 0.3s ease-out;
}

.page.active {
    display: block;
    animation: slideIn 0.3s ease-in;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

.page-header {
    margin-bottom: 24px;
    padding: 0 4px;
}

.page-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

/* BONUS CARD */
.bonus-card {
    background: var(--gradient-bonus);
    padding: 32px 24px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.bonus-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(180deg);
    }
}

.bonus-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
    animation: pulse 2s infinite;
}

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

.bonus-title {
    font-size: 16px;
    opacity: 0.9;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bonus-value {
    font-size: 64px;
    font-weight: 800;
    margin: 8px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.bonus-value:hover {
    transform: scale(1.05);
}

.bonus-subtitle {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 4px;
}

.info-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 15px;
}

.info-icon {
    font-size: 24px;
}

/* PRODUCTS */
.products {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-item {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.product-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(30, 203, 156, 0.3);
}

.product-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.product-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.product-img {
    width: 100%;
    border-radius: 12px;
    margin-top: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.product-img:hover {
    transform: scale(1.02);
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 16px;
}

/* PROFILE */
.profile-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.field {
    margin-bottom: 20px;
}

.field label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.field-icon {
    font-size: 18px;
}

.field input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.field input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 4px rgba(30, 203, 156, 0.1);
}

.field input::placeholder {
    color: var(--text-muted);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    margin-top: 8px;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    font-family: inherit;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 20px;
}

.registered-status {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, rgba(30, 203, 156, 0.2) 0%, rgba(102, 126, 234, 0.2) 100%);
    border: 2px solid var(--primary);
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    margin-top: 8px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(30, 203, 156, 0.3);
    animation: fadeIn 0.3s ease-in;
}

.status-icon {
    font-size: 20px;
}

.status-text {
    color: var(--primary);
}

/* BOTTOM NAV */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 18, 27, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    font-family: inherit;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 40px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
    transition: transform 0.3s ease;
}

.nav-item.active::before {
    transform: translateX(-50%) scaleX(1);
}

.nav-icon {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active .nav-icon {
    transform: scale(1.2);
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-label {
    font-weight: 500;
}

/* TOAST */
#toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 16px 24px;
    background: var(--gradient-primary);
    color: var(--text-primary);
    border-radius: 12px;
    display: none;
    box-shadow: var(--shadow-lg);
    font-weight: 500;
    z-index: 2000;
    animation: toastSlideIn 0.3s ease-out forwards;
    max-width: 90%;
    text-align: center;
}

#toast.show {
    display: block;
    animation: toastSlideIn 0.3s ease-out forwards;
}

#toast.error {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* RESPONSIVE */
@media (max-width: 480px) {
    #app {
        padding: 16px;
    }

    header h1 {
        font-size: 20px;
    }

    .bonus-value {
        font-size: 56px;
    }

    .page-header h2 {
        font-size: 24px;
    }

    .nav-label {
        font-size: 12px;
    }

    .nav-icon {
        font-size: 22px;
    }
}

/* SMOOTH SCROLLING */
html {
    scroll-behavior: smooth;
}

/* SELECTION */
::selection {
    background: var(--primary);
    color: var(--text-primary);
}
