:root {
    --tema: #145233; /* Warna default awal */
}

/* ==============================
BODY
============================== */

body {
    background: #0f0f14;
    color: #ffffff;
    font-family: system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* ==============================
HEADER
============================== */

.header {
    background: linear-gradient(180deg, var(--tema), #0f0f14);
    padding: 25px 18px;
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    color: #ffffff;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding-top: calc(15px + env(safe-area-inset-top));
}

/* ==============================
CONTAINER
============================== */

.container {
    padding: 15px;
    max-width: 500px;
    margin: auto;
    margin-top: -15px; /* Menempelkan sedikit ke header agar flow warna gradasi menyatu */
}

/* ==============================
CARD
============================== */

.card {
    background: rgba(255, 255, 255, 0.05); /* Hitam transparan agar aura tema terlihat */
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 18px;
    margin-bottom: 16px;
    color: #ffffff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 3px solid var(--tema); /* Aksen warna dinamis di bawah kartu */
}

.card h3 {
    margin-top: 0;
    color: var(--tema); /* Judul dalam card ikut warna tema */
}

.card label {
    font-size: 14px;
    font-weight: bold;
    color: var(--tema); /* Label input ikut warna tema */
    display: block;
    margin-bottom: 8px;
}

/* ==============================
FORM
============================== */

select,
textarea,
input[type="text"] {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--tema); /* Border dinamis */
    background: #12161c;
    color: #ffffff;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

select:focus,
textarea:focus {
    box-shadow: 0 0 8px var(--tema);
}

textarea {
    resize: none;
    min-height: 80px;
}

/* ==============================
BUTTON
============================== */

button {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    margin-top: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

button:active {
    transform: scale(0.96);
}

/* tombol utama (Selfie) */
.btn-primary {
    background: var(--tema);
    color: #ffffff;
    font-weight: bold;
}

/* tombol outline (Bukti) */
.btn-outline {
    background: transparent;
    border: 2px solid var(--tema);
    color: #ffffff;
    font-weight: bold;
}

/* tombol submit */
.btn-submit {
    background: var(--tema);
    color: #ffffff;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    margin-top: 20px;
}

/* ==============================
PREVIEW FOTO
============================== */

.preview img {
    width: 100%;
    border-radius: 15px;
    margin-top: 12px;
    border: 2px solid var(--tema);
    object-fit: cover;
}

/* ==============================
WAKTU & SAPAAN
============================= */

#sapaan {
    font-size: 20px;
    font-weight: bold;
    color: var(--tema); /* Sapaan (Selamat Sore dll) jadi dinamis */
    margin-bottom: 5px;
}

#waktuSekarang {
    font-size: 26px;
    font-weight: bold;
    margin-top: 5px;
    letter-spacing: 1px;
}

/* ==============================
CHIP
============================== */

.opsi-chip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.chip {
    padding: 8px 18px;
    border-radius: 25px;
    border: 2px solid var(--tema);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    color: white;
}

.chip.active {
    background: var(--tema);
    color: #ffffff;
}

/* ==============================
CAMERA UI (Full Screen)
============================== */

#cameraUI {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    z-index: 9999;
    display: none;
}

#camera {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==============================
CAMERA CONTROLS
============================== */

.camera-controls {
    position: absolute;
    bottom: 40px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ==============================
SHOOT BUTTON
============================== */

#btnShoot {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    border: 6px solid var(--tema); /* Border tombol shoot dinamis */
    cursor: pointer;
    padding: 0;
    margin: 0;
}

/* ==============================
ACTION BUTTONS (Close & Switch)
============================== */

#btnCloseCam, 
#btnSwitchCam {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 20px;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(255,255,255,0.2);
}

#btnCloseCam { top: 30px; left: 20px; }
#btnSwitchCam { top: 30px; right: 20px; }


#pwa-install-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: #ffffff;
    color: #333;
    padding: 15px;
    border-radius: 15px;
    z-index: 10000;
    display: none; /* Sembunyi secara default */
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border: 2px solid var(--tema);
}
.pwa-arrow {
    text-align: center;
    font-size: 24px;
    color: var(--tema);
    margin-top: 5px;
    animation: bounce 2s infinite;
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(10px);}
    60% {transform: translateY(5px);}
}

/* ==============================
CANVAS & OTHERS
============================== */

canvas {
    display: none;
}