:root {
    --tmu-primary: #1e3a5f;
    --tmu-primary-light: #3f6491;
    --tmu-secondary: #c8404f;
    --tmu-accent: #d69a1f;
    --tmu-light: #f6f7fb;
    --tmu-line: #e4e6ee;
    --tmu-text-muted: #5a6070;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
    color: #12151c;
    /* Latar elegan — gradasi lembut + pola dot samar, senada identitas navy sekolah, bukan abu polos */
    background:
        radial-gradient(circle at 12% 8%, rgba(30,58,95,0.06), transparent 40%),
        radial-gradient(circle at 92% 85%, rgba(200,64,79,0.05), transparent 45%),
        url("data:image/svg+xml,%3Csvg width='34' height='34' viewBox='0 0 34 34' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='17' cy='17' r='1.3' fill='%231e3a5f' fill-opacity='0.045'/%3E%3C/svg%3E"),
        var(--tmu-light);
    background-attachment: fixed;
    min-height: 100vh;
}

/* ── Topbar ── */
.tmu-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.5rem; background: #fff; border-bottom: 1px solid var(--tmu-line);
    position: sticky; top: 0; z-index: 100;
}
.tmu-brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--tmu-primary); font-weight: 800; font-size: 1rem; }
.tmu-brand img { height: 34px; width: 34px; object-fit: contain; border-radius: 8px; }
.tmu-brand i { font-size: 1.6rem; }
.tmu-back { text-decoration: none; color: var(--tmu-text-muted); font-size: .85rem; font-weight: 600; display: flex; align-items: center; gap: .4rem; }
.tmu-back:hover { color: var(--tmu-primary); }

/* ── Layout ── */
.tmu-main { min-height: calc(100vh - 68px); display: flex; align-items: flex-start; justify-content: center; padding: 2.5rem 1.2rem; }
.tmu-wrap { width: 100%; max-width: 980px; }
.tmu-wrap-narrow { max-width: 560px; }
.tmu-wrap-wide { max-width: 1360px; }

.tmu-hero { text-align: center; margin-bottom: 0; position: relative; z-index: 1; }
.tmu-hero h1 { font-weight: 800; letter-spacing: -0.02em; font-size: 1.9rem; color: #fff; margin: 0 0 .5rem; }
.tmu-hero p { color: rgba(255,255,255,.78); margin: 0; font-size: .95rem; }

/* ── Hero banner (elegan, navy — konsisten dgn identitas sekolah) ── */
.tmu-hero-banner {
    position: relative; overflow: hidden; margin-bottom: 2.2rem;
    padding: 2.6rem 1.5rem 2.2rem; border-radius: 22px;
    background: linear-gradient(135deg, var(--tmu-primary) 0%, #142c47 55%, #0d1f34 100%);
    box-shadow: 0 18px 40px -18px rgba(30,58,95,.45);
    animation: tmuHeroIn .5s ease both;
}
@keyframes tmuHeroIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.tmu-hero-dots {
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='15' cy='15' r='1.5' fill='%23ffffff' fill-opacity='0.07'/%3E%3C/svg%3E");
}

/* Aurora lembut — cahaya latar bergerak pelan, memberi kesan hidup tanpa mengalihkan perhatian dari teks */
.tmu-hero-banner::before {
    content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(circle at 15% 20%, rgba(255,255,255,0.10), transparent 45%),
        radial-gradient(circle at 88% 85%, rgba(63,100,145,0.35), transparent 50%);
    filter: blur(20px);
    animation: tmuAurora 18s ease-in-out infinite;
}
@keyframes tmuAurora {
    0%, 100% { transform: translate(0,0) scale(1); }
    50%      { transform: translate(-3%,3%) scale(1.1); }
}

/* Badge sambutan — ikon pintu terbuka berdenyut lembut, simbol "menyambut tamu" tanpa figur kartun */
.tmu-hero-badge {
    width: 52px; height: 52px; margin: 0 auto 1rem; border-radius: 14px;
    display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: #fff;
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2); backdrop-filter: blur(8px);
    animation: tmuBadgePulse 2.6s ease-in-out infinite;
}
@keyframes tmuBadgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.1), 0 0 16px rgba(255,255,255,0.15); }
    50%      { box-shadow: 0 0 0 6px rgba(255,255,255,0.03), 0 0 26px rgba(255,255,255,0.3); }
}
@media (prefers-reduced-motion: reduce) {
    .tmu-hero-banner { animation: none; }
    .tmu-hero-banner::before { animation: none; }
    .tmu-hero-badge { animation: none; }
}

