/* ==================================================================
   ArahFile — sistem desain bersama
   Dipakai oleh: url.php (halaman tugas), semua halaman login/daftar.
   Homepage punya CSS sendiri di dalam home.php.
   ================================================================== */

:root {
    --blue: #1a5cff;
    --blue-dark: #0f3fd4;
    --blue-soft: #eef2ff;
    --ink: #0d1220;
    --muted: #5c6780;
    --line: #e3e8f2;
    --tint: #f6f8fd;
    --ok: #12b76a;
    --danger: #d92d20;
    --card: #ffffff;
    --page: #f6f8fd;
    --radius: 14px;
}

/* Mode gelap untuk halaman tugas */
[data-theme="dark"] {
    --ink: #e9edf7;
    --muted: #98a3bd;
    --line: #262e47;
    --tint: #131a2c;
    --card: #171d31;
    --page: #0d1220;
    --blue-soft: #1b2545;
}

* { box-sizing: border-box; }

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

html, body { overflow-x: clip; }

img, svg, iframe { max-width: 100%; }

.ad-slot img,
.ad-slot iframe { max-width: 100%; height: auto; }

body {
    margin: 0;
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--page);
    -webkit-font-smoothing: antialiased;
    transition: background .2s ease, color .2s ease;
}

h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.02em; font-weight: 800; }
p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- Bar atas ---------- */
.topbar {
    background: var(--blue);
    padding: 0 22px;
}

.topbar-in {
    max-width: 1120px;
    margin: 0 auto;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar a { color: #fff; text-decoration: none; display: flex; align-items: center; min-width: 0; }

.topbar img {
    height: 28px;
    width: auto;
    max-width: 100%;
    display: block;
    object-fit: contain;
    object-position: left center;
}
.topbar .brand-text { font-weight: 800; font-size: 18px; }

.topbar-link {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 14.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, .9) !important;
}

.topbar-link:hover { color: #fff !important; }
.topbar :focus-visible { outline-color: #fff; }

/* ---------- Tombol ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid transparent;
    padding: 12px 20px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; }

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--line);
}

.btn-ghost:hover { border-color: #c9d3e6; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- Kartu ---------- */
.shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 22px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 18px 50px -30px rgba(15, 35, 95, .4);
}

.card-pad { padding: 26px; }

/* ---------- Form ---------- */
.field { margin-bottom: 14px; }

.label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 6px;
}

.input {
    width: 100%;
    font-family: inherit;
    font-size: 15px;
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.input::placeholder { color: #9aa5bd; }

.input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(26, 92, 255, .12);
}

.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }

.check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}

.check input { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }

.form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* ---------- Notifikasi ---------- */
.note {
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14.5px;
    margin-bottom: 18px;
    border: 1px solid;
}

.note-error { background: #fef3f2; border-color: #fecdc9; color: #912018; }
.note-ok { background: #ecfdf3; border-color: #a9efc5; color: #05603a; }
.note p { margin: 0; }
.note p + p { margin-top: 4px; }
.note .errormsg { color: inherit; }

/* ==================================================================
   Halaman auth (login / daftar / lupa sandi)
   ================================================================== */

.auth-wrap {
    min-height: calc(100vh - 60px);
    display: grid;
    place-items: center;
    padding: 40px 22px 56px;
}

.auth-card { width: 100%; max-width: 420px; }
.auth-head { margin-bottom: 22px; }
.auth-head h1 { font-size: 25px; margin-bottom: 6px; }
.auth-head p { color: var(--muted); font-size: 15px; }

.auth-alt {
    text-align: center;
    margin-top: 20px;
    font-size: 14.5px;
    color: var(--muted);
}

.auth-foot {
    text-align: center;
    margin-top: 26px;
    font-size: 13.5px;
    color: var(--muted);
}

/* ==================================================================
   Halaman tugas (gate)
   ================================================================== */

.gate-wrap { padding: 34px 22px 50px; max-width: 560px; margin: 0 auto; }

.gate-head { text-align: center; margin-bottom: 22px; }
.gate-head h1 { font-size: 22px; margin-bottom: 6px; }
.gate-head p { color: var(--muted); font-size: 14.5px; }

.progress-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 8px;
}

.progress {
    height: 6px;
    background: var(--line);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 24px;
}

.progress-bar {
    height: 100%;
    background: var(--blue);
    border-radius: 99px;
    transition: width .35s ease;
}

/* Tombol tugas */
.task {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color .15s ease, transform .1s ease, opacity .2s ease;
}

.task:hover:not(:disabled) { border-color: var(--blue); }
.task:active:not(:disabled) { transform: scale(.995); }
.task:disabled { cursor: not-allowed; opacity: .45; }
.task.is-done { opacity: 1; border-color: rgba(18, 183, 106, .45); }
.task .ico { flex: 0 0 26px; display: flex; align-items: center; justify-content: center; }
.task .txt { flex: 1; min-width: 0; }
.task .state { flex: 0 0 auto; display: flex; color: var(--muted); }

/* Tombol tujuan */
.task-target {
    margin-top: 18px;
    background: var(--tint);
    border-style: dashed;
}

.task-target.is-open {
    background: var(--blue);
    border: 1px solid var(--blue);
    border-style: solid;
    color: #fff;
    opacity: 1;
}

.task-target.is-open .state { color: #fff; }

/* Salin URL */
.share { margin-top: 26px; }
.share .label { color: var(--muted); font-weight: 600; }
.share-row { display: flex; gap: 8px; }
.share-row .input { flex: 1; min-width: 0; font-size: 14px; }
.share-row .btn { flex: 0 0 auto; padding: 12px 16px; }

.gate-msg {
    font-size: 14px;
    color: var(--danger);
    margin-top: 12px;
    text-align: center;
    display: none;
}

[data-theme="dark"] .gate-msg { color: #ff9b91; }

/* Tombol mode gelap */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 99px;
    padding: 6px 13px;
    cursor: pointer;
}

.theme-toggle:hover { color: var(--ink); border-color: #c9d3e6; }

.ad-slot { text-align: center; }
.ad-slot:not(:empty) { padding: 18px 0; }

.pagefoot {
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    padding: 26px 22px 34px;
}

/* Animasi menunggu */
.spin { animation: spin .8s linear infinite; transform-origin: center; }

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

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

@media (max-width: 560px) {
    .card-pad { padding: 22px 18px; }
    .gate-wrap { padding: 26px 16px 40px; }
    .auth-wrap { padding: 30px 16px 44px; }
    .topbar { padding: 0 16px; }
    .topbar-in { height: 56px; gap: 10px; }
    .topbar img { height: 22px; max-width: 132px; }
    .topbar-link { font-size: 13.5px; }
    .gate-head h1 { font-size: 20px; }
}

@media (max-width: 360px) {
    .topbar img { max-width: 104px; }
    .topbar-link { font-size: 12.5px; }
}