/* --- IMPOR FONT --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --- VARIABEL TEMA --- */
:root {
    --usk-cyan: #12c2c4;
    --usk-cyan-dark: #0e9a9b;
    --usk-cyan-transparent: rgba(18, 194, 196, 0.2);
    --indigo: #4f46e5;
    
    /* Tema Gelap (Default) */
    --bg-main: #020617;
    --bg-card: rgba(15, 23, 42, 0.75);
    --border-color: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --input-bg: #1e293b;
    --input-placeholder: #64748b;
    --success-bg: rgba(74, 222, 128, 0.1);
    --success-text: #86efac;
    --error-bg: rgba(248, 113, 113, 0.1);
    --error-text: #fca5a5;
}

body.light-theme {
    /* Tema Terang */
    --bg-main: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.75);
    --border-color: #cbd5e1;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --input-bg: #ffffff;
    --input-placeholder: #94a3b8;
    --success-bg: rgba(34, 197, 94, 0.1);
    --success-text: #166534;
    --error-bg: rgba(239, 68, 68, 0.1);
    --error-text: #991b1b;
}

/* --- DASAR & KONFIGURASI GLOBAL --- */
* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 1rem;
    overflow: hidden;
    transition: background-color 0.4s ease-in-out;
}

.gpu-animation-background {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
    background: radial-gradient(ellipse at bottom, rgba(18,194,196,0.3) 0%, transparent 70%);
    overflow: hidden;
    perspective: 800px; /* Mengaktifkan ruang 3D */
}

/* Lapisan 1: Grid 3D yang bergerak */
.gpu-animation-background::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 200%;
    left: -25%;
    top: 0;
    background-image:
        linear-gradient(rgba(var(--usk-cyan), 0.2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--usk-cyan), 0.2) 1px, transparent 1px);
    background-size: 50px 50px;
    transform-origin: bottom center;
    transform: rotateX(65deg); /* Memutar grid untuk efek 3D */
    animation: pan-grid 20s linear infinite;
    z-index: 1;
}

@keyframes pan-grid {
    0% { background-position: 0 0; }
    100% { background-position: 0 -200px; }
}

/* Lapisan 2: Jejak cahaya yang bergerak */
.trace {
    position: absolute;
    width: 2px;
    height: 150px; /* Jejak lebih panjang */
    background: linear-gradient(to top, transparent 0%, var(--usk-cyan) 70%);
    animation: trace-flow linear infinite;
    opacity: 0;
    z-index: 2;
}

@keyframes trace-flow {
    0%   { transform: translateY(100vh); opacity: 0; }
    10%  { opacity: 0.7; }
    90%  { opacity: 0.7; }
    100% { transform: translateY(-200px); opacity: 0; }
}

/* Pengaturan acak untuk setiap jejak cahaya */
.trace:nth-child(1) { left: 5%; animation-duration: 7s; animation-delay: -1s; }
.trace:nth-child(2) { left: 10%; animation-duration: 5s; animation-delay: -3s; }
.trace:nth-child(3) { left: 15%; animation-duration: 8s; animation-delay: -5s; }
.trace:nth-child(4) { left: 20%; animation-duration: 6s; animation-delay: -2s; }
.trace:nth-child(5) { left: 25%; animation-duration: 9s; animation-delay: -6s; }
.trace:nth-child(6) { left: 30%; animation-duration: 5.5s; animation-delay: -1.5s; }
.trace:nth-child(7) { left: 35%; animation-duration: 7.5s; animation-delay: -4.5s; }
.trace:nth-child(8) { left: 40%; animation-duration: 6.5s; animation-delay: -0.5s; }
.trace:nth-child(9) { left: 45%; animation-duration: 8.5s; animation-delay: -2.5s; }
.trace:nth-child(10){ left: 50%; animation-duration: 5s; animation-delay: -5.5s; }
.trace:nth-child(11){ left: 55%; animation-duration: 7s; animation-delay: -3.5s; }
.trace:nth-child(12){ left: 60%; animation-duration: 9s; animation-delay: -1.5s; }
.trace:nth-child(13){ left: 65%; animation-duration: 6s; animation-delay: -6.5s; }
.trace:nth-child(14){ left: 70%; animation-duration: 8s; animation-delay: -0.5s; }
.trace:nth-child(15){ left: 75%; animation-duration: 5.2s; animation-delay: -4s; }
.trace:nth-child(16){ left: 80%; animation-duration: 7.2s; animation-delay: -2.8s; }
.trace:nth-child(17){ left: 85%; animation-duration: 6.2s; animation-delay: -1.2s; }
.trace:nth-child(18){ left: 90%; animation-duration: 8.2s; animation-delay: -5.2s; }
.trace:nth-child(19){ left: 95%; animation-duration: 5.8s; animation-delay: -3.8s; }
.trace:nth-child(20){ left: 100%; animation-duration: 7.8s; animation-delay: -0.8s; }


/* === KONTENER UTAMA (Tidak ada perubahan signifikan) === */
.main-container {
    width: 100%;
    max-width: 26rem;
    background: var(--bg-card);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    padding: 2.5rem;
    z-index: 10; /* Naikkan z-index agar pasti di atas background */
    animation: fade-in-up 0.7s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.4s ease;
    position: relative;
}

