@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* 1. GLOBAL SYSTEM LOCK & RESET */
html, body { 
    margin: 0; 
    padding: 0;
    width: 100%;
    height: 100%;
    overscroll-behavior: none; /* Stops the "elastic bounce" gaps */
    overflow: hidden; 
    background-color: #f3f4f6; 
    font-family: 'Inter', sans-serif;
    color: #111827;
}

body { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
    min-height: 100dvh; 
}

/* 2. THE APP CONTAINER - ADAPTIVE DESIGN */
.app-container { 
    width: 100%; 
    max-width: 420px; 
    height: 100%;
    max-height: 850px; 
    background: #ffffff; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    position: relative; 
    border-radius: 32px; 
    border: 8px solid #f3f4f6; 
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1); 
    box-sizing: border-box;
}

/* 3. MOBILE FULLSCREEN OVERRIDE */
@media (max-width: 500px) {
    body {
        background-color: #ffffff !important;
        align-items: flex-start !important;
    }
    .app-container {
        max-width: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        border: none !important;
    }
}

/* 4. MAIN CONTENT AREA (Scrollable) */
.main-content-scroll {
    flex-grow: 1;
    overflow-y: auto;
    padding-bottom: 90px; /* Space for sticky footer */
    -webkit-overflow-scrolling: touch;
}

/* 5. UNIFIED FORM STYLING (The "Quack" Fix) */
.auth-wrapper { 
    padding: 40px 30px; 
    text-align: center; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
}

.form-section-title { 
    text-align: left; 
    font-size: 11px; 
    font-weight: 800; 
    color: #9ca3af; 
    text-transform: uppercase; 
    letter-spacing: 1.5px; 
    margin: 25px 0 10px; 
}

.input-group { margin-bottom: 15px; width: 100%; }

input[type="text"], 
input[type="password"], 
input[type="email"], 
input[type="tel"], 
input[type="number"],
select { 
    width: 100%; 
    padding: 16px; 
    background: #f9fafb; 
    border: 1px solid #e5e7eb; 
    border-radius: 16px; 
    font-size: 16px; 
    font-family: 'Inter', sans-serif; 
    box-sizing: border-box; 
    transition: all 0.3s; 
    display: block;
    color: #111827;
    appearance: none; /* For Select */
}

/* Custom Arrow for the Country Select */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 15px;
}

input:focus, select:focus { 
    outline: none; 
    border-color: #056bfd; 
    background: #ffffff; 
    box-shadow: 0 0 0 4px rgba(5, 107, 253, 0.1);
}

.checkbox-group { 
    display: flex; 
    align-items: flex-start; 
    gap: 12px; 
    text-align: left; 
    margin: 20px 0; 
}

.checkbox-group input { 
    width: 22px !important; 
    height: 22px !important; 
    margin: 0 !important; 
    cursor: pointer; 
}

/* BUTTONS */
.btn-primary { 
    width: 100%; 
    padding: 16px; 
    background: #056bfd; 
    color: white; 
    border: none; 
    border-radius: 20px; 
    font-size: 16px; 
    font-weight: 700; 
    cursor: pointer; 
    transition: background 0.2s; 
}

.btn-primary:hover { background: #0458d1; }
.link-text { margin-top: 25px; font-size: 14px; color: #6b7280; font-weight: 500; }
.link-text a { color: #056bfd; text-decoration: none; font-weight: 700; }

/* 6. DASHBOARD COMPONENTS */
.dash-header { display: flex; justify-content: space-between; padding: 25px 20px 10px; font-weight: 600; font-size: 18px; align-items: center; }
.dash-balance-sec { text-align: center; padding: 20px; }
.dash-balance-sec .total-usd { font-size: 42px; font-weight: 700; margin: 5px 0; letter-spacing: -1px; }

.action-row { display: flex; justify-content: center; gap: 25px; padding: 20px; }
.action-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #056bfd; cursor: pointer; text-decoration: none; }
.action-icon { width: 52px; height: 52px; background: #eff6ff; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 20px; }

/* ASSETS */
.asset-list { 
    background: #f9fafb; 
    border-top-left-radius: 28px; 
    border-top-right-radius: 28px; 
    padding: 20px; 
}

.asset-item { 
    background: white; 
    padding: 15px; 
    border-radius: 18px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    margin-bottom: 12px; 
    cursor: pointer; 
    border: 1px solid transparent; 
    transition: 0.2s;
}
.asset-item:active { transform: scale(0.98); background: #f3f4f6; }

.asset-left { display: flex; align-items: center; gap: 15px; }
.asset-left img { width: 42px; height: 42px; border-radius: 50%; }
.asset-name { font-weight: 700; font-size: 16px; }
.asset-price { font-size: 13px; color: #6b7280; font-weight: 500; }
.asset-right { text-align: right; }
.asset-qty { font-weight: 700; font-size: 15px; }

/* 7. UTILITIES */
.address-box { background: #eff6ff; padding: 14px; border-radius: 14px; margin: 10px auto; font-size: 12px; color: #1e40af; word-break: break-all; text-align: center; font-family: monospace; max-width: 85%; border: 1px dashed #bfdbfe; }
.secret-box { background: #fee2e2; padding: 18px; border-radius: 16px; margin-top: 20px; font-size: 13px; color: #991b1b; border: 1px solid #fecaca; line-height: 1.6; }
.tab-container { display: flex; gap: 12px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 5px; }
.tab-container::-webkit-scrollbar { display: none; }
.tab-item { font-size: 13px; font-weight: 700; color: #6b7280; padding: 8px 18px; background: #f3f4f6; border-radius: 20px; cursor: pointer; white-space: nowrap; }
.tab-item.active { background: #056bfd; color: white; }

/* 8. STICKY FOOTER */
.app-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: #ffffff;
    border-top: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}
.footer-item { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: #9ca3af; text-decoration: none; }
.footer-item.active { color: #056bfd; }
.footer-item i { font-size: 22px; }