/* Varian ringkas — dipakai di halaman form (lebih pendek dari banner beranda tamu) */
.tmu-hero-banner-sm { padding: 2rem 1.5rem 1.8rem; margin-bottom: 1.8rem; }
.tmu-hero-banner-sm .tmu-hero h1 { font-size: 1.55rem; }

/* ── Cards pilihan (index) ── */
.tmu-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.tmu-card {
    background: #fff; border: 1px solid var(--tmu-line); border-radius: 18px; padding: 2rem 1.4rem;
    text-align: center; text-decoration: none; color: inherit; transition: transform .25s, box-shadow .25s, border-color .25s;
    box-shadow: 0 2px 12px rgba(30,58,95,.05);
}
.tmu-card:hover { transform: translateY(-6px); box-shadow: 0 16px 34px rgba(30,58,95,.16); border-color: var(--tmu-primary-light); }
.tmu-card-anim { animation: tmuCardIn .5s ease both; }
@keyframes tmuCardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .tmu-card-anim { animation: none; } }

.tmu-card-icon {
    width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%;
    background: linear-gradient(135deg,var(--tmu-primary),var(--tmu-primary-light)); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 1.7rem;
    transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s;
}
.tmu-card:hover .tmu-card-icon { transform: scale(1.08) rotate(-4deg); box-shadow: 0 8px 20px rgba(30,58,95,.35); }

.tmu-card h3 { font-size: 1.05rem; font-weight: 800; margin: 0 0 .4rem; color: #12151c; }
.tmu-card p { font-size: .85rem; color: var(--tmu-text-muted); margin: 0; }

/* ── Kartu 3D — miring mengikuti kursor (tilt), diberi highlight kaca yg mengikuti posisi mouse ── */
.tmu-cards-3d { perspective: 1200px; }
.tmu-card-3d { position: relative; overflow: hidden; }
.tmu-card-3d-inner {
    transform-style: preserve-3d; will-change: transform;
    transition: transform .35s cubic-bezier(.22,1,.36,1);
}
.tmu-card-3d:hover { box-shadow: 0 22px 48px -18px rgba(30,58,95,.32); }
.tmu-card-3d:hover .tmu-card-icon { transform: translateZ(24px) scale(1.08) rotate(-4deg); }
.tmu-card-3d .tmu-card-icon { transition: transform .35s cubic-bezier(.22,1,.36,1); }
.tmu-card-3d h3, .tmu-card-3d p { transition: transform .35s cubic-bezier(.22,1,.36,1); }
.tmu-card-3d:hover h3 { transform: translateZ(14px); }
.tmu-card-3d:hover p  { transform: translateZ(8px); }
.tmu-card-glare {
    position: absolute; inset: 0; border-radius: 18px; pointer-events: none;
    opacity: 0; transition: opacity .25s ease; z-index: 2;
}
@media (prefers-reduced-motion: reduce) {
    .tmu-card-3d-inner, .tmu-card-3d .tmu-card-icon, .tmu-card-3d h3, .tmu-card-3d p { transition: none; }
}
@media (hover: none) {
    .tmu-card-3d-inner { transform: none !important; }
    .tmu-card-glare { display: none; }
}

@media (max-width: 767.98px) {
    .tmu-cards { grid-template-columns: 1fr; }
    .tmu-hero-banner { padding: 2.1rem 1.2rem 1.8rem; }
}

/* ── Form Card — elegan: aksen garis warna di atas, muncul halus, fokus lebih hidup ── */
.tmu-form-card {
    position: relative; background: #fff; border: 1px solid var(--tmu-line); border-radius: 18px;
    padding: 1.9rem 1.8rem 1.8rem; box-shadow: 0 10px 30px -14px rgba(30,58,95,.18);
    overflow: hidden;
}
.tmu-form-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--tmu-primary), var(--tmu-primary-light), var(--tmu-secondary, #c8404f));
}
.tmu-form-card-anim { animation: tmuFormIn .5s ease both; animation-delay: .1s; }
@keyframes tmuFormIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* Field-field form muncul bertahap menyusul kartunya */
.tmu-form-card-anim > .tmu-form-group,
.tmu-form-card-anim > .tmu-form-row,
.tmu-form-card-anim > button {
    animation: tmuFieldIn .45s ease both;
}
.tmu-form-card-anim > :nth-child(1) { animation-delay: .18s; }
.tmu-form-card-anim > :nth-child(2) { animation-delay: .24s; }
.tmu-form-card-anim > :nth-child(3) { animation-delay: .3s; }
.tmu-form-card-anim > :nth-child(4) { animation-delay: .36s; }
.tmu-form-card-anim > :nth-child(5) { animation-delay: .42s; }
@keyframes tmuFieldIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
    .tmu-form-card-anim,
    .tmu-form-card-anim > .tmu-form-group,
    .tmu-form-card-anim > .tmu-form-row,
    .tmu-form-card-anim > button { animation: none; }
}

