/* ==========================================================================
   Attendance Non-ASN FGTKWB Baturraden — Modern Mobile-First Portal
   Palette: navy blue, royal blue, cyan, white, emerald accent
   ========================================================================== */

:root {
    --navy-900: #0a1a3c;
    --navy-800: #0e2350;
    --navy-700: #14306b;
    --royal-600: #1d4ed8;
    --royal-500: #2563eb;
    --cyan-500: #06b6d4;
    --cyan-300: #67e8f9;
    --emerald-500: #10b981;
    --ink: #0f1f3d;
    --muted: #5b6b8c;
    --bg: #f2f6fc;
    --card: #ffffff;
    --line: #e3eaf5;
    --grad-brand: linear-gradient(135deg, #1d4ed8 0%, #2563eb 45%, #06b6d4 100%);
    --grad-navy: linear-gradient(150deg, #0a1a3c 0%, #0e2350 55%, #14306b 100%);
    --shadow-soft: 0 10px 30px -12px rgba(15, 31, 61, 0.18);
    --shadow-lift: 0 22px 45px -15px rgba(29, 78, 216, 0.35);
    --radius: 1.25rem;
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img { max-width: 100%; height: auto; }

/* Flex truncation helper (Bootstrap 5.3 has no min-width utility) */
.min-w-0 { min-width: 0; }

/* ---------- Entrance animation ---------- */
.rise {
    opacity: 0;
    transform: translateY(22px);
    animation: riseIn 0.7s cubic-bezier(0.22, 0.8, 0.32, 1) forwards;
}
.rise-1 { animation-delay: 0.05s; }
.rise-2 { animation-delay: 0.15s; }
.rise-3 { animation-delay: 0.25s; }
.rise-4 { animation-delay: 0.35s; }
.rise-5 { animation-delay: 0.45s; }

@keyframes riseIn {
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Navbar ---------- */
.portal-nav {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
.brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    padding: 4px;
    box-shadow: var(--shadow-soft);
    flex-shrink: 0;
}
.brand-name {
    font-weight: 800;
    font-size: clamp(0.95rem, 2.6vw + 0.55rem, 1.15rem);
    line-height: 1.2;
    color: var(--navy-900);
    letter-spacing: -0.01em;
}
.brand-sub {
    font-size: clamp(0.68rem, 1.6vw + 0.5rem, 0.78rem);
    color: var(--muted);
    font-weight: 600;
}
.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--royal-600);
    background: rgba(37, 99, 235, 0.09);
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 999px;
    padding: 0.42rem 0.85rem;
    white-space: nowrap;
}
.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--emerald-500);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    animation: pulseDot 2s infinite;
    flex-shrink: 0;
}
@keyframes pulseDot {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    background: var(--grad-navy);
    color: #fff;
    overflow: hidden;
    isolation: isolate;
}
.hero::before,
.hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    z-index: -1;
    pointer-events: none;
}
.hero::before {
    width: 420px; height: 420px;
    top: -160px; right: -140px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.35) 0%, rgba(6, 182, 212, 0) 70%);
}
.hero::after {
    width: 340px; height: 340px;
    bottom: -140px; left: -110px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.4) 0%, rgba(37, 99, 235, 0) 70%);
}
.hero-grid {
    position: relative;
    z-index: 1;
}
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(0.72rem, 1.8vw + 0.55rem, 0.82rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--cyan-300);
    background: rgba(103, 232, 249, 0.1);
    border: 1px solid rgba(103, 232, 249, 0.28);
    border-radius: 999px;
    padding: 0.45rem 0.95rem;
    max-width: 100%;
}
.hero-title {
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.08;
    font-size: clamp(1.9rem, 7vw + 1rem, 3.4rem);
    margin: 0;
    overflow-wrap: anywhere;
}
.hero-title .accent {
    background: linear-gradient(90deg, #67e8f9, #93c5fd, #6ee7b7, #67e8f9);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientShift 6s linear infinite;
}
@keyframes gradientShift {
    to { background-position: 220% center; }
}
.hero-sub {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(1.02rem, 3.4vw + 0.7rem, 1.35rem);
    letter-spacing: 0.01em;
}
.hero-desc {
    color: rgba(219, 231, 248, 0.82);
    font-size: clamp(0.9rem, 2.4vw + 0.65rem, 1.02rem);
    line-height: 1.65;
    max-width: 34rem;
}

/* Clock card */
.clock-card {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.45);
    padding: clamp(1.25rem, 4vw, 2rem);
    width: 100%;
    max-width: 100%;
}
.clock-greet {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: clamp(0.8rem, 2vw + 0.6rem, 0.9rem);
    font-weight: 700;
    color: #ffe9a8;
}
.clock-time {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
    font-size: clamp(2.4rem, 12vw, 3.6rem);
    color: #fff;
    text-shadow: 0 4px 18px rgba(6, 182, 212, 0.35);
    overflow-wrap: anywhere;
}
.clock-date {
    color: rgba(219, 231, 248, 0.9);
    font-size: clamp(0.85rem, 2.4vw + 0.62rem, 0.98rem);
    font-weight: 600;
}
.clock-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.2);
    color: rgba(219, 231, 248, 0.75);
    font-size: 0.82rem;
    font-weight: 600;
}
.clock-meta .bi { color: var(--emerald-500); }

