/* ============================================================
   Platform Silsilah Keluarga "Leluhur"
   Warm Textured Heritage Aesthetic — Responsive Mobile & Desktop
   Copyright (c) 2027 Khulqian Afief. All rights reserved.
   ============================================================ */

:root {
    --bg: #f6f2e8;
    --surface: #ffffff;
    --surface-soft: #efeae0;
    --primary: #1c4a38;
    --primary-hover: #143729;
    --accent: #b8860b;
    --accent-soft: #f7eed6;
    --text: #1e2622;
    --muted: #5a665f;
    --border: #dfd9cb;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --success: #146c43;
    --success-bg: #ecfdf3;
    --warning: #9a6700;
    --warning-bg: #fffbeb;
    --radius: 14px;
    --shadow: 0 8px 28px rgba(28, 74, 56, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    max-width: 100%;
    overflow-x: clip;
}

/* Latar belakang sistem dengan aksen Batik Parang di sudut + medali halus di bagian tengah */
body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg);
    background-image: linear-gradient(180deg, #faf7ef 0%, #f2ebdc 100%);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Ornamen Batik Parang di sudut kanan atas & kiri bawah */
body::before,
body::after {
    content: '';
    position: fixed;
    width: 340px;
    height: 340px;
    pointer-events: none;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%238c5e34' stroke-width='1.8' opacity='0.14'%3E%3Cpath d='M-8 16 C 8 0, 24 0, 32 16 C 40 32, 56 32, 72 16'/%3E%3Cpath d='M-8 48 C 8 32, 24 32, 32 48 C 40 64, 56 64, 72 48'/%3E%3Cpath d='M-8 32 L 72 -48 M-8 64 L 72 -16 M-8 96 L 72 16' stroke-width='0.9' opacity='0.55'/%3E%3Ccircle cx='16' cy='16' r='2.5' fill='%23b8860b'/%3E%3Ccircle cx='48' cy='48' r='2.5' fill='%23b8860b'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 54px 54px;
}

body::before {
    top: 76px;
    right: 0;
    -webkit-mask-image: radial-gradient(circle at 100% 0%, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0) 70%);
    mask-image: radial-gradient(circle at 100% 0%, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0) 70%);
}

body::after {
    bottom: 0;
    left: 0;
    -webkit-mask-image: radial-gradient(circle at 0% 100%, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0) 70%);
    mask-image: radial-gradient(circle at 0% 100%, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0) 70%);
}

/* Tambahan aksen Batik Parang halus di bagian tengah latar belakang */
.main-content::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: min(560px, 88vw);
    height: min(420px, 65vh);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%238c5e34' stroke-width='1.7' opacity='0.11'%3E%3Cpath d='M-8 16 C 8 0, 24 0, 32 16 C 40 32, 56 32, 72 16'/%3E%3Cpath d='M-8 48 C 8 32, 24 32, 32 48 C 40 64, 56 64, 72 48'/%3E%3Ccircle cx='16' cy='16' r='2.2' fill='%23b8860b'/%3E%3Ccircle cx='48' cy='48' r='2.2' fill='%23b8860b'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 54px 54px;
    -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 70%);
    mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 70%);
}

.main-content, .site-footer {
    position: relative;
    z-index: 1;
}

h1, h2, h3, .serif {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--primary);
    line-height: 1.25;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 18px;
}

/* Header & Navbar Terkunci (Fixed) dengan Aksen Batik Parang Sebagian di Ujung Kiri & Kanan */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 200;
    background: linear-gradient(180deg, rgba(252, 248, 239, 0.97) 0%, rgba(244, 237, 222, 0.96) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid #c9a75c;
    box-shadow: 0 4px 16px rgba(72, 42, 20, 0.10);
    overflow: visible;
}

.site-header::before,
.site-header::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 210px;
    pointer-events: none;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%239b6e2f' stroke-width='1.5' opacity='0.18'%3E%3Cpath d='M-6 12 C 6 0, 18 0, 24 12 C 30 24, 42 24, 54 12'/%3E%3Cpath d='M-6 36 C 6 24, 18 24, 24 36 C 30 48, 42 48, 54 36'/%3E%3Ccircle cx='12' cy='12' r='1.8' fill='%23b8860b'/%3E%3Ccircle cx='36' cy='36' r='1.8' fill='%23b8860b'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 42px 42px;
}

