/* ============================================
   EarnX5G – Modern, Responsive Styles
   ============================================ */

/* ---------- Reset & Base ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f0f5fe;
    color: #1a2639;
    line-height: 1.6;
    min-height: 100vh;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ---------- Page Wrapper ---------- */
.page-wrapper {
    max-width: 1280px;
    width: 100%;
    flex: 1;
}

/* ---------- Ad Slots ---------- */
.ad-slot {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    padding: 0.75rem;
    margin: 0.5rem 0;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #8a9bb5;
    border: 1px dashed #d0dbe8;
    transition: all 0.2s;
}

.ad-slot-top-left,
.ad-slot-top-right {
    flex: 1 1 48%;
    margin: 0.3rem 0.5rem;
}

.ad-slot-bottom {
    width: 100%;
    margin-top: 2rem;
}

/* Top ad row */
.ad-slot-top-left,
.ad-slot-top-right {
    display: inline-block;
    vertical-align: top;
}

@media (max-width: 768px) {
    .ad-slot-top-left,
    .ad-slot-top-right {
        flex: 1 1 100%;
        margin: 0.3rem 0;
    }
}

/* ---------- Pages (show/hide) ---------- */
.page {
    display: none;
    animation: fadeIn 0.4s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ---------- Container ---------- */
.container {
    width: 100%;
    padding: 1rem 0;
}

/* ---------- Signup / Landing ---------- */
.signup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
    background: white;
    border-radius: 40px;
    padding: 3rem 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 20, 50, 0.08);
    backdrop-filter: blur(2px);
}

@media (max-width: 920px) {
    .signup-grid {
        grid-template-columns: 1fr;
        padding: 2rem 1.5rem;
        gap: 2rem;
    }
}

/* Left brand */
.signup-brand {
    padding-right: 1rem;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #eef6ff;
    color: #1a5cff;
    font-weight: 700;
    font-size: 1.2rem;
    padding: 0.5rem 1.2rem;
    border-radius: 40px;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

.brand-badge i {
    font-size: 1.4rem;
}

.signup-brand h1 {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #0b1a33;
}

.signup-brand h1 span {
    background: linear-gradient(135deg, #1a5cff, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-desc {
    font-size: 1.1rem;
    color: #475569;
    margin-bottom: 2rem;
    max-width: 90%;
}

.brand-stats {
    display: flex;
    gap: 2rem;
    margin-top: 0.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-weight: 700;
    font-size: 1.4rem;
    color: #0b1a33;
}

.stat-label {
    font-size: 0.85rem;
    color: #64748b;
}

/* Right form */
.signup-form-wrapper {
    display: flex;
    justify-content: center;
}

.form-card {
    width: 100%;
    max-width: 440px;
    background: #f9fcff;
    padding: 2rem 2rem 2.2rem;
    border-radius: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
}

.form-card h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: #0b1a33;
}

.form-subtitle {
    color: #64748b;
    margin-bottom: 1.8rem;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
    margin-bottom: 0.3rem;
}

.form-group label i {
    color: #1a5cff;
    width: 1.2rem;
}

.form-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 1rem;
    font-family: inherit;
    transition: border 0.2s, box-shadow 0.2s;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #1a5cff;
    box-shadow: 0 0 0 4px rgba(26, 92, 255, 0.15);
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 3rem;
}

.toggle-pwd {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.2rem;
}

.toggle-pwd:hover {
    color: #1a5cff;
}

.error-msg {
    display: none;
    font-size: 0.8rem;
    color: #dc2626;
    margin-top: 0.3rem;
}

.form-group.error input {
    border-color: #dc2626;
}

.form-group.error .error-msg {
    display: block;
}

