/* ================= RESET ================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #06b6d4;
    --accent-color: #7c3aed;

    --page-background: #eef4ff;
    --card-background: #ffffff;
    --soft-blue: #dbeafe;

    --text-dark: #172033;
    --text-light: #64748b;
    --border-color: #e2e8f0;

    --container-width: 540px;

    --small-shadow: 0 5px 15px rgba(37, 99, 235, 0.08);
    --card-shadow: 0 12px 30px rgba(30, 64, 175, 0.14);
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    background: #dce7f8;
    color: var(--text-dark);
    font-family: Arial, Helvetica, sans-serif;
}

button,
a {
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

button {
    border: none;
    outline: none;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}


/* ================= TASK APP ================= */

.task-app {
    width: 100%;
    max-width: var(--container-width);
    min-height: 100vh;
    margin: 0 auto;
    overflow: hidden;
    background:
        linear-gradient(
            180deg,
            #ffffff,
            #eff6ff
        );
}


/* ================= TASK HEADER ================= */

.task-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: 50px 1fr 50px;
    align-items: center;
    min-height: 82px;
    padding: 12px 18px;
    background:
        linear-gradient(
            135deg,
            var(--primary-color),
            var(--secondary-color)
        );
    box-shadow: 0 5px 15px rgba(30, 64, 175, 0.12);
}

.task-header h1 {
    color: #ffffff;
    font-size: 27px;
    font-weight: 800;
    text-align: center;
}

.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 24px;
    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

.back-button:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.92);
}


/* ================= TASK HERO ================= */

.task-hero {
    position: relative;
    min-height: 220px;
    border-radius: 0 0 45px 45px;
    background:
        linear-gradient(
            145deg,
            var(--primary-color),
            var(--secondary-color)
        );
}

.task-hero::before {
    position: absolute;
    top: -130px;
    left: -100px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    content: "";
}

.task-hero::after {
    position: absolute;
    right: -100px;
    bottom: -130px;
    width: 290px;
    height: 290px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    content: "";
}


/* ================= TASK SUMMARY ================= */

.task-summary-card {
    position: absolute;
    right: 18px;
    bottom: -55px;
    left: 18px;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 145px;
    padding: 25px 20px;
    border: 1px solid rgba(37, 99, 235, 0.1);
    border-radius: 20px;
    background:
        linear-gradient(
            145deg,
            #ffffff,
            #dbeafe 55%,
            #cffafe
        );
    box-shadow: var(--card-shadow);
}

.summary-item {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-direction: column;
}

.summary-item strong {
    color: var(--text-dark);
    font-size: 24px;
    font-weight: 800;
}

.summary-item span {
    margin-top: 5px;
    color: var(--text-light);
    font-size: 14px;
    font-weight: 700;
}

.summary-divider {
    width: 2px;
    height: 45px;
    margin: 0 20px;
    border-radius: 5px;
    background: rgba(100, 116, 139, 0.35);
}


/* ================= TASK MAIN ================= */

.task-main {
    padding: 90px 18px 40px;
}

.task-list {
    display: flex;
    gap: 20px;
    flex-direction: column;
}


/* ================= TASK CARD ================= */

.task-card {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) auto;
    align-items: center;
    gap: 15px;
    min-height: 120px;
    padding: 20px;
    border: 1px solid rgba(37, 99, 235, 0.07);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: var(--small-shadow);
}

.task-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border: 4px solid rgba(255, 255, 255, 0.75);
    border-radius: 50%;
    color: #ffffff;
    font-size: 25px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.invite-icon {
    background:
        linear-gradient(
            135deg,
            var(--primary-color),
            #60a5fa
        );
}

.active-user-icon {
    background:
        linear-gradient(
            135deg,
            var(--secondary-color),
            #22d3ee
        );
}

.team-icon {
    background:
        linear-gradient(
            135deg,
            var(--accent-color),
            var(--primary-color)
        );
}


/* ================= TASK INFORMATION ================= */

.task-information {
    min-width: 0;
}