.site-header::before {
    left: 0;
    -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0) 100%);
    mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0) 100%);
}

.site-header::after {
    right: 0;
    -webkit-mask-image: linear-gradient(270deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0) 100%);
    mask-image: linear-gradient(270deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0) 100%);
}

.nav-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    min-height: 76px;
    padding: 6px 0;
    gap: 12px;
}

.nav-right-group {
    display: flex;
    align-items: center;
    gap: 8px;
    order: 3;
}

.nav-quick-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.nav-auth-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
}

.nav-auth-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
}

/* Logo & Wordmark Bar Atas Kiri: Tanpa Frame, Warna Seimbang & Timbul 3D */
.brand-logo-frameless {
    width: 58px;
    height: 58px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    image-rendering: -webkit-optimize-contrast;
    filter:
        brightness(1.06)
        contrast(1.04)
        saturate(1.08)
        drop-shadow(-1px -1px 0 rgba(255, 253, 245, 0.85))
        drop-shadow(2px 4px 4px rgba(72, 42, 20, 0.34))
        drop-shadow(0 1px 2px rgba(0, 0, 0, 0.16));
    transition: transform 0.25s ease, filter 0.25s ease;
}

/* Gambar tulisan LELUHUR bermotif batik di bar atas — tanpa frame & terkesan timbul 3D */
.brand-wordmark-frameless {
    height: 25px;
    width: auto;
    object-fit: contain;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    filter:
        brightness(1.06)
        contrast(1.06)
        drop-shadow(-1px -1px 0 rgba(255, 253, 246, 0.95))
        drop-shadow(2px 4px 3px rgba(72, 36, 18, 0.42))
        drop-shadow(0 1px 2px rgba(0, 0, 0, 0.20));
    transition: transform 0.25s ease;
}

.brand:hover .brand-logo-frameless {
    transform: translateY(-2px) scale(1.04);
    filter:
        brightness(1.10)
        contrast(1.05)
        saturate(1.10)
        drop-shadow(-1px -1px 0 rgba(255, 253, 245, 0.90))
        drop-shadow(3px 6px 6px rgba(72, 42, 20, 0.38));
}

/* Logo Beranda (Kanan Judul Hero): Tanpa Frame Kotak, Lebih Timbul 3D + Kilauan Cahaya */
.hero-logo-frameless-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 340px;
    padding: 12px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.hero-logo-shine-wrap {
    position: relative;
    width: min(335px, 84vw);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
    box-shadow:
        0 26px 46px rgba(48, 30, 16, 0.36),
        0 12px 20px rgba(28, 74, 56, 0.24),
        0 3px 6px rgba(0, 0, 0, 0.22),
        inset 0 4px 8px rgba(255, 255, 255, 0.75),
        inset 0 -6px 12px rgba(90, 62, 24, 0.30);
}

.hero-logo-shine-wrap::after {
    content: '';
    position: absolute;
    top: -45%;
    left: -80%;
    width: 52%;
    height: 190%;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.62) 50%, transparent 100%);
    transform: rotate(22deg);
    animation: heroLogoShimmer 4.8s ease-in-out infinite;
    pointer-events: none;
}

.hero-logo-embossed {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
    object-fit: cover;
    image-rendering: -webkit-optimize-contrast;
}

@keyframes heroLogoShimmer {
    0%, 55%  { left: -80%; }
    100%     { left: 145%; }
}

.nav-toggle {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
    order: 2;
}

.nav-links a {
    font-weight: 600;
    font-size: 0.92rem;
    padding: 8px 13px;
    border-radius: 10px;
    color: var(--text);
    transition: all 0.2s ease;
    text-decoration: none;
}

.nav-links a:not(.btn):hover,
.nav-links a:not(.btn).active {
    background: var(--surface-soft);
    color: var(--primary);
}