.btn-primary {
    background: linear-gradient(135deg, #1a5cff, #7c3aed);
    color: white;
    border: none;
    padding: 0.9rem 1.8rem;
    border-radius: 40px;
    font-weight: 700;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 8px 24px rgba(26, 92, 255, 0.25);
    width: 100%;
    font-family: inherit;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(26, 92, 255, 0.35);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-block {
    width: 100%;
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: #64748b;
}

.form-footer a {
    color: #1a5cff;
    text-decoration: none;
    font-weight: 600;
}

/* ---------- Dashboard (hidden by default, shown via JS) ---------- */
#page-dashboard .container {
    max-width: 1000px;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.dashboard-header h2 {
    font-size: 2rem;
    font-weight: 700;
}

.dashboard-header h2 i {
    color: #1a5cff;
    margin-right: 0.4rem;
}

.user-greeting {
    font-size: 1.1rem;
    color: #475569;
}

.balance-card {
    background: linear-gradient(145deg, #0b1a33, #1a2d4a);
    color: white;
    padding: 2rem 2.5rem;
    border-radius: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 12px 40px rgba(11, 26, 51, 0.2);
}

.balance-label {
    font-weight: 400;
    font-size: 1rem;
    opacity: 0.7;
    letter-spacing: 0.5px;
}

.balance-amount {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.balance-amount small {
    font-size: 1.4rem;
    font-weight: 400;
    opacity: 0.6;
}

.balance-action {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-outline-light {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.7rem 1.6rem;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    backdrop-filter: blur(4px);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.info-card {
    background: white;
    padding: 1.8rem 2rem;
    border-radius: 28px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.03);
    border: 1px solid #edf2f7;
}

.info-card h3 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0b1a33;
    margin-bottom: 0.75rem;
}

.info-card h3 i {
    color: #1a5cff;
}

.info-card p {
    color: #475569;
    margin-bottom: 1rem;
}

.min-withdraw {
    background: #f8fafc;
    padding: 0.8rem 1.2rem;
    border-radius: 20px;
    display: inline-block;
    font-weight: 600;
    color: #0b1a33;
    border-left: 4px solid #1a5cff;
}

.earn-btn-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.btn-earn {
    background: linear-gradient(135deg, #f97316, #f59e0b);
    color: white;
    border: none;
    padding: 1.2rem 2.8rem;
    border-radius: 60px;
    font-weight: 800;
    font-size: 1.4rem;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(249, 115, 22, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
    width: 100%;
    justify-content: center;
}

.btn-earn:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 36px rgba(249, 115, 22, 0.45);
}

.btn-earn:active {
    transform: scale(0.97);
}

/* ---------- Task / Timer Page ---------- */
#page-task .container {
    max-width: 700px;
    margin: 2rem auto;
    text-align: center;
}

.task-card {
    background: white;
    padding: 3rem 2.5rem;
    border-radius: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.06);
}

.task-card h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.task-card p {
    font-size: 1.1rem;
    color: #475569;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.timer-display {
    font-size: 4.5rem;
    font-weight: 800;
    color: #1a5cff;
    background: #eef6ff;
    padding: 1rem 2rem;
    border-radius: 60px;
    display: inline-block;
    margin-bottom: 2rem;
    min-width: 160px;
}

.task-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.btn-continue {
    background: #1a5cff;
    color: white;
    border: none;
    padding: 0.9rem 2.8rem;
    border-radius: 40px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: opacity 0.2s;
    font-family: inherit;
}

.btn-continue:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-continue:not(:disabled):hover {
    opacity: 0.85;
}

.btn-secondary {
    background: #e2e8f0;
    color: #1e293b;
    border: none;
    padding: 0.9rem 2.8rem;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

/* ---------- Utility ---------- */
.hidden {
    display: none !important;
}

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

.mt-2 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.8rem; }

/* ---------- Responsive fine-tune ---------- */
@media (max-width: 500px) {
    .signup-brand h1 {
        font-size: 2rem;
    }
    .balance-amount {
        font-size: 2.2rem;
    }
    .balance-card {
        padding: 1.5rem;
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .balance-action {
        flex-direction: column;
    }
    .task-card {
        padding: 2rem 1.2rem;
    }
    .timer-display {
        font-size: 3rem;
        min-width: 120px;
        padding: 0.6rem 1.2rem;
    }
}