.task-information h2 {
    color: var(--text-dark);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.35;
}

.task-reward {
    display: block;
    margin-top: 4px;
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 800;
}


/* ================= TASK BUTTONS ================= */

.task-action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    min-height: 47px;
    padding: 9px 17px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 800;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.go-button {
    background:
        linear-gradient(
            135deg,
            var(--primary-color),
            var(--secondary-color)
        );
    color: #ffffff;
    box-shadow: 0 7px 16px rgba(37, 99, 235, 0.23);
}

.go-button:active {
    transform: scale(0.93);
}

.progress-button {
    min-width: 105px;
    background: #e2e8f0;
    color: #94a3b8;
}

.progress-button:disabled {
    cursor: not-allowed;
}


/* ================= RESPONSIVE ================= */

@media (min-width: 600px) {
    .task-app {
        box-shadow: 0 0 40px rgba(15, 23, 42, 0.15);
    }
}

@media (max-width: 440px) {
    .task-header {
        min-height: 74px;
        padding-right: 13px;
        padding-left: 13px;
    }

    .task-header h1 {
        font-size: 24px;
    }

    .task-hero {
        min-height: 205px;
    }

    .task-summary-card {
        right: 13px;
        left: 13px;
        min-height: 135px;
        padding-right: 12px;
        padding-left: 12px;
    }

    .summary-item strong {
        font-size: 21px;
    }

    .summary-item span {
        font-size: 12px;
    }

    .summary-divider {
        margin-right: 11px;
        margin-left: 11px;
    }

    .task-main {
        padding-right: 13px;
        padding-left: 13px;
    }

    .task-card {
        grid-template-columns: 58px minmax(0, 1fr) auto;
        gap: 10px;
        min-height: 110px;
        padding: 16px 13px;
    }

    .task-icon {
        width: 54px;
        height: 54px;
        font-size: 21px;
    }

    .task-information h2 {
        font-size: 14px;
    }

    .task-reward {
        font-size: 14px;
    }

    .task-action-button {
        min-width: 65px;
        min-height: 43px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .progress-button {
        min-width: 82px;
    }
}

@media (max-width: 350px) {
    .task-card {
        grid-template-columns: 48px minmax(0, 1fr) auto;
        padding-right: 9px;
        padding-left: 9px;
    }

    .task-icon {
        width: 45px;
        height: 45px;
        border-width: 3px;
        font-size: 17px;
    }

    .task-information h2 {
        font-size: 12px;
    }

    .task-action-button {
        min-width: 55px;
        padding-right: 8px;
        padding-left: 8px;
    }
}

/* =========================================
   FUNCTIONAL TASK STATES
========================================= */

.task-live-progress {
    margin: 6px 0 0;
    color: #7c8d93;
    font-size: 11px;
    font-weight: 600;
}

.task-progress-track {
    width: 100%;
    height: 6px;
    margin-top: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #e3eef1;
}

.task-progress-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #16c8df, #087d9f);
    transition: width 0.35s ease;
}

.task-action-button.claimable {
    border-color: transparent;
    background: linear-gradient(135deg, #14c8df, #087d9f);
    color: #ffffff;
    cursor: pointer;
    opacity: 1;
    box-shadow: 0 7px 17px rgba(8, 137, 165, 0.2);
}

.task-action-button.claimed,
.task-action-button.claimed:disabled {
    background: #e1f8ef;
    color: #079b70;
    opacity: 1;
}

.task-action-button.go-button:not(:disabled) {
    cursor: pointer;
}

.task-page-toast {
    position: fixed;
    left: 50%;
    bottom: 95px;
    z-index: 99999;
    max-width: calc(100% - 35px);
    padding: 12px 18px;
    border-radius: 13px;
    background: #153842;
    color: #ffffff;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(0, 34, 45, 0.25);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 20px);
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

.task-page-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}




/* =========================================
   TASK REWARD WALLET SELECTION
   APPEND THIS BLOCK TO THE END OF task.css
========================================= */

body.task-modal-open {
    overflow: hidden;
}

.task-claim-modal[hidden] {
    display: none !important;
}

.task-claim-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(15, 23, 42, 0.58);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
}