/* ---------- CTA Pegawai ---------- */
.cta-section { margin-top: -2.5rem; position: relative; z-index: 2; }
.cta-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 0.25rem);
    box-shadow: var(--shadow-lift);
    padding: clamp(1.25rem, 4.5vw, 2rem);
    overflow: hidden;
    position: relative;
}
.cta-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: var(--grad-brand);
}
.btn-staff {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    min-height: 56px;
    width: 100%;
    font-weight: 800;
    font-size: clamp(1rem, 2.8vw + 0.7rem, 1.15rem);
    color: #fff;
    background: var(--grad-brand);
    border: none;
    border-radius: 1rem;
    padding: 0.9rem 1.5rem;
    box-shadow: 0 14px 28px -10px rgba(29, 78, 216, 0.55);
    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
    text-decoration: none;
}
.btn-staff:hover, .btn-staff:focus-visible {
    color: #fff;
    transform: translateY(-3px);
    filter: brightness(1.06);
    box-shadow: 0 20px 36px -12px rgba(29, 78, 216, 0.6);
}
.btn-staff:active { transform: translateY(0) scale(0.99); }
.btn-staff .bi { font-size: 1.35em; transition: transform 0.25s ease; }
.btn-staff:hover .bi-arrow-right-circle-fill { transform: translateX(5px); }
.cta-note {
    color: var(--muted);
    font-size: clamp(0.82rem, 2.2vw + 0.6rem, 0.92rem);
    line-height: 1.6;
}
.cta-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.cta-steps li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: clamp(0.8rem, 2.2vw + 0.6rem, 0.9rem);
    font-weight: 600;
    color: var(--muted);
}
.cta-steps .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px; height: 26px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.12);
    color: var(--emerald-500);
    font-size: 0.75rem;
    font-weight: 800;
}

/* ---------- Feature cards ---------- */
.section-title {
    font-weight: 800;
    letter-spacing: -0.01em;
    font-size: clamp(1.15rem, 4vw + 0.8rem, 1.6rem);
    color: var(--navy-900);
}
.section-sub {
    color: var(--muted);
    font-size: clamp(0.85rem, 2.4vw + 0.62rem, 0.97rem);
}
.feature-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(1.1rem, 3.5vw, 1.6rem);
    height: 100%;
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lift);
    border-color: rgba(37, 99, 235, 0.35);
}
.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}
.feature-card:hover .feature-icon { transform: scale(1.08) rotate(-4deg); }
.fi-blue { background: rgba(37, 99, 235, 0.1); color: var(--royal-600); }
.fi-cyan { background: rgba(6, 182, 212, 0.12); color: var(--cyan-500); }
.fi-emerald { background: rgba(16, 185, 129, 0.12); color: var(--emerald-500); }
.feature-card h3 {
    font-size: clamp(0.98rem, 2.6vw + 0.68rem, 1.1rem);
    font-weight: 800;
    color: var(--navy-900);
    margin: 0;
}
.feature-card p {
    color: var(--muted);
    font-size: clamp(0.82rem, 2.2vw + 0.6rem, 0.9rem);
    line-height: 1.6;
    margin: 0;
}

/* ---------- Help strip ---------- */
.help-strip {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.07), rgba(6, 182, 212, 0.07));
    border: 1px dashed rgba(37, 99, 235, 0.35);
    border-radius: var(--radius);
    color: var(--navy-800);
    font-size: clamp(0.82rem, 2.2vw + 0.6rem, 0.92rem);
}
.help-strip .bi { color: var(--royal-600); }

