:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #101828;
    --muted: #667085;
    --border: #e6eaf2;
    --primary: #4f46e5;
    --ring: rgba(79, 70, 229, 0.18);
    --selesai: #0d9488;
    --sedang: #d97706;
    --bahaya: #e11d48;
    --radius: 18px;
    --shadow: 0 18px 45px -24px rgba(16, 24, 40, 0.35);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 10% -12%, rgba(79, 70, 229, 0.16), transparent 55%),
        radial-gradient(circle at 92% -4%, rgba(13, 148, 136, 0.14), transparent 50%);
    background-repeat: no-repeat;
    -webkit-font-smoothing: antialiased;
}

.page {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    padding: 40px 18px 64px;
}

/* ---------- Hero ---------- */
.hero {
    margin-bottom: 4px;
}

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.hero__eyebrow svg {
    width: 14px;
    height: 14px;
}

.hero h1 {
    margin: 14px 0 8px;
    font-size: clamp(1.75rem, 4.6vw, 2.4rem);
    line-height: 1.14;
    letter-spacing: -0.025em;
    font-weight: 800;
}

.hero p {
    margin: 0;
    max-width: 54ch;
    color: var(--muted);
    font-size: 0.97rem;
}

/* ---------- Statistik ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.stat {
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 10px 22px -20px rgba(16, 24, 40, 0.5);
}

.stat__value {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--primary);
}

.stat--belum .stat__value {
    color: var(--sedang);
}

.stat--selesai .stat__value {
    color: var(--selesai);
}

.stat__label {
    margin-top: 2px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- Kartu utama ---------- */
.card {
    margin-top: 20px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ---------- Notifikasi ---------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 16px;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin-top: 1px;
}

.alert--success {
    color: #0f766e;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.alert--error {
    color: #b91c1c;
    background: #fef2f2;
    border-color: #fecaca;
}

/* ---------- Formulir ---------- */
.task-form {
    display: grid;
    gap: 12px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.field label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--muted);
}

.control {
    width: 100%;
    padding: 12px 14px;
    font: inherit;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.control::placeholder {
    color: #98a2b3;
}

.control:hover {
    border-color: #d3daea;
}

.control:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--ring);
}

select.control {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
    cursor: pointer;
}

/* ---------- Tombol ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: inherit;
    font-weight: 700;
    font-size: 0.94rem;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn svg {
    width: 17px;
    height: 17px;
}

.btn--primary {
    padding: 13px 22px;
    color: #ffffff;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 14px 26px -16px rgba(79, 70, 229, 0.95);
}

.btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 30px -16px rgba(79, 70, 229, 0.95);
}

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

.btn--ghost {
    width: 36px;
    height: 36px;
    padding: 0;
    color: #98a2b3;
    background: transparent;
    border-radius: 10px;
}

.btn--ghost svg {
    width: 18px;
    height: 18px;
}

.btn--ghost:hover {
    color: var(--bahaya);
    background: #fef2f2;
}

.btn:focus-visible,
.check:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--ring);
}

/* ---------- Daftar tugas ---------- */
.tasks {
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.task:hover {
    background: #ffffff;
    border-color: #d3daea;
    box-shadow: 0 12px 24px -22px rgba(16, 24, 40, 0.6);
}

.task__toggle {
    display: flex;
    margin: 0;
}

.check {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    padding: 0;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.check svg {
    width: 15px;
    height: 15px;
    color: #ffffff;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.check:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.task--done .check {
    background: linear-gradient(135deg, #34d399, #0d9488);
    border-color: transparent;
}

.task--done .check svg {
    opacity: 1;
    transform: scale(1);
}

.task__body {
    flex: 1 1 auto;
    min-width: 0;
}

.task__title {
    margin: 0;
    font-size: 0.97rem;
    font-weight: 600;
    overflow-wrap: anywhere;
    transition: color 0.15s ease;
}

.task--done .task__title {
    color: var(--muted);
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    font-weight: 500;
}

.task__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.task__time {
    font-size: 0.74rem;
    color: #98a2b3;
}

/* ---------- Label prioritas ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.badge--tinggi {
    color: #be123c;
    background: #ffe4e6;
    border-color: #fecdd3;
}

.badge--sedang {
    color: #b45309;
    background: #fef3c7;
    border-color: #fde68a;
}

.badge--rendah {
    color: #0f766e;
    background: #ccfbf1;
    border-color: #99f6e4;
}

.task--done .badge {
    opacity: 0.7;
}

.task__delete {
    display: flex;
    margin: 0;
}

/* ---------- Kosong ---------- */
.empty {
    margin-top: 20px;
    padding: 34px 20px;
    text-align: center;
    border: 1.5px dashed #dfe5f0;
    border-radius: 14px;
    background: var(--surface-2);
}

.empty svg {
    width: 38px;
    height: 38px;
    color: #c2cbd9;
}

.empty__title {
    margin: 10px 0 4px;
    font-size: 1rem;
    font-weight: 700;
}

.empty__text {
    margin: 0;
    font-size: 0.88rem;
    color: var(--muted);
}

.footer {
    margin: 22px 0 0;
    text-align: center;
    font-size: 0.8rem;
    color: #98a2b3;
}

/* ---------- Responsif ---------- */
@media (min-width: 720px) {
    .page {
        padding: 56px 24px 80px;
    }

    .card {
        padding: 24px;
    }

    .task-form {
        grid-template-columns: minmax(0, 1fr) 168px auto;
        align-items: end;
    }

    .btn--primary {
        height: 46px;
    }
}

@media (max-width: 360px) {
    .stat {
        padding: 10px;
    }

    .stat__value {
        font-size: 1.2rem;
    }

    .stat__label {
        font-size: 0.64rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
    }
}