*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg: #fdf6f0;
    --white: #ffffff;
    --surface: #fdf9f6;
    --border: #e8d8cc;

    --blue: #92400e;
    --blue-light: #fef3e8;
    --indigo: #78350f;

    --red: #dc2626;
    --red-light: #fff1f1;
    --amber: #92400e;
    --amber-light: #fef3e8;
    --green: #059669;
    --slate: #57534e;
    --slate-light: #f5f0eb;

    --text: #1c0f07;
    --muted: #a8928a;

    --r-card: 28px;
    --r-btn: 18px;
    --r-input: 16px;
}

/* ── Reset scroll ── */
html {
    height: 100%;
    /*overscroll-behavior: none;*/
}

body {
    font-family: 'Sora', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100%;
    overflow-x: hidden;
    /* HAPUS overflow: hidden — biar body bisa scroll di HP kecil */
}

body::before {
    content: '';
    position: fixed;
    top: -80px;
    left: -60px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.10) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -60px;
    right: -40px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.main-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Shell: scroll container utama ── */
.shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 32px;
    /* overflow-y: auto agar bisa scroll saat konten panjang */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Card: JANGAN overflow hidden, biarkan konten tampil ── */
.app-card {
    width: 100%;
    max-width: 390px;
    background: var(--white);
    border-radius: var(--r-card);
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 32px rgba(37, 99, 235, 0.08),
    0 24px 64px rgba(15, 23, 42, 0.06);
    /* HAPUS overflow: hidden dan max-height yang memotong konten */
    animation: riseIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(32px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Hero ── */
.hero {
    background: linear-gradient(160deg, #78350f 0%, #b45309 55%, #d97706 100%);
    padding: 28px 24px 32px;
    position: relative;
    overflow: hidden;
    border-radius: var(--r-card) var(--r-card) 0 0;
}

.hero::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -60px;
    right: 30px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-inner {
    position: relative;
    z-index: 1;
}

.hospital-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    padding: 5px 12px 5px 8px;
    margin-bottom: 16px;
    backdrop-filter: blur(8px);
}

.badge-icon {
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.badge-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hospital-badge span {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
}

.hero-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.hero-sub {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
}

.hero-clock {
    margin-top: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.clock-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.55rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.04em;
    line-height: 1;
}

.clock-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.clock-date {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 500;
}

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 100px;
    padding: 2px 8px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    width: fit-content;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    animation: blink 1.4s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* ── Card Body ── */
.card-body {
    padding: 24px 20px 20px;
}

.section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
    display: block;
}

.nik-input-wrap {
    margin-bottom: 16px;
}


.input-nik {
    width: 100%;
    height: 58px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--r-input);
    color: var(--text);
    font-family: sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-align: center;
    padding: 0 16px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    -webkit-appearance: none;
}

.input-nik::placeholder {
    color: var(--muted);
    font-size: 1rem;
    letter-spacing: 0.1em;
    font-weight: 400;
}

.input-nik:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background: var(--blue-light);
}

.input-nik.is-invalid {
    border-color: var(--red);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}

.invalid-msg {
    font-size: 0.72rem;
    color: var(--red);
    margin-top: 6px;
}