/* ---------- Footer ---------- */
.portal-footer {
    margin-top: auto;
    background: var(--navy-900);
    color: rgba(219, 231, 248, 0.72);
    font-size: 0.82rem;
}
.portal-footer .foot-brand { color: #fff; font-weight: 700; }
.admin-link {
    color: rgba(219, 231, 248, 0.45);
    text-decoration: none;
    font-size: 0.76rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.25rem;
    min-height: 44px;
    transition: color 0.2s ease;
}
.admin-link:hover, .admin-link:focus-visible {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- Layout constraints ---------- */
.portal-main { flex: 1 0 auto; width: 100%; max-width: 100%; }
.wrap-narrow { max-width: 1080px; }

@media (min-width: 992px) {
    .cta-section { margin-top: -3.25rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .rise { opacity: 1; transform: none; animation: none; }
    .live-dot { animation: none; }
    .btn-staff, .feature-card, .feature-icon, .btn-staff .bi { transition: none; }
    .btn-staff:hover, .feature-card:hover { transform: none; }
}

/* ==========================================================================
   MOTION PACK — aurora, shine, ticket, marquee, reveal, ripple
   Semua animasi memakai transform/opacity agar ringan di HP.
   ========================================================================== */

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    background: var(--grad-brand);
    z-index: 1040;
    pointer-events: none;
}

/* ---------- Aurora blobs & grid di hero ---------- */
.aurora { position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.aurora span {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    will-change: transform;
}
.aurora .a1 { width: 340px; height: 340px; top: -120px; right: -80px;
    background: radial-gradient(circle, rgba(6,182,212,0.65), transparent 70%);
    animation: drift1 14s ease-in-out infinite alternate; }
.aurora .a2 { width: 300px; height: 300px; bottom: -120px; left: -70px;
    background: radial-gradient(circle, rgba(59,130,246,0.6), transparent 70%);
    animation: drift2 18s ease-in-out infinite alternate; }
.aurora .a3 { width: 200px; height: 200px; top: 40%; left: 45%;
    background: radial-gradient(circle, rgba(16,185,129,0.45), transparent 70%);
    animation: drift1 11s ease-in-out infinite alternate-reverse; }
@keyframes drift1 {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(-60px, 50px) scale(1.15); }
}
@keyframes drift2 {
    from { transform: translate(0, 0) scale(1.1); }
    to { transform: translate(70px, -45px) scale(0.95); }
}
.hero-grid-overlay {
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, #000 30%, transparent 75%);
}

/* ---------- Kilau sweep pada tombol utama ---------- */
.btn-staff { position: relative; overflow: hidden; isolation: isolate; }
.btn-staff .shine {
    position: absolute; top: 0; left: -80%;
    width: 55%; height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255,255,255,0.45), transparent);
    transform: skewX(-20deg);
    animation: shineSweep 3.2s ease-in-out infinite;
    pointer-events: none;
}
@keyframes shineSweep {
    0%, 55% { left: -80%; }
    100% { left: 140%; }
}
/* Ripple saat disentuh */
.btn-staff .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: rippleOut 0.6s ease-out forwards;
    pointer-events: none;
}
@keyframes rippleOut {
    to { transform: scale(3); opacity: 0; }
}

/* ---------- Titik dua jam berkedip lembut ---------- */
.clock-time .colon { animation: colonBlink 1s steps(1) infinite; }
@keyframes colonBlink {
    0%, 60% { opacity: 1; }
    61%, 100% { opacity: 0.25; }
}

/* ---------- Kartu mock "Presensi Tercatat" mengambang ---------- */
.ticket {
    margin-top: -1.1rem;
    margin-left: auto;
    margin-right: auto;
    width: min(92%, 340px);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 1rem;
    box-shadow: 0 20px 45px -15px rgba(2, 10, 30, 0.55);
    padding: 0.8rem 0.95rem;
    color: var(--ink);
    transform: rotate(-2deg);
    animation: floatY 5s ease-in-out infinite;
    position: relative;
    z-index: 2;
}
@keyframes floatY {
    0%, 100% { transform: rotate(-2deg) translateY(0); }
    50% { transform: rotate(-2deg) translateY(-9px); }
}
.ticket-head { display: flex; align-items: center; gap: 0.65rem; }
.ticket-avatar {
    width: 40px; height: 40px; flex-shrink: 0;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: #fff;
    background: var(--grad-brand);
    box-shadow: 0 6px 14px -4px rgba(29, 78, 216, 0.55);
}
.ticket-head strong { display: block; font-size: 0.85rem; font-weight: 800; color: var(--navy-900); }
.ticket-head small { display: block; font-size: 0.72rem; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.ticket-status {
    margin-left: auto; flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.7rem; font-weight: 800;
    color: #047857;
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 999px;
    padding: 0.28rem 0.65rem;
    white-space: nowrap;
}
.ticket-status .pulse {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--emerald-500);
    animation: pulseDot 1.6s infinite;
}
.ticket-bar {
    margin-top: 0.65rem;
    height: 6px; border-radius: 999px;
    background: rgba(15, 31, 61, 0.08);
    overflow: hidden;
}
.ticket-bar span {
    display: block; height: 100%; width: 40%;
    border-radius: 999px;
    background: var(--grad-brand);
    animation: barSlide 2.8s ease-in-out infinite;
}
@keyframes barSlide {
    0% { margin-left: 0; width: 30%; }
    50% { margin-left: 45%; width: 55%; }
    100% { margin-left: 0; width: 30%; }
}

/* ---------- Marquee strip ---------- */
.marquee {
    background: var(--grad-navy);
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
    position: relative;
}
.marquee-track {
    display: flex; gap: 0;
    width: max-content;
    animation: marqueeScroll 26s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
    display: inline-flex; align-items: center; gap: 0.55rem;
    color: rgba(219, 231, 248, 0.9);
    font-size: 0.82rem; font-weight: 700; letter-spacing: 0.03em;
    padding: 0.7rem 1.4rem;
    white-space: nowrap;
}
.marquee-track span .bi { color: var(--cyan-300); }
@keyframes marqueeScroll {
    to { transform: translateX(-50%); }
}

/* ---------- Reveal saat scroll ---------- */
[data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.22, 0.8, 0.32, 1),
                transform 0.7s cubic-bezier(0.22, 0.8, 0.32, 1);
    will-change: opacity, transform;
}
[data-reveal].revealed { opacity: 1; transform: translateY(0); }
[data-reveal="left"] { transform: translateX(-32px); }
[data-reveal="right"] { transform: translateX(32px); }
[data-reveal="left"].revealed,
[data-reveal="right"].revealed { transform: translateX(0); }
[data-reveal="zoom"] { transform: scale(0.94); }
[data-reveal="zoom"].revealed { transform: scale(1); }

/* ---------- Tilt 3D halus pada kartu jam ---------- */
.tilt { transition: transform 0.25s ease; transform-style: preserve-3d; }

/* ---------- Glow kartu fitur ---------- */
.feature-card { position: relative; overflow: hidden; }
.feature-card::after {
    content: '';
    position: absolute; inset: 0 0 auto 0; height: 4px;
    background: var(--grad-brand);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.feature-card:hover::after { opacity: 1; }
.cta-steps li { transition: transform 0.25s ease; }
.cta-steps li:hover { transform: translateX(6px); }

/* ---------- Reduced motion: matikan semua motion pack ---------- */
@media (prefers-reduced-motion: reduce) {
    .aurora span,
    .hero-title .accent,
    .btn-staff .shine,
    .clock-time .colon,
    .ticket,
    .ticket-status .pulse,
    .ticket-bar span,
    .marquee-track { animation: none; }
    .ticket { transform: rotate(-2deg); }
    [data-reveal] { opacity: 1; transform: none; transition: none; }
    .marquee-track { width: auto; flex-wrap: wrap; }
    .scroll-progress { display: none; }
}

/* ==========================================================================
   MOBILE ABOVE-THE-FOLD — hero dipadatkan agar tombol "Masuk Area Pegawai"
   langsung terlihat tanpa scroll. Hanya berlaku < lg; desktop tidak berubah.
   ========================================================================== */
@media (max-width: 991.98px) {
    .hero-title { font-size: clamp(1.6rem, 8vw, 2.05rem); }
    .hero-sub { margin-top: 0.15rem; }
    .clock-card { padding: 1rem 1.1rem; }
    .clock-time { font-size: clamp(2rem, 11vw, 2.6rem); }
    .clock-meta { margin-top: 0.6rem; padding-top: 0.6rem; }
    .cta-section { margin-top: -2rem; }
    .cta-card { padding: 1.1rem 1.1rem 1.25rem; }
    .cta-note { margin-bottom: 0.9rem; }
}
