.masthead { position: relative; overflow: hidden; }

#mastheadCarousel { transition: filter .7s ease, transform 1.2s ease; will-change: filter, transform; }
.masthead.is-open #mastheadCarousel { filter: blur(12px) brightness(.55) saturate(1.1); transform: scale(1.07); }

.masthead-search { transition: opacity .35s ease, visibility .35s; }
.masthead.is-open .masthead-search { opacity: 0; visibility: hidden; pointer-events: none; }

/* Tombol bulat melayang */
.masthead-fab {
    position: absolute; top: 1rem; right: 1rem; z-index: 30;
    width: 52px; height: 52px; border-radius: 50%;
    display: grid; place-items: center;
    color: #fff; font-size: 20px; cursor: pointer;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .45);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
    transition: transform .25s ease, background .25s ease;
}
.masthead-fab:hover { background: rgba(255, 255, 255, .32); transform: scale(1.06); }
.masthead-fab:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.masthead-fab:disabled { opacity: .6; cursor: progress; }
.masthead-fab i { transition: transform .35s ease, opacity .2s ease; }
.masthead-fab i.is-swap { transform: rotate(90deg) scale(.4); opacity: 0; }

/* Petunjuk login: panah (go.gif) + gambar ajakan (att.png) */
.login-hint {
    position: absolute; z-index: 30;
    top: calc(1rem - 4px);                 /* panah sejajar tengah FAB */
    right: calc(1rem + 52px + 4px);        /* di kiri FAB */
    display: flex; flex-direction: column; align-items: flex-end;
    pointer-events: none;
    transition: opacity .3s ease;
}
.login-hint.is-gone { opacity: 0; }
.masthead.is-open .login-hint { display: none; }

.login-hint__arrow { display: block; width: 60px; height: 60px; }

.login-hint__attn {
    display: block; height: 250px; width: auto; max-width: none;
    margin-top: -8px;
    transform-origin: 50% 0;               /* bergoyang dari bagian atas */
    animation: hintSway 2.8s ease-in-out infinite;
}
@keyframes hintSway {
    0%, 100% { transform: rotate(-2.5deg); }
    50%      { transform: rotate(2.5deg); }
}

@media (max-width: 575.98px) {
    .login-hint { top: calc(1rem + 2px); right: calc(1rem + 52px + 2px); }
    .login-hint__arrow { width: 48px; height: 48px; }
    .login-hint__attn { height: 130px; }
}

/* Panel: mekar dari posisi tombol */
.masthead-panel {
    position: absolute; inset: 0; z-index: 20;
    display: flex; align-items: center; justify-content: center;
    padding: 4.5rem 1rem 1.5rem; overflow-y: auto;
    visibility: hidden;
    clip-path: circle(0 at calc(100% - 2.5rem) 2.5rem);
    transition: clip-path .7s cubic-bezier(.65, 0, .25, 1), visibility 0s .7s;
}
.masthead-panel.show {
    visibility: visible;
    clip-path: circle(150% at calc(100% - 2.5rem) 2.5rem);
    transition: clip-path .8s cubic-bezier(.65, 0, .25, 1), visibility 0s;
}

.masthead-card {
    width: 100%; max-width: 420px; margin: auto; color: #fff;
    padding: 2rem 1.75rem;
    background: rgba(18, 24, 38, .42);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 18px;
    -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
    opacity: 0; transform: translateY(24px);
    transition: opacity .5s ease .35s, transform .6s cubic-bezier(.2, .8, .2, 1) .35s;
}
.masthead-panel.show .masthead-card { opacity: 1; transform: none; }
.masthead-card.is-wide { max-width: 760px; }
.masthead-card h2 { font-size: 1.5rem; font-weight: 700; margin: 0 0 .25rem; }
.masthead-card .lead-sm { margin: 0 0 1.25rem; opacity: .85; font-size: .95rem; }

.masthead-card label { display: block; font-size: .85rem; margin-bottom: .25rem; }
.masthead-card .form-control {
    background: rgba(255, 255, 255, .92); border: 0; border-radius: 10px; padding: .65rem .85rem;
}
.masthead-card .form-control:focus { box-shadow: 0 0 0 3px rgba(255, 255, 255, .55); }
.masthead-card .btn-submit {
    width: 100%; margin-top: 1rem; padding: .7rem; border: 0; border-radius: 10px;
    font-weight: 700; color: #fff; background: #0d6efd; cursor: pointer;
}
.masthead-card .btn-submit:disabled { opacity: .65; cursor: progress; }
.masthead-error {
    min-height: 1.25rem; margin-top: .75rem; font-size: .9rem; color: #ffd0d0;
}

/* Menu: hanya ikon + label, tanpa kotak */
.masthead-card.is-bare {
    width: auto; max-width: 100%; padding: 0; background: none; border: 0; border-radius: 0;
    box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
}
.menu-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem 2.5rem; }
.menu-item {
    width: 104px; display: flex; flex-direction: column; align-items: center; gap: .65rem;
    text-align: center; color: #fff; text-decoration: none; font-weight: 100;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .55);
    opacity: 0; transform: translateY(18px);
    transition: transform .3s ease, color .3s ease;
}
.masthead-panel.show .menu-item { animation: menuIn .55s cubic-bezier(.2, .8, .2, 1) forwards; }
.masthead-panel.show .menu-item:nth-child(2) { animation-delay: .08s; }
.masthead-panel.show .menu-item:nth-child(3) { animation-delay: .16s; }
.masthead-panel.show .menu-item:nth-child(4) { animation-delay: .24s; }
.masthead-panel.show .menu-item:nth-child(n+5) { animation-delay: .32s; }
@keyframes menuIn { to { opacity: 1; transform: none; } }
.menu-item i { font-size: 24px; filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .5)); transition: transform .3s ease; }
.menu-item:hover, .menu-item:focus-visible { color: #fff; }
.menu-item:hover i, .menu-item:focus-visible i { transform: translateY(-5px) scale(1.15); }
.menu-item:focus, .menu-item:focus-visible { outline: none; }
.menu-item:focus-visible span { text-decoration: underline; text-underline-offset: 4px; }

/* Skeleton / retry */
.menu-grid .skeleton { width: 64px; height: 64px; border-radius: 50%; }
.skeleton { border-radius: 14px; background: linear-gradient(90deg, rgba(255,255,255,.1), rgba(255,255,255,.25), rgba(255,255,255,.1)); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.retry-btn { margin-top: .75rem; padding: .5rem 1rem; border-radius: 8px; border: 1px solid #fff; background: transparent; color: #fff; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
    #mastheadCarousel, .masthead-search, .masthead-fab, .masthead-fab i,
    .masthead-panel, .masthead-card, .menu-item { transition-duration: .01s !important; transition-delay: 0s !important; }
    .skeleton { animation: none; }
    .login-hint__attn { animation: none; }
}

/* Tombol Google */
.btn-google {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: .65rem;
    padding: .75rem 1rem; border: 0; border-radius: 10px; cursor: pointer;
    font-weight: 700; color: #1f1f1f; background: #fff;
    transition: transform .2s ease, box-shadow .2s ease;
}
.btn-google:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0, 0, 0, .3); }
.btn-google:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.btn-google:disabled { opacity: .65; cursor: progress; transform: none; box-shadow: none; }