/* ── CTA ── */
.btn-cta {
    width: 100%;
    height: 56px;
    background: linear-gradient(135deg, #92400e 0%, #78350f 100%);
    border: none;
    border-radius: var(--r-btn);
    color: #fff;
    font-family: 'Sora', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 20px;
    box-shadow: 0 6px 20px rgba(146, 64, 14, 0.3), 0 2px 6px rgba(146, 64, 14, 0.2);
    transition: transform 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    touch-action: manipulation;
}

.btn-cta:active {
    transform: scale(0.97);
    box-shadow: 0 3px 10px rgba(146, 64, 14, 0.25);
}

.btn-cta svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ── Divider ── */
.row-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.row-divider::before, .row-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.row-divider span {
    font-size: 0.63rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ── Action Grid ── */
.action-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.act-btn {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 14px 8px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: 'Sora', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    transition: transform 0.15s, background 0.15s, border-color 0.15s;
    touch-action: manipulation;
    -webkit-appearance: none;
}

.act-btn:active {
    transform: scale(0.95);
}

.act-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.act-icon svg {
    width: 20px;
    height: 20px;
}

.act-btn.act-riwayat {
    color: var(--slate);
}

.act-btn.act-riwayat:active {
    background: var(--slate-light);
    border-color: #cbd5e1;
}

.act-btn.act-riwayat .act-icon {
    background: var(--slate-light);
}

.act-btn.act-riwayat .act-icon svg {
    color: var(--slate);
}

.act-btn.act-lapor {
    color: var(--red);
}

.act-btn.act-lapor:active {
    background: var(--red-light);
    border-color: #fca5a5;
}

.act-btn.act-lapor .act-icon {
    background: var(--red-light);
}

.act-btn.act-lapor .act-icon svg {
    color: var(--red);
}

.act-btn.act-oncall {
    color: var(--blue);
}

.act-btn.act-oncall:active {
    background: var(--blue-light);
    border-color: #93c5fd;
}

.act-btn.act-oncall .act-icon {
    background: var(--blue-light);
}

.act-btn.act-oncall .act-icon svg {
    color: var(--blue);
}

/* ── Wide Button ── */
.btn-wide {
    width: 100%;
    background: var(--amber-light);
    border: 1.5px solid #fde68a;
    border-radius: 16px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    font-family: 'Sora', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--amber);
    letter-spacing: 0.04em;
    transition: transform 0.15s, background 0.15s;
    touch-action: manipulation;
    -webkit-appearance: none;
}

.btn-wide:active {
    transform: scale(0.97);
    background: #fef3c7;
}

.btn-wide svg {
    width: 17px;
    height: 17px;
    color: var(--amber);
    flex-shrink: 0;
}

/* ── Footer ── */
.card-footer-note {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.63rem;
    color: var(--muted);
    letter-spacing: 0.04em;
    background: var(--surface);
    border-radius: 0 0 var(--r-card) var(--r-card);
}

/* ── Stagger animations ── */
.hero {
    animation: fadeUp 0.4s 0.06s both;
}

.nik-input-wrap {
    animation: fadeUp 0.4s 0.14s both;
}

.btn-cta {
    animation: fadeUp 0.4s 0.20s both;
}

.action-row {
    animation: fadeUp 0.4s 0.28s both;
}

.btn-wide {
    animation: fadeUp 0.4s 0.34s both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── HP kecil: kompres hero supaya card muat tanpa scroll ── */
@media (max-height: 700px) {
    .hero {
        padding: 18px 24px 20px;
    }

    .hero-title {
        font-size: 1.3rem;
        margin-bottom: 4px;
    }

    .hero-sub {
        display: none;
    }

    .hero-clock {
        margin-top: 10px;
    }

    .clock-val {
        font-size: 1.2rem;
    }

    .card-body {
        padding: 16px 20px 14px;
    }

    .input-nik {
        height: 48px;
        font-size: 1.1rem;
    }

    .btn-cta {
        height: 46px;
        margin-bottom: 14px;
    }

    .row-divider {
        margin-bottom: 10px;
    }

    .act-btn {
        padding: 10px 6px 8px;
        gap: 6px;
    }

    .act-icon {
        width: 34px;
        height: 34px;
    }

    .btn-wide {
        padding: 10px 20px;
    }

    .card-footer-note {
        padding: 10px 20px;
    }
}

@media (max-height: 600px) {
    .hero-clock {
        display: none;
    }

    .hospital-badge {
        margin-bottom: 8px;
    }

    .hero {
        padding: 14px 24px 16px;
    }
}

/* ── Kalau tetap tidak muat, aktifkan scroll ── */
@media (max-height: 580px) {
    .shell {
        justify-content: flex-start;
        padding-top: 16px;
        padding-bottom: 24px;
    }
}

/* ── Desktop / layar lebar ── */
@media (min-width: 480px) {
    .shell {
        padding: 40px 24px 48px;
    }

    .hero {
        padding: 32px 28px 36px;
    }

    .card-body {
        padding: 28px 24px 24px;
    }

    .hero-title {
        font-size: 1.85rem;
    }

    .input-nik {
        height: 62px;
        font-size: 1.45rem;
    }

    .btn-cta {
        height: 58px;
        font-size: 0.92rem;
    }

    .act-btn {
        padding: 16px 10px 14px;
        font-size: 0.72rem;
    }

    .act-icon {
        width: 44px;
        height: 44px;
    }

    .act-icon svg {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 360px) {
    .hero {
        padding: 22px 18px 26px;
    }

    .card-body {
        padding: 18px 16px 16px;
    }

    .hero-title {
        font-size: 1.4rem;
    }

    .clock-val {
        font-size: 1.3rem;
    }

    .input-nik {
        height: 52px;
        font-size: 1.1rem;
    }

    .btn-cta {
        height: 50px;
        font-size: 0.84rem;
    }

    .action-row {
        gap: 8px;
    }

    .act-btn {
        padding: 11px 4px 10px;
        border-radius: 14px;
    }

    .act-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .act-icon svg {
        width: 16px;
        height: 16px;
    }
}
