/* style.css - Tema samudra: riak air & gelembung */
:root {
    --deep: #031b34;
    --navy: #04284a;
    --ocean: #0a5c8f;
    --sea: #11a3c9;
    --foam: #bdf3ff;
    --white: #f4fcff;
    --accent: #ffb703;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; }

body {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    color: var(--white);
    background: linear-gradient(180deg, var(--sea) 0%, var(--ocean) 35%, var(--navy) 70%, var(--deep) 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* ---------- Background dinamis ---------- */
.bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.bg-image {
    position: absolute; inset: 0;
    background-size: cover; background-position: center; background-repeat: no-repeat;
}
.bg-video { position: absolute; inset: 0; }
/* Cover 16:9 di semua ukuran layar */
.bg-video iframe {
    position: absolute; top: 50%; left: 50%;
    width: 100vw; height: 56.25vw;
    min-height: 100vh; min-width: 177.78vh;
    transform: translate(-50%, -50%);
    border: 0;
}
.bg-dim {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(3, 27, 52, .55), rgba(3, 27, 52, .78));
}

/* ---------- Overlay ---------- */
.ocean {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

/* Cahaya matahari menembus air */
.ocean::before {
    content: "";
    position: absolute;
    top: -20%; left: 50%;
    width: 140%; height: 70%;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at top, rgba(189, 243, 255, .35), transparent 65%);
    animation: shimmer 8s ease-in-out infinite alternate;
}

/* Riak air: cincin membesar */
.ripples span {
    position: absolute;
    left: 50%; top: 50%;
    width: 120px; height: 120px;
    margin: -60px 0 0 -60px;
    border: 2px solid rgba(189, 243, 255, .45);
    border-radius: 50%;
    opacity: 0;
    animation: ripple 8s cubic-bezier(.2, .6, .3, 1) infinite;
}
.ripples span:nth-child(2) { animation-delay: 2s; left: 25%; top: 35%; }
.ripples span:nth-child(3) { animation-delay: 4s; left: 78%; top: 65%; }
.ripples span:nth-child(4) { animation-delay: 6s; left: 60%; top: 20%; }

/* Gelembung udara */
.bubbles i {
    position: absolute;
    bottom: -40px;
    left: var(--l);
    width: var(--s); height: var(--s);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .85), rgba(189, 243, 255, .15) 60%, transparent 70%);
    border: 1px solid rgba(255, 255, 255, .35);
    animation: rise var(--d) linear var(--dl) infinite;
    will-change: transform;
}

/* Ombak di dasar layar */
.waves { position: absolute; left: 0; right: 0; bottom: 0; height: 90px; }
.waves svg {
    position: absolute; bottom: 0; left: 0;
    width: 200%; height: 100%;
    animation: wave 14s linear infinite;
}
.waves svg:first-child { fill: rgba(189, 243, 255, .18); }
.waves svg:last-child  { fill: rgba(17, 163, 201, .25); animation-duration: 20s; animation-direction: reverse; height: 80%; }

@keyframes ripple {
    0%   { transform: scale(.3); opacity: 0; }
    15%  { opacity: .8; }
    100% { transform: scale(7); opacity: 0; }
}
@keyframes rise {
    0%   { transform: translate(0, 0) scale(.8); opacity: 0; }
    10%  { opacity: 1; }
    50%  { transform: translate(var(--x), -55vh) scale(1); }
    100% { transform: translate(calc(var(--x) * -1), -115vh) scale(1.1); opacity: 0; }
}
@keyframes wave { to { transform: translateX(-50%); } }
@keyframes shimmer { from { opacity: .5; } to { opacity: 1; } }

/* Riak saat sentuh */
.tap-ripple {
    position: fixed;
    width: 20px; height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--foam);
    border-radius: 50%;
    pointer-events: none;
    z-index: 5;
    animation: tap 1s ease-out forwards;
}
@keyframes tap { to { transform: scale(9); opacity: 0; } }

/* ---------- Splash content ---------- */
.splash { display: flex; align-items: center; justify-content: center; min-height: 100vh; }

