/* DIGITAL GUESTBOOK - PUBLIC STYLESHEET 
   Khusus untuk halaman Tamu (Root Directory)
*/

:root {
    --primary-green: #2d7a5d;
    --primary-dark: #1a1d21;
    --bg-body: #f4f7f6;
    --white: #ffffff;
    --text-dark: #1a1d21;
    --text-muted: #8c8c8c;
    --danger: #ff4d4f;
    --shadow: 0 20px 40px rgba(0,0,0,0.06);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- RESET & LAYOUT DASAR --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--bg-body);
    min-height: 100vh;
    display: flex;
    align-items: center; /* Pusatkan kartu secara vertikal */
    justify-content: center; /* Pusatkan kartu secara horizontal */
    padding: 20px;
    position: relative;
    overflow: hidden; /* Mencegah scroll saat animasi sirkuit aktif */
}

/* --- KARTU TAMU (PUBLIC CARD) --- */
.guest-card {
    background-color: var(--white);
    padding: 40px 30px;
    border-radius: 35px;
    box-shadow: var(--shadow);
    text-align: center;
    max-width: 400px;
    width: 100%;
    z-index: 10;
    position: relative;
    animation: slideUp 0.7s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.guest-card h2 {
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 12px;
    font-size: 24px;
}

.guest-card p {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
}

/* --- TOMBOL AKSI --- */
.btn-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 30px;
}

.btn-confirm {
    background-color: var(--primary-green);
    color: var(--white);
    border: none;
    padding: 18px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
}

.btn-confirm:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(45, 122, 93, 0.2);
}

.btn-decline {
    background-color: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 16px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-decline:hover { background: rgba(255, 77, 79, 0.05); }

/* --- ANIMASI NETWORK TRANSFER (HP KE ATAS) --- */
.network-bridge {
    position: relative;
    height: 150px;
    width: 100px;
    margin: 10px auto 25px auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.device-icon.active {
    font-size: 45px;
    color: var(--primary-green);
    animation: glowIcon 1.5s infinite alternate;
}

.transfer-path {
    position: absolute;
    top: 55px;
    bottom: 55px;
    width: 2px;
    background: rgba(45, 122, 93, 0.1);
    overflow: hidden;
}

.data-packet {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--primary-green);
    border-radius: 50%;
    filter: blur(1px);
    animation: uploadData 1.2s infinite linear;
}

.data-packet:nth-child(2) { animation-delay: 0.4s; }
.data-packet:nth-child(3) { animation-delay: 0.8s; }

@keyframes uploadData {
    0% { top: 100%; opacity: 0; }
    30% { opacity: 1; }
    100% { top: 0%; opacity: 0; }
}

@keyframes glowIcon {
    from { filter: drop-shadow(0 0 2px var(--primary-green)); }
    to { filter: drop-shadow(0 0 12px var(--primary-green)); }
}

/* --- BACKGROUND CIRCUIT SVG --- */
.circuit-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    display: none;
    pointer-events: none;
}

body.circuit-active .circuit-container {
    display: block;
    animation: fadeInBackground 1s ease-in;
}

.circuit-line {
    stroke: var(--primary-green);
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawFlow 4s linear infinite;
    opacity: 0.3;
}

@keyframes drawFlow {
    0% { stroke-dashoffset: 1000; opacity: 0; }
    20% { opacity: 0.4; }
    80% { opacity: 0.4; }
    100% { stroke-dashoffset: 0; opacity: 0; }
}

@keyframes fadeInBackground { from { opacity: 0; } to { opacity: 1; } }

/* Input Styling */
input[type="tel"], textarea {
    width: 100%;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid #eee;
    background: #fbfbfb;
    font-size: 15px;
    outline: none;
    transition: var(--transition);
}

input:focus, textarea:focus {
    border-color: var(--primary-green);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(45, 122, 93, 0.05);
}

body.circuit-finished .circuit-line {
    animation: none !important;      /* Berhentikan animasi aliran */
    stroke-dashoffset: 0 !important; /* Tampilkan garis secara utuh */
    opacity: 0.6;                    /* Buat garis sedikit lebih jelas sebagai penanda selesai */
    transition: all 1s ease;         /* Transisi halus saat berhenti */
}

/* Pastikan container tetap muncul jika circuit-active dilepas atau diganti */
body.circuit-finished .circuit-container {
    display: block;
}