.task-claim-sheet {
    width: min(100%, 470px);
    max-height: calc(100vh - 44px);
    max-height: calc(100dvh - 44px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 24px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 26px;
    background: #ffffff;
    box-shadow: 0 28px 75px rgba(15, 23, 42, 0.3);
    animation: task-claim-sheet-in 0.24s ease-out both;
}

.task-claim-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.task-claim-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.task-claim-title {
    color: var(--text-dark);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
}

.task-claim-close {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: #f8fafc;
    color: #475569;
    font-size: 25px;
    font-weight: 400;
    line-height: 1;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.task-claim-close:hover:not(:disabled) {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: var(--primary-color);
}

.task-claim-close:active:not(:disabled) {
    transform: scale(0.92);
}

.task-claim-task-title {
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.45;
}

.task-claim-instruction {
    margin-top: 13px;
    color: var(--text-light);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.55;
}

.task-wallet-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 19px;
}

.task-wallet-choice {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    min-height: 86px;
    padding: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 18px;
    background: #ffffff;
    color: var(--text-dark);
    text-align: left;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.task-wallet-choice:hover:not(:disabled) {
    border-color: #60a5fa;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.14);
    transform: translateY(-2px);
}

.task-wallet-choice:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.task-wallet-choice-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    color: #ffffff;
    font-size: 21px;
    font-weight: 900;
}

.task-wallet-choice-icon.inr {
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.task-wallet-choice-icon.usdt {
    background: linear-gradient(135deg, #0f9f78, #26a17b);
    box-shadow: 0 8px 18px rgba(38, 161, 123, 0.22);
}

.task-wallet-choice-label,
.task-wallet-choice-amount {
    display: block;
}

.task-wallet-choice-label {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.3;
}

.task-wallet-choice-amount {
    margin-top: 4px;
    color: var(--text-light);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.task-conversion-note {
    margin-top: 15px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
}

.task-claim-cancel {
    width: 100%;
    min-height: 46px;
    margin-top: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    color: #475569;
    font-size: 14px;
    font-weight: 800;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.task-claim-cancel:hover:not(:disabled) {
    background: #eef2f7;
    color: var(--text-dark);
}

.task-claim-cancel:active:not(:disabled) {
    transform: scale(0.98);
}

.task-claim-sheet button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.25);
    outline-offset: 3px;
}

.task-claim-sheet button:disabled {
    cursor: wait;
    opacity: 0.62;
}

.task-card.is-complete:not(.is-claimed) {
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.13);
}

.task-card.is-claimed {
    border-color: rgba(5, 150, 105, 0.22);
    background: linear-gradient(145deg, #ffffff, #f0fdf7);
}

.task-card.is-claimed .task-progress-fill {
    background: linear-gradient(90deg, #10b981, #059669);
}

.task-action-button[aria-busy="true"]::after {
    width: 13px;
    height: 13px;
    margin-left: 7px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    content: "";
    animation: task-loading-spin 0.7s linear infinite;
}

.task-page-toast.success {
    background: #047857;
}

.task-page-toast.error {
    background: #b91c1c;
}

@keyframes task-claim-sheet-in {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes task-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 520px) {
    .task-claim-modal {
        align-items: flex-end;
        padding: 0;
    }

    .task-claim-sheet {
        width: 100%;
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 26px 26px 0 0;
        animation-name: task-claim-sheet-mobile-in;
    }
}

@media (max-width: 390px) {
    .task-wallet-choices {
        grid-template-columns: 1fr;
    }

    .task-wallet-choice {
        min-height: 74px;
    }
}

@keyframes task-claim-sheet-mobile-in {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .task-claim-sheet,
    .task-action-button[aria-busy="true"]::after {
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
    }

    .task-wallet-choice,
    .task-claim-close,
    .task-claim-cancel {
        transition: none;
    }
}