.content {
    position: relative;
    z-index: 1;
    max-width: 720px;
    padding: 32px 22px 110px;
    text-align: center;
    animation: fadeUp 1s ease both;
}

.hook { font-size: 3rem; display: inline-block; animation: bob 3.5s ease-in-out infinite; }

/* Font dinamis dari database (--font-head / --font-body diset di index.php) */
.content h1 {
    font-family: var(--font-head, "Montserrat"), "Segoe UI", system-ui, sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 7vw, 4rem);
    line-height: 1.12;
    letter-spacing: -.01em;
    margin: 10px 0 14px;
    text-shadow: 0 4px 24px rgba(0, 20, 50, .6);
}
.content h2 {
    font-family: var(--font-body, "Open Sans"), "Segoe UI", system-ui, sans-serif;
    font-size: clamp(.95rem, 2.6vw, 1.25rem);
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--foam);
    margin-bottom: 18px;
}
.content p, .cta { font-family: var(--font-body, "Open Sans"), "Segoe UI", system-ui, sans-serif; }
.content p {
    font-size: clamp(.98rem, 2.2vw, 1.1rem);
    line-height: 1.7;
    color: rgba(244, 252, 255, .9);
    margin-bottom: 32px;
}

/* Tombol CTA */
.cta {
    display: inline-block;
    padding: 15px 38px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffd166, var(--accent));
    color: #1b2a3a;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 8px 26px rgba(255, 183, 3, .45);
    transition: transform .2s, box-shadow .2s;
    animation: pulse 2.6s ease-in-out infinite;
}
.cta:hover, .cta:focus-visible { transform: translateY(-3px) scale(1.04); box-shadow: 0 12px 32px rgba(255, 183, 3, .6); outline: none; }

@keyframes pulse {
    0%, 100% { box-shadow: 0 8px 26px rgba(255, 183, 3, .45), 0 0 0 0 rgba(255, 183, 3, .5); }
    50%      { box-shadow: 0 8px 26px rgba(255, 183, 3, .45), 0 0 0 14px rgba(255, 183, 3, 0); }
}
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-10px) rotate(6deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---------- Admin ---------- */
.admin-body { display: flex; justify-content: center; align-items: flex-start; padding: 32px 16px; min-height: 100vh; }

.panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 640px;
    padding: 30px 26px;
    border-radius: 20px;
    background: rgba(3, 27, 52, .72);
    border: 1px solid rgba(189, 243, 255, .2);
    backdrop-filter: blur(8px);
    box-shadow: 0 20px 50px rgba(0, 10, 30, .5);
}
.panel.login { max-width: 400px; margin-top: 10vh; text-align: center; }
.panel h1 { font-size: 1.6rem; margin-bottom: 18px; }
.panel .hook { font-size: 2.4rem; }

.panel label { display: block; text-align: left; font-size: .9rem; color: var(--foam); margin-bottom: 16px; }
.panel input, .panel textarea, .panel select {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(189, 243, 255, .3);
    background: rgba(255, 255, 255, .08);
    color: var(--white);
    font: inherit;
    resize: vertical;
}
.panel select option { color: #031b34; }
.panel .hint { display: block; margin-top: 6px; color: rgba(189, 243, 255, .7); }
.panel input:focus, .panel textarea:focus, .panel select:focus { outline: 2px solid var(--sea); border-color: transparent; }

.panel .cta { animation: none; width: 100%; }
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.dash-head h1 { margin: 0; }
.btn-out {
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .4);
    background: transparent;
    color: var(--white);
    cursor: pointer;
}
.btn-out:hover { background: rgba(255, 90, 90, .35); }
.actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.actions .cta { width: auto; flex: 1 1 200px; }
.btn-link { color: var(--foam); text-decoration: none; }
.btn-link:hover { text-decoration: underline; }

.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: .92rem; text-align: left; }
.alert.ok  { background: rgba(46, 204, 113, .2); border: 1px solid #2ecc71; }
.alert.err { background: rgba(231, 76, 60, .2);  border: 1px solid #e74c3c; }

@media (max-width: 480px) {
    .panel { padding: 22px 16px; }
    .cta { padding: 14px 28px; }
    .waves { height: 60px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