.logo { width: 60px; height: 60px; margin-bottom: 1.5rem; }
.header { text-align: center; margin-bottom: 2rem; }
.title { font-size: 2rem; font-weight: 700; color: var(--text-primary); }
.subtitle { margin-top: 0.5rem; color: var(--text-secondary); }
.form-container { width: 100%; display: flex; flex-direction: column; gap: 1.5rem; }
.input-label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 0.5rem; }

.reload-button {
    position: absolute;
    top: 1.5rem; /* Sejajar dengan theme switcher */
    left: 1.5rem;
    background-color: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all 0.2s ease-in-out;
}

.reload-button:hover {
    color: var(--usk-cyan);
    background-color: var(--input-bg);
}

.reload-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.reload-icon.reloading {
    transform: rotate(360deg);
}

.method-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
    background-color: var(--input-bg);
    border-radius: 0.75rem;
    padding: 0.3rem;
    border: 1px solid var(--border-color);
}


.method-selector input[type="radio"] {
    display: none;
}

.method-selector label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 2;
    transition: color 0.3s ease-in-out;
}

.method-selector .selection-indicator {
    position: absolute;
    top: 0.3rem;
    left: 0.3rem;
    width: calc(50% - 0.3rem);
    height: calc(100% - 0.6rem);
    background-color: var(--usk-cyan);
    border-radius: 0.5rem;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 10px -2px rgba(18, 194, 196, 0.4);
}

#private:checked ~ .selection-indicator { transform: translateX(0); }
#customer:checked ~ .selection-indicator { transform: translateX(100%); }

#private:checked + label,
#customer:checked + label {
    color: white;
}

.input-wrapper { position: relative; }
.input-icon { position: absolute; top: 50%; left: 1rem; transform: translateY(-50%); width: 1.25rem; height: 1.25rem; color: var(--text-secondary); pointer-events: none; }
.input-field {
    width: 100%;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.875rem 1rem 0.875rem 3rem;
    color: var(--text-primary);
    transition: all 0.2s ease-in-out;
}
.input-field::placeholder { color: var(--input-placeholder); }
.input-field:focus {
    outline: none;
    border-color: var(--usk-cyan);
    box-shadow: 0 0 0 3px var(--usk-cyan-transparent);
}

.submit-button {
    width: 100%; display: flex; justify-content: center; align-items: center;
    padding: 0.875rem 1rem; border: none; font-size: 1rem; font-weight: 600;
    border-radius: 0.75rem; color: #fff;
    background: linear-gradient(to right, var(--usk-cyan), var(--usk-cyan-dark));
    cursor: pointer;
    transition: all 0.2s ease-in-out; min-height: 48px;
    position: relative; overflow: hidden;
}
.submit-button:hover:not(:disabled) { 
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(18, 194, 196, 0.3);
}
.submit-button:disabled { background: #4b5563; cursor: not-allowed; transform: translateY(0); box-shadow: none; }
.spinner {
    display: flex; gap: 4px;
}
.spinner::before, .spinner::after { content: ''; width: 20px; height: 20px; border: 3px solid #fff; border-radius: 50%; animation: spin-pulse 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite; }
.spinner::after { animation-delay: -0.5s; }
@keyframes spin-pulse { 0%, 100% { transform: scale(0); opacity: 1; } 50% { transform: scale(1); opacity: 0; } }
.hidden { display: none; }

#message-container { margin-top: 1.5rem; padding: 1rem; border-radius: 0.75rem; text-align: center; font-weight: 500; width: 100%; transition: all 0.3s ease; }
#message-container.success { background-color: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-text); }
#message-container.error { background-color: var(--error-bg); color: var(--error-text); border: 1px solid var(--error-text); }

.theme-switcher { position: absolute; top: 1.5rem; right: 1.5rem; }
.theme-toggle-checkbox { display: none; }
.theme-toggle-label {
    background-color: var(--input-bg); border: 1px solid var(--border-color);
    width: 60px; height: 30px; border-radius: 50px;
    display: flex; align-items: center;
    padding: 4px; position: relative; cursor: pointer;
    transition: all 0.3s ease;
}
.theme-toggle-label:hover { border-color: var(--usk-cyan); }
.theme-toggle-label::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 24px; height: 24px; border-radius: 50%;
    background-color: var(--text-secondary);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease;
    z-index: 2;
}
.theme-toggle-checkbox:checked + .theme-toggle-label::after { 
    transform: translateX(30px); 
    background-color: var(--usk-cyan);
}
.theme-toggle-label .icon-wrapper { display: flex; justify-content: space-between; width: 100%; }
.sun, .moon {
    width: 18px; height: 18px; z-index: 1;
    transition: transform 0.4s ease, opacity 0.4s ease;
}
.sun { color: #facc15; }
.moon { color: #a5f3fc; }

.theme-toggle-checkbox:not(:checked) + .theme-toggle-label .moon { transform: scale(0); opacity: 0; }
.theme-toggle-checkbox:checked + .theme-toggle-label .sun { transform: scale(0); opacity: 0; }

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}