.nav-links a.btn-primary.active,
.nav-links a.btn-primary:hover {
    background: linear-gradient(180deg, #7d2d31 0%, #5e1f22 100%);
    color: #fffdf7 !important;
    border-color: #d4aa55;
}

/* Buttons — Desain & Warna Senada Logo Leluhur (Marun Tua, Emas Antik & Cokelat Kayu) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
    font-family: inherit;
    white-space: nowrap;
    box-shadow: 0 3px 8px rgba(72, 36, 18, 0.12);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(72, 36, 18, 0.20);
}

.btn-sm { padding: 6px 13px; font-size: 0.82rem; border-radius: 10px; }

.btn-primary {
    background: linear-gradient(180deg, #6d2629 0%, #521a1d 100%);
    border-color: #b88b3b;
    color: #fffdf7 !important;
    box-shadow: 0 4px 10px rgba(82, 26, 29, 0.24), inset 0 1px 0 rgba(255, 235, 195, 0.28);
}
.btn-primary:hover {
    background: linear-gradient(180deg, #7d2d31 0%, #5e1f22 100%);
    border-color: #d4aa55;
}

.btn-accent {
    background: linear-gradient(180deg, #c69635 0%, #9f721e 100%);
    border-color: #dfba67;
    color: #fffdf7 !important;
    box-shadow: 0 4px 10px rgba(159, 114, 30, 0.24), inset 0 1px 0 rgba(255, 245, 215, 0.38);
}
.btn-accent:hover {
    background: linear-gradient(180deg, #d3a23f 0%, #ad7d23 100%);
}

.btn-brown {
    background: linear-gradient(135deg, #8b5e34 0%, #633d1e 55%, #7c5028 100%);
    border: 1.5px solid #d4ae5a;
    color: #fff9eb !important;
    letter-spacing: 0.03em;
    box-shadow: 0 4px 10px rgba(99, 61, 30, 0.26), inset 0 1px 0 rgba(255, 238, 196, 0.35);
}
.btn-brown:hover {
    background: linear-gradient(135deg, #9a693b 0%, #734824 55%, #8c5c30 100%);
    border-color: #e6c678;
}

.btn-outline {
    background: rgba(255, 253, 247, 0.82);
    border-color: #6b2a2d;
    color: #5b1f23 !important;
    box-shadow: 0 2px 6px rgba(91, 31, 35, 0.08);
}
.btn-outline:hover {
    background: linear-gradient(180deg, #6d2629 0%, #521a1d 100%);
    border-color: #b88b3b;
    color: #fffdf7 !important;
}

.btn-ghost {
    background: #efe7d6;
    border-color: #d5c6a8;
    color: #4a3525 !important;
    box-shadow: none;
}
.btn-ghost:hover {
    background: #e3d6bc;
}

.btn-danger {
    background: linear-gradient(180deg, #c03025 0%, #991f16 100%);
    border-color: #d96b62;
    color: #fff !important;
}
.btn-danger:hover {
    background: linear-gradient(180deg, #cf372b 0%, #a82319 100%);
}

/* Main & Sections — beri jarak atas untuk header fixed */
.main-content { flex: 1; padding: 112px 0 54px; }
.section { padding: 30px 0; }
.section-header { margin-bottom: 22px; }
.section-header h2 { font-size: 1.85rem; margin-bottom: 8px; }
.section-header p { color: var(--muted); max-width: 680px; }

.text-center { text-align: center; }

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.92rem;
    font-weight: 500;
    border: 1px solid transparent;
}
.alert-success { background: var(--success-bg); color: var(--success); border-color: #a6f4c5; }
.alert-error   { background: var(--danger-bg); color: var(--danger); border-color: #fecdca; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: #fde68a; }
.alert-info    { background: #eff8ff; color: #175cd3; border-color: #b2ddff; }

/* Hero Landing */
.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 34px;
    align-items: center;
    padding: 14px 0 28px;
}

.hero-badge {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 14px;
}

.hero-title {
    font-size: clamp(1.85rem, 3.6vw, 2.95rem);
    margin-bottom: 16px;
}

.hero-narrative {
    color: var(--muted);
    font-size: 1.01rem;
    margin-bottom: 22px;
}

.hero-image-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 4px solid #fff;
}

.hero-image-card img {
    width: 100%;
    height: 360px;
    object-fit: cover;
    display: block;
}

.hero-caption {
    position: absolute;
    bottom: 14px;
    left: 14px;
    right: 14px;
    background: rgba(20, 55, 41, 0.84);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.84rem;
}

/* Auto-Rotating Quote & Hadist Box */
.quote-banner {
    background: linear-gradient(135deg, #1c4a38 0%, #265e48 100%);
    color: #fff;
    border-radius: 18px;
    padding: 26px 30px;
    margin: 18px 0 30px;
    box-shadow: var(--shadow);
}

.quote-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.82rem;
    opacity: 0.92;
}

.quote-tag {
    background: rgba(255, 255, 255, 0.16);
    padding: 4px 12px;
    border-radius: 999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.quote-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.12rem, 2.2vw, 1.48rem);
    line-height: 1.5;
    margin-bottom: 12px;
    transition: opacity 0.4s ease;
}

