:root {
    --primary: #1B5E3B;
    --primary-dark: #14472E;
    --primary-light: #2E7D52;
    --accent: #C41E3A;
    --accent-light: #E8304F;
    --white: #FFFFFF;
    --gold: #D4AF37;
    --bg-light: #F0F4F1;
    --text-muted: #8FA89A;
    --shadow: rgba(0,0,0,0.2);
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--primary);
    color: var(--white);
    min-height: 100vh;
    overflow-x: hidden;
}

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
}

.auth-card {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 40px 32px;
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.5s ease;
}

.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo img {
    width: 120px;
    height: auto;
}

.auth-tabs {
    display: flex;
    margin-bottom: 24px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 4px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
}

.auth-tab.active {
    background: var(--primary-light);
    color: var(--white);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.08);
    color: var(--white);
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}

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

.form-group input:focus, .form-group select:focus {
    border-color: var(--accent);
}

.form-group select option {
    background: var(--primary-dark);
    color: var(--white);
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.15);
}

.btn-success {
    background: #27AE60;
    color: var(--white);
}

.btn-danger {
    background: var(--accent);
    color: var(--white);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), #B8941F);
    color: var(--primary-dark);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    width: auto;
}

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

.app-container {
    display: none;
    min-height: 100vh;
    padding-bottom: 80px;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
    padding: 16px;
}

.page.active {
    display: block;
}

.header-carousel {
    position: relative;
    width: 100%;
    height: 200px;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.carousel-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease;
}

.carousel-image.active {
    opacity: 1;
}

.header-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    z-index: 2;
}

.header-overlay h2 {
    font-size: 20px;
    font-weight: 700;
}

.header-overlay p {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
}

.balance-card {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.balance-row:last-child {
    margin-bottom: 0;
}

.balance-label {
    font-size: 13px;
    color: var(--text-muted);
}

.balance-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gold);
}

.balance-value.small {
    font-size: 16px;
}

.bonus-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.bonus-badge.locked {
    background: rgba(196,30,58,0.2);
    color: var(--accent-light);
}

.bonus-badge.unlocked {
    background: rgba(212,175,55,0.2);
    color: var(--gold);
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.quick-action-btn {
    padding: 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.quick-action-btn.deposit {
    background: rgba(39,174,96,0.2);
    color: #27AE60;
    border: 1px solid rgba(39,174,96,0.3);
}

.quick-action-btn.withdraw {
    background: rgba(196,30,58,0.2);
    color: var(--accent-light);
    border: 1px solid rgba(196,30,58,0.3);
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.package-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.package-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.package-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.package-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.package-info {
    padding: 16px;
}

.package-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.package-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 8px;
}

.package-profit {
    font-size: 14px;
    color: #27AE60;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.package-profit strong {
    font-size: 16px;
}

.package-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.package-btn:hover {
    background: var(--accent-light);
}

.package-btn:disabled {
    background: rgba(255,255,255,0.1);
    cursor: not-allowed;
}

.deposit-page, .withdraw-page, .team-page, .profile-page {
    padding-bottom: 20px;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
}

.info-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.info-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--gold);
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

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

.info-label {
    font-size: 13px;
    color: var(--text-muted);
}

.info-value {
    font-size: 14px;
    font-weight: 500;
    font-family: 'Courier New', monospace;
}

.copy-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background: var(--accent);
    color: var(--white);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--accent-light);
}

.copy-btn.copied {
    background: #27AE60;
}

.deposit-notice {
    background: rgba(196,30,58,0.15);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 16px;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    animation: pulse 2s infinite;
}

.crypto-rate-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 13px;
}

.crypto-rate-table th, .crypto-rate-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.crypto-rate-table th {
    color: var(--text-muted);
    font-weight: 500;
}

.file-upload-area {
    border: 2px dashed rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s;
    margin-bottom: 16px;
}

.file-upload-area:hover {
    border-color: var(--accent);
}

.file-upload-area input[type="file"] {
    display: none;
}

.file-upload-area .upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.file-upload-area p {
    font-size: 14px;
    color: var(--text-muted);
}

.file-upload-area .filename {
    color: var(--gold);
    font-weight: 600;
    margin-top: 8px;
}

.withdraw-preview {
    background: rgba(196,30,58,0.1);
    border: 1px solid rgba(196,30,58,0.3);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
}

.withdraw-preview .row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.withdraw-preview .row:last-child {
    margin-bottom: 0;
}

.withdraw-preview .net {
    font-size: 18px;
    font-weight: 700;
    color: var(--gold);
}

.team-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.team-stat {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}

.team-stat .number {
    font-size: 28px;
    font-weight: 700;
    color: var(--gold);
}

.team-stat .label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.referral-link-box {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.referral-link-box input {
    flex: 1;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    background: rgba(0,0,0,0.2);
    color: var(--gold);
    font-size: 13px;
    font-family: monospace;
}

.team-member {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team-member-info h4 {
    font-size: 15px;
    font-weight: 600;
}

.team-member-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(39,174,96,0.2);
    color: #27AE60;
}

.status-badge.inactive {
    background: rgba(255,255,255,0.1);
    color: var(--text-muted);
}

.profile-header {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    margin: 0 auto 12px;
    border: 3px solid var(--gold);
}

.profile-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.profile-header p {
    font-size: 13px;
    color: var(--text-muted);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.profile-stat {
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
}

.profile-stat .value {
    font-size: 16px;
    font-weight: 700;
    color: var(--gold);
}

.profile-stat .label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

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

.transaction-info h4 {
    font-size: 14px;
    font-weight: 500;
}

.transaction-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.transaction-amount {
    font-size: 15px;
    font-weight: 700;
}

.transaction-amount.positive {
    color: #27AE60;
}

.transaction-amount.negative {
    color: var(--accent-light);
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary-dark);
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: color 0.3s;
}

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

.nav-item .icon {
    font-size: 20px;
}

.whatsapp-fab {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37,211,102,0.4);
    z-index: 99;
    cursor: pointer;
    transition: transform 0.3s;
    text-decoration: none;
    animation: bounceIn 1s ease;
}

.whatsapp-fab:hover {
    transform: scale(1.1);
}

.whatsapp-fab svg {
    width: 30px;
    height: 30px;
    fill: white;
}

.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    z-index: 200;
    animation: slideDown 0.3s ease;
}

.toast.success {
    background: #27AE60;
    color: var(--white);
}

.toast.error {
    background: var(--accent);
    color: var(--white);
}

.toast.info {
    background: var(--primary-light);
    color: var(--white);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 150;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--primary-dark);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    padding: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 0.8s linear infinite;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.investment-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 10px;
}

.investment-card h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}

.investment-detail {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 4px;
}

.investment-detail .label {
    color: var(--text-muted);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideDown {
    from { transform: translate(-50%, -20px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

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

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

@media (min-width: 600px) {
    .package-grid {
        grid-template-columns: 1fr 1fr;
    }
    .auth-card {
        padding: 48px 40px;
    }
}

@media (min-width: 900px) {
    .package-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}