.tmu-form-group { margin-bottom: 1.1rem; }
.tmu-form-group label { display: block; font-size: .82rem; font-weight: 700; color: #334155; margin-bottom: .4rem; }
.tmu-form-group input[type=text], .tmu-form-group input[type=number], .tmu-form-group textarea {
    width: 100%; padding: .75rem .9rem; border: 1.5px solid var(--tmu-line); border-radius: 10px; font-size: .95rem; font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
}
.tmu-form-group input:focus, .tmu-form-group textarea:focus {
    outline: none; border-color: var(--tmu-primary);
    box-shadow: 0 0 0 3px rgba(30,58,95,.1);
}
.tmu-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.tmu-jam-input { text-align: center; letter-spacing: .05em; }

/* ── Kotak Kode Booking (OTP-style) ── */
.tmu-kode-boxes { display: flex; gap: .6rem; justify-content: center; }
.tmu-kode-box {
    width: 100%; max-width: 56px; aspect-ratio: 1 / 1; text-align: center;
    font-size: 1.4rem; font-weight: 800; text-transform: uppercase; color: var(--tmu-primary);
    border: 1.5px solid var(--tmu-line); border-radius: 12px; padding: 0; font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.tmu-kode-box:focus { outline: none; border-color: var(--tmu-primary); box-shadow: 0 0 0 3px rgba(30,58,95,.12); }
.tmu-kode-box.tmu-kode-filled { border-color: var(--tmu-primary-light); }
@media (max-width: 400px) {
    .tmu-kode-boxes { gap: .4rem; }
    .tmu-kode-box { max-width: 44px; font-size: 1.15rem; }
}
@media (max-width: 575.98px) { .tmu-form-row { grid-template-columns: 1fr; } }

.tmu-btn-submit {
    position: relative; overflow: hidden;
    width: 100%; padding: .9rem; background: linear-gradient(135deg, var(--tmu-primary), var(--tmu-primary-light)); color: #fff; border: none; border-radius: 12px;
    font-size: 1rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .5rem;
    transition: transform .2s, box-shadow .2s, background .2s;
    box-shadow: 0 10px 24px -8px rgba(30,58,95,.5);
}
.tmu-btn-submit::after {
    content: ''; position: absolute; top: 0; left: -60%; width: 45%; height: 100%;
    background: linear-gradient(115deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-20deg); transition: left .55s ease; pointer-events: none;
}
.tmu-btn-submit:hover::after { left: 130%; }
.tmu-btn-submit:hover { background: linear-gradient(135deg, #16304d, var(--tmu-primary)); transform: translateY(-2px); box-shadow: 0 14px 30px -8px rgba(30,58,95,.6); }
.tmu-btn-submit:active { transform: translateY(0); }
.tmu-btn-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .tmu-btn-submit::after { display: none; } }
.tmu-btn-secondary {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem; margin-top: .5rem;
    padding: .7rem 1.2rem; background: var(--tmu-light); color: var(--tmu-primary); border: 1.5px solid var(--tmu-line);
    border-radius: 10px; font-weight: 700; font-size: .88rem; cursor: pointer; text-decoration: none;
}
.tmu-btn-secondary:hover { border-color: var(--tmu-primary); color: var(--tmu-primary); }

/* ── Sukses / Hasil Card ── */
.tmu-sukses-card, .tmu-hasil-card { background: #fff; border: 1px solid var(--tmu-line); border-radius: 18px; padding: 2.2rem; text-align: center; box-shadow: 0 2px 12px rgba(30,58,95,.05); }
.tmu-sukses-icon { font-size: 3rem; color: #16a34a; margin-bottom: .8rem; }
.tmu-sukses-card h3 { font-weight: 800; margin: 0 0 .5rem; }
.tmu-sukses-card p { color: var(--tmu-text-muted); margin: 0 0 .3rem; font-size: .92rem; }
.tmu-sukses-note { font-size: .8rem !important; color: #94a3b8 !important; margin-top: .6rem !important; }
.tmu-kode-booking { font-size: 1.8rem; font-weight: 800; letter-spacing: .12em; color: var(--tmu-primary); background: var(--tmu-light); border-radius: 10px; padding: .7rem 1rem; margin: .6rem 0; }

.tmu-hasil-card { text-align: left; }
.tmu-hasil-kode { font-size: .78rem; color: var(--tmu-text-muted); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.tmu-hasil-nama { font-size: 1.2rem; font-weight: 800; margin: .2rem 0 1rem; }
.tmu-hasil-row { display: flex; justify-content: space-between; padding: .55rem 0; border-bottom: 1px solid #f1f5f9; font-size: .88rem; }
.tmu-hasil-row span:first-child { color: var(--tmu-text-muted); }
.tmu-hasil-row span:last-child { font-weight: 700; text-align: right; }
.tmu-status-pill { font-size: .75rem; font-weight: 700; border-radius: 50px; padding: .25rem .7rem; display: inline-block; }
.tmu-status-pill.menunggu-konfirmasi { background: #fffbeb; color: #b45309; }
.tmu-status-pill.diterima { background: #f0fdf4; color: #16a34a; }
.tmu-status-pill.ditolak { background: #fef2f2; color: #dc2626; }
.tmu-status-pill.dijadwal-ulang { background: #eff6ff; color: #1d4ed8; }
.tmu-status-pill.selesai { background: #f1f5f9; color: #334155; }
.tmu-status-pill.dibatalkan { background: #f1f5f9; color: #64748b; }
.tmu-hasil-catatan { margin-top: 1rem; padding: .8rem 1rem; background: var(--tmu-light); border-radius: 10px; font-size: .85rem; color: #334155; }
.tmu-hasil-error { text-align: center; color: #dc2626; font-weight: 600; }

/* ── Custom Select ── */
.cstm-select-item { position: relative; }
.cstm-select-trigger { display: flex; align-items: center; justify-content: space-between; gap: .4rem; width: 100%; padding: .75rem .9rem; border: 1.5px solid var(--tmu-line); border-radius: 10px; font-size: .95rem; background: #fff; cursor: pointer; color: #1e293b; user-select: none; }
.cstm-select-trigger:hover { border-color: #94a3b8; }
.cstm-select-item.open .cstm-select-trigger { border-color: var(--tmu-primary); }
.cstm-select-item.open .cstm-select-trigger i { transform: rotate(180deg); }
.cstm-select-trigger i { transition: .15s; color: #94a3b8; font-size: .75rem; }
.cstm-select-dropdown { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1.5px solid var(--tmu-line); border-radius: 10px; box-shadow: 0 8px 24px rgba(30,58,95,.14); max-height: 220px; overflow-y: auto; z-index: 2100; }
.cstm-select-item.open .cstm-select-dropdown { display: block; }
.cstm-select-opt { padding: .6rem .9rem; font-size: .9rem; cursor: pointer; color: #334155; }
.cstm-select-opt:hover { background: #f1f5f9; }
.cstm-select-opt.selected { background: var(--tmu-light); color: var(--tmu-primary); font-weight: 700; }

/* ── Custom Date Picker ── */
.tmu-date-wrap { position: relative; }
.tmu-date-pop { position: absolute; top: calc(100% + 4px); left: 0; background: #fff; border: 1.5px solid var(--tmu-line); border-radius: 12px; box-shadow: 0 8px 24px rgba(30,58,95,.14); z-index: 2200; padding: .9rem; width: 270px; }
.tmu-date-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.tmu-date-head button { border: none; background: var(--tmu-light); width: 28px; height: 28px; border-radius: 7px; cursor: pointer; color: #334155; }
.tmu-date-head button:hover { background: var(--tmu-line); }
.tmu-date-head span { font-size: .85rem; font-weight: 700; }
.tmu-date-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.tmu-date-dow { text-align: center; font-size: .68rem; font-weight: 700; color: #94a3b8; padding: .25rem 0; }
.tmu-date-day { text-align: center; font-size: .8rem; padding: .4rem 0; border-radius: 7px; cursor: pointer; color: #334155; }
.tmu-date-day:hover { background: #f1f5f9; }
.tmu-date-day.tmu-date-muted { color: #cbd5e1; pointer-events: none; }
.tmu-date-day.tmu-date-past { color: #cbd5e1; pointer-events: none; }
.tmu-date-day.tmu-date-selected { background: var(--tmu-primary); color: #fff; font-weight: 700; }
.tmu-date-day.tmu-date-today:not(.tmu-date-selected) { border: 1.5px solid var(--tmu-primary); }

/* ── Toast ── */
.tmu-toast { position: fixed; bottom: 1.2rem; right: 1.2rem; z-index: 5000; background: #0f172a; color: #fff; padding: .7rem 1.1rem; border-radius: 10px; font-size: .85rem; box-shadow: 0 8px 24px rgba(0,0,0,.2); display: flex; align-items: center; gap: .5rem; animation: tmuToastIn .2s ease; }
.tmu-toast.sukses { background: #16a34a; }
.tmu-toast.gagal { background: #dc2626; }
@keyframes tmuToastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