.quote-source {
    font-size: 0.92rem;
    color: #f7eed6;
    font-weight: 600;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.gallery-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.gallery-card img {
    width: 100%;
    height: 215px;
    object-fit: cover;
    display: block;
}

.gallery-card .caption { padding: 14px 16px; }
.gallery-card h3 { font-size: 1.06rem; margin-bottom: 4px; }
.gallery-card p { font-size: 0.88rem; color: var(--muted); }

/* Cards & Grids */
.card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.28rem;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    text-align: center !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.stat-label { font-size: 0.82rem; color: var(--muted); font-weight: 600; text-align: center; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--primary); margin-top: 4px; text-align: center; }

/* Forms & Password Eye Toggle */
.form-group { margin-bottom: 15px; }
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.89rem;
    margin-bottom: 6px;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.93rem;
    background: #fff;
    color: var(--text);
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(28, 74, 56, 0.12);
}

.password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrap .form-control {
    padding-right: 46px;
}

.toggle-pass-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 6px 8px;
    font-size: 1.05rem;
    border-radius: 6px;
    line-height: 1;
}
.toggle-pass-btn:hover { background: var(--surface-soft); color: var(--primary); }

.form-hint { font-size: 0.81rem; color: var(--muted); margin-top: 5px; display: block; }
.auth-box { max-width: 520px; margin: 16px auto; }
.login-footer-links {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    flex-wrap: wrap;
    gap: 8px;
}

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 10px 11px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: var(--surface-soft); color: var(--primary); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:hover td { background: #fcfbf8; }

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.77rem;
    font-weight: 600;
}
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-gold  { background: var(--accent-soft); color: var(--accent); }
.badge-gray  { background: var(--surface-soft); color: var(--muted); }
.badge-red   { background: var(--danger-bg); color: var(--danger); }

/* ============================================================
   Pohon Silsilah Akar Organik (Garis Tebal Tak Terputus, Tanpa Ikon)
   ============================================================ */
.tree-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: var(--surface-soft);
    border-radius: 10px;
    border: 1px solid var(--border);
}

/* Frame Luar Batik Sulur & Kawung Organik (Luas, Lembut, Tidak Kaku) + Background Bertekstur Halus */
.tree-batik-frame {
    position: relative;
    padding: 8px;
    border-radius: 22px;
    border: 1.5px solid rgba(184, 134, 11, 0.34);
    background: linear-gradient(145deg, #fbf7ee 0%, #f3ead7 100%);
    box-shadow:
        0 8px 24px rgba(74, 52, 31, 0.09),
        inset 0 0 0 1px rgba(255, 255, 255, 0.8);
    overflow: hidden;
}

.tree-batik-frame .batik-corner {
    position: absolute;
    width: 118px;
    height: 118px;
    background-image: url('../images/batik-corner-ornament.svg');
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 4;
    opacity: 0.72;
}

.tree-batik-frame .batik-corner.tl { top: 6px; left: 6px; }
.tree-batik-frame .batik-corner.tr { top: 6px; right: 6px; transform: scaleX(-1); }
.tree-batik-frame .batik-corner.bl { bottom: 6px; left: 6px; transform: scaleY(-1); }
.tree-batik-frame .batik-corner.br { bottom: 6px; right: 6px; transform: scale(-1, -1); }

.tree-viewport {
    position: relative;
    width: 100%;
    overflow: auto;
    min-height: 320px;
    max-height: 78vh;
    background-color: #faf6ec;
    background-image:
        radial-gradient(ellipse at center, rgba(255, 254, 250, 0.5) 0%, rgba(235, 225, 204, 0.22) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%239c8663' stroke-width='0.5' opacity='0.06'%3E%3Cpath d='M0 6h120M0 18h120M0 30h120M0 42h120M0 54h120M0 66h120M0 78h120M0 90h120M0 102h120M0 114h120'/%3E%3Cpath d='M6 0v120M18 0v120M30 0v120M42 0v120M54 0v120M66 0v120M78 0v120M90 0v120M102 0v120M114 0v120'/%3E%3C/g%3E%3Cg fill='%238a7250' opacity='0.07'%3E%3Ccircle cx='14' cy='22' r='0.9'/%3E%3Ccircle cx='47' cy='11' r='0.7'/%3E%3Ccircle cx='88' cy='29' r='0.8'/%3E%3Ccircle cx='28' cy='61' r='0.8'/%3E%3Ccircle cx='71' cy='53' r='0.9'/%3E%3Ccircle cx='105' cy='77' r='0.7'/%3E%3Ccircle cx='19' cy='98' r='0.8'/%3E%3Ccircle cx='62' cy='109' r='0.9'/%3E%3Ccircle cx='96' cy='101' r='0.7'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 100% 100%, 120px 120px;
    border: 1px solid rgba(196, 154, 62, 0.32);
    border-radius: 16px;
    padding: 26px 20px;
    box-shadow: inset 0 0 18px rgba(92, 62, 30, 0.05);
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
    .tree-batik-frame {
        padding: 6px;
        border-radius: 16px;
    }
    .tree-batik-frame .batik-corner {
        width: 78px;
        height: 78px;
        opacity: 0.62;
    }
}

.tree-stage {
    position: relative;
    z-index: 2;
    margin: 0 auto;
    overflow: visible;
}

.tree-canvas {
    position: relative;
    display: inline-block;
    transform-origin: 0 0;
    will-change: transform;
}

.root-tree-svg {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 1;
}

.root-tree-dom {
    position: relative;
    z-index: 2;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

.root-branch-ul {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 24px;
    list-style: none;
    padding-top: 48px;
    margin: 0;
}

.root-branch-ul.root-top {
    padding-top: 0;
}

.root-branch-li {
    display: flex;
    flex-direction: column;
    align-items: center;
    list-style: none;
    position: relative;
}

/* Desain Foto Profil Bulat + Label Nama & Keterangan di Depan Bagian Bawah */
.tree-couple {
    display: inline-flex;
    align-items: flex-start;
    gap: 0;
    background: rgba(255, 253, 247, 0.58);
    border: 1px solid rgba(201, 167, 92, 0.45);
    border-radius: 26px;
    padding: 10px 12px 8px;
    box-shadow: 0 4px 14px rgba(74, 52, 31, 0.08);
    position: relative;
}

.couple-link-bar {
    display: inline-block;
    width: 28px;
    height: 3px;
    margin-top: 44px;
    background: transparent;
    flex-shrink: 0;
}

.couple-link-bar.divorced {
    background: transparent;
}

.tree-node-btn {
    position: relative;
    background: transparent;
    border: none;
    padding: 0 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 126px;
    max-width: 162px;
    color: var(--primary);
}

.tree-node-btn:hover {
    transform: translateY(-3px);
}

.tree-avatar-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #27634b 0%, #163b2d 100%);
    border: 3px solid #1c4a38;
    box-shadow:
        0 0 0 2.5px #d4af37,
        0 8px 18px rgba(28, 74, 56, 0.24);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.tree-node-btn:hover .tree-avatar-circle {
    border-color: #d4af37;
    box-shadow:
        0 0 0 3px #1c4a38,
        0 10px 22px rgba(28, 74, 56, 0.34);
}

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

.tree-avatar-initial {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.65rem;
    font-weight: 700;
    color: #fff8e7;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.tree-avatar-caption {
    position: relative;
    z-index: 3;
    margin-top: -22px;
    width: 100%;
    background: linear-gradient(180deg, rgba(255, 254, 250, 0.98) 0%, rgba(247, 241, 227, 0.98) 100%);
    border: 1.5px solid #b8860b;
    border-radius: 12px;
    padding: 5px 10px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    box-shadow:
        0 4px 12px rgba(28, 74, 56, 0.16),
        0 1px 3px rgba(0, 0, 0, 0.08);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tree-node-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 0.82rem;
    line-height: 1.24;
    color: var(--primary);
    text-align: center;
    word-break: break-word;
}

.tree-node-btn:hover .tree-avatar-caption {
    background: linear-gradient(180deg, #1f533f 0%, #163b2d 100%);
    border-color: #e0b956;
}

.tree-node-btn:hover .tree-node-name,
.tree-node-btn:hover .tree-node-sub {
    color: #fffdf7;
}

.tree-node-btn.deceased .tree-avatar-circle {
    background: linear-gradient(145deg, #876c50 0%, #5c4632 100%);
    border-color: #7d6245;
    box-shadow:
        0 0 0 2.5px #b99f7d,
        0 6px 14px rgba(74, 52, 31, 0.2);
}

.tree-node-btn.deceased .tree-avatar-img {
    filter: grayscale(28%) contrast(1.02);
}

.tree-node-btn.deceased .tree-avatar-caption {
    background: linear-gradient(180deg, rgba(248, 244, 235, 0.98) 0%, rgba(235, 226, 208, 0.98) 100%);
    border-color: #7d6245;
}

.tree-node-btn.deceased .tree-node-name {
    color: #42352a;
}

.tree-node-btn.deceased:hover .tree-avatar-caption {
    background: linear-gradient(180deg, #5c4632 0%, #443323 100%);
    border-color: #d4af37;
}

.tree-node-btn.deceased:hover .tree-node-name,
.tree-node-btn.deceased:hover .tree-node-sub {
    color: #fffdf7;
}

.tree-node-sub {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--muted);
    line-height: 1.2;
}

/* Modal Popup */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 29, 24, 0.58);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px 14px;
    overflow-y: auto;
    z-index: 9999;
}

.modal-backdrop.open {
    display: flex;
}

.modal-card {
    background: var(--surface);
    border-radius: 16px;
    max-width: 560px;
    width: 100%;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 22px 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
    border: 1px solid var(--border);
    position: relative;
    margin: auto;
}

.modal-biodata-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.89rem;
}

.modal-biodata-table th {
    width: 37%;
    padding: 8px 10px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.modal-biodata-table td {
    width: 63%;
    padding: 8px 10px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--surface-soft);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.modal-close:hover { background: #e0d9ca; }

.modal-card h2,
.modal-card h3,
#modalMemberName {
    padding-right: 42px;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.3;
}

/* Avatar */
.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    background: var(--surface-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.admin-tabs a {
    padding: 8px 13px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 0.86rem;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
}

.admin-tabs a.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.stars { color: #d97706; letter-spacing: 2px; font-size: 1.02rem; }

/* 2 Tombol Melayang yang Bisa Digeser-geser — Ukuran Sama Persis & Efek Timbul 3D */
.floating-drag-btn {
    position: fixed;
    bottom: 64px;
    z-index: 950;
    width: 178px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    border-radius: 999px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.84rem;
    color: #fffdf7 !important;
    text-decoration: none !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.38);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
    border: 1.5px solid #e6c675;
    border-bottom-width: 4px;
    box-shadow:
        0 14px 28px rgba(48, 22, 10, 0.40),
        0 6px 12px rgba(0, 0, 0, 0.24),
        0 2px 3px rgba(0, 0, 0, 0.18),
        inset 0 2px 1px rgba(255, 248, 222, 0.55),
        inset 0 -3px 5px rgba(0, 0, 0, 0.24);
    transition: box-shadow 0.18s ease, transform 0.15s ease;
}

.floating-drag-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 18px 34px rgba(48, 22, 10, 0.46),
        0 8px 14px rgba(0, 0, 0, 0.26),
        inset 0 2px 2px rgba(255, 248, 222, 0.65),
        inset 0 -3px 5px rgba(0, 0, 0, 0.24);
}

.floating-drag-btn:active:not(.is-dragging) {
    transform: translateY(1px);
    box-shadow:
        0 6px 14px rgba(48, 22, 10, 0.34),
        0 2px 5px rgba(0, 0, 0, 0.22),
        inset 0 1px 1px rgba(255, 248, 222, 0.40);
}

.floating-drag-btn.is-dragging {
    cursor: grabbing;
    opacity: 0.95;
    box-shadow:
        0 22px 38px rgba(48, 22, 10, 0.48),
        0 10px 16px rgba(0, 0, 0, 0.26),
        inset 0 2px 2px rgba(255, 248, 222, 0.60);
}

.floating-feedback {
    left: 20px;
    background: linear-gradient(180deg, #7f2d31 0%, #5e1d20 65%, #491518 100%);
    border-bottom-color: #3a1012;
}

.floating-install {
    right: 20px;
    background: linear-gradient(180deg, #9d6c3d 0%, #734824 65%, #593518 100%);
    border-bottom-color: #422610;
}

.float-ico {
    font-size: 1rem;
    line-height: 1;
    pointer-events: none;
}

.float-logo-ico {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.float-lbl {
    pointer-events: none;
}

@media (max-width: 440px) {
    .floating-drag-btn {
        width: 156px;
        height: 42px;
        font-size: 0.78rem;
        padding: 0 10px;
    }
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.92);
    padding: 18px 0;
    font-size: 0.86rem;
    color: var(--muted);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.copyright { font-weight: 600; color: var(--primary); }

/* Responsive Layar HP & Tablet */
@media (max-width: 900px) {
    .hero-grid, .gallery-grid, .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    .hero-grid {
        text-align: center;
        gap: 18px;
        padding-top: 4px;
    }
    .hero-grid > div {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .hero-title {
        width: 100%;
        text-align: center;
    }
    .hero-narrative {
        width: 100%;
        text-align: justify;
        text-justify: inter-word;
    }
    .hero-grid .grid-3 {
        width: 100%;
    }
    .hero-logo-frameless-stage {
        order: -1;
        min-height: auto;
        padding: 4px 12px 6px;
    }
    .hero-image-card img { height: 250px; }
    .nav-wrap { min-height: 68px; gap: 8px; flex-wrap: nowrap; }
    .nav-toggle { display: inline-flex; }
    .nav-icon-btn {
        padding: 8px 10px;
        min-width: 38px;
        min-height: 38px;
    }
    .nav-icon-btn .nav-btn-text { display: none; }
    /* Dropdown meluncur di bawah bar atas TANPA menggeser/mengubah tinggi bar atas */
    .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 2px);
        left: -18px;
        right: -18px;
        width: auto;
        margin-left: 0;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 16px 18px 18px;
        background: rgba(250, 246, 236, 0.98);
        border-bottom: 2px solid #c9a75c;
        box-shadow: 0 14px 28px rgba(72, 42, 20, 0.16);
        gap: 10px;
        z-index: 250;
    }
    .nav-links.open { display: flex; }
    .nav-links a, .nav-links .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
        text-align: center;
    }
    .login-footer-links {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 10px;
    }
    .nav-auth-stack { width: 100%; }
    .nav-auth-row { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .main-content { padding-top: 94px; }
    .card { padding: 16px; }
    .quote-banner { padding: 20px 18px; }
    .tree-viewport { max-height: 62vh; padding: 16px 10px; }
    .tree-toolbar { flex-direction: column; align-items: stretch; }
    .admin-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 10px; }
    .admin-tabs a { flex-shrink: 0; }
    .footer-inner { flex-direction: column; text-align: center; }
    .form-control { font-size: 16px; }
}

@media (max-width: 520px) {
    .container { padding: 0 14px; }
    .brand { gap: 8px; }
    .brand-logo-frameless { width: 44px; height: 44px; }
    .brand-wordmark-frameless { height: 19px; }
    .hero-logo-shine-wrap { width: min(230px, 72vw); }
    .hero-logo-frameless-stage { min-height: auto; padding: 6px 0 4px; }
    .hero-title { font-size: 1.7rem; }
    .btn { padding: 9px 14px; font-size: 0.88rem; }
    .modal-card { padding: 18px 16px; }
}
