<?php
ob_start();
session_start();
date_default_timezone_set("Asia/Jakarta");
include('../config/koneksi.php');

// Ambil data dari tb_seo
$sql_0 = mysqli_query($conn, "SELECT * FROM `tb_seo` WHERE cuid = 1") or die(mysqli_error($conn));
$s0 = mysqli_fetch_array($sql_0);

// Update URL ke folder baru ganteng
$urlweb  = $s0['urlweb'] . '/kerbau';
$urlwebs = $s0['urlweb'];
?>
<!DOCTYPE html>
<html lang="en" class="light-style customizer-hide" dir="ltr"
  data-theme="theme-default"
  data-assets-path="<?php echo $urlweb; ?>/assets/"
  data-template="vertical-menu-template"
>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo htmlspecialchars($s0['instansi']); ?></title>
    <meta name="description" content="">
    <meta name="keywords" content="">
    <link rel="icon" type="image/x-icon" href="<?php echo $urlwebs; ?>/upload/favicon.png" />

    <!-- Fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
    <link href="https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700&display=swap" rel="stylesheet" />

    <!-- Icons -->
    <link rel="stylesheet" href="<?php echo $urlweb; ?>/assets/vendor/fonts/fontawesome.css" />
    <link rel="stylesheet" href="<?php echo $urlweb; ?>/assets/vendor/fonts/tabler-icons.css" />
    <link rel="stylesheet" href="<?php echo $urlweb; ?>/assets/vendor/fonts/flag-icons.css" />

    <!-- Core CSS -->
    <link rel="stylesheet" href="<?php echo $urlweb; ?>/assets/vendor/css/rtl/core.css" />
    <link rel="stylesheet" href="<?php echo $urlweb; ?>/assets/vendor/css/rtl/theme-default.css" />
    <link rel="stylesheet" href="<?php echo $urlweb; ?>/assets/css/demo.css" />

    <!-- Vendors CSS -->
    <link rel="stylesheet" href="<?php echo $urlweb; ?>/assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.css" />
    <link rel="stylesheet" href="<?php echo $urlweb; ?>/assets/vendor/libs/node-waves/node-waves.css" />
    <link rel="stylesheet" href="<?php echo $urlweb; ?>/assets/vendor/libs/typeahead-js/typeahead.css" />
    <link rel="stylesheet" href="<?php echo $urlweb; ?>/assets/vendor/libs/formvalidation/dist/css/formValidation.min.css" />

    <!-- Page CSS -->
    <link rel="stylesheet" href="<?php echo $urlweb; ?>/assets/vendor/css/pages/page-auth.css" />

    <!-- Helpers & Config -->
    <script src="<?php echo $urlweb; ?>/assets/vendor/js/helpers.js"></script>
    <script src="<?php echo $urlweb; ?>/assets/js/config.js"></script>
  </head>
  <style> 
       html, body {
    background: radial-gradient(circle at top, #021a36 0%, #000C2E 80%);
    height: auto;
    min-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

.auth-wrapper {
    min-height: 100vh;
    height: auto;
}

        /* efek partikel bokeh */
        .auth-wrapper::before {
            content: "";
            position: absolute;
            width: 100%;
            height: 100%;
            background: url('https://i.ibb.co/4ffGQ7G/particles.gif') center/cover no-repeat;
            opacity: 0.15;
            z-index: 0;
        }

        .auth-box {
            background: rgba(0, 20, 50, 0.85);
            border: 1px solid rgba(0, 123, 255, 0.3);
            box-shadow: 0 0 20px rgba(0, 180, 255, 0.3);
            border-radius: 20px;
            padding: 40px;
            position: relative;
            z-index: 1;
            animation: fadeIn 1.2s ease;
            backdrop-filter: blur(8px);
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(30px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .logo img {
            width: 150px;
            margin-bottom: 15px;
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }

        h5 {
            color: #00e5ff;
            text-shadow: 0 0 10px #00e5ff;
        }

        .input-group-text {
            background: linear-gradient(180deg, #022b4a, #024e7a);
            border-color: #00aaff;
            box-shadow: 0 0 8px rgba(0, 170, 255, 0.6);
        }

        .input-group .form-control {
            background: rgba(255,255,255,0.08);
            border: 1px solid rgba(255,255,255,0.2);
            color: #fff;
            font-size: 16px;
            transition: 0.3s;
        }

        .input-group .form-control:focus {
            border-color: #00e5ff;
            box-shadow: 0 0 10px #00e5ff;
        }

        .btn-info {
            background: linear-gradient(90deg, #005C97, #363795);
            border: none;
            color: #fff;
            box-shadow: 0 0 15px rgba(0,180,255,0.4);
            transition: all 0.3s ease-in-out;
        }

        .btn-info:hover {
            background: linear-gradient(90deg, #2196F3, #00BCD4);
            box-shadow: 0 0 20px rgba(0,220,255,0.6);
            transform: scale(1.03);
        }

        .ti-user, .ti-lock {
            color: #00e5ff;
        }

        ::placeholder {
            color: rgba(255,255,255,0.6);
        }

        /* efek glow di tombol */
        button:focus {
            outline: none;
            box-shadow: 0 0 10px #00e5ff;
        }

        /* animasi preloader */
        .preloader {
            background: #000C2E;
        }

        .lds-ripple div {
            border-color: #00e5ff !important;
        }

        /* untuk layar kecil */
        @media (max-width: 480px) {
            .auth-box {
                width: 90%;
                padding: 25px;
            }
        }
        /* === TEKS LED BERGERAK === */
.led-text {
  text-align: center;
  font-weight: bold;
  font-size: 22px;
  color: yellow;
  text-shadow:
    0 0 5px red,
    0 0 50px red,
    0 0 20px yellow,
    0 0 40px black;
  animation: ledGlow 1.5s infinite alternate, moveText 6s ease-in-out infinite;
  position: relative;
}

@keyframes ledGlow {
  0% { text-shadow: 0 0 5px red, 0 0 10px red, 0 0 20px yellow, 0 0 40px orange; color: yellow; }
  50% { text-shadow: 0 0 10px yellow, 0 0 20px red, 0 0 40px orange, 0 0 60px red; color: red; }
  100% { text-shadow: 0 0 5px red, 0 0 10px yellow, 0 0 20px orange, 0 0 40px yellow; color: yellow; }
}

@keyframes moveText {
  0% { left: -10px; }
  50% { left: 10px; }
  100% { left: -10px; }
}

/* === GAYA LIST === */
.led-text li {
  list-style: none;
  color: white;
  font-size: 16px;
  text-shadow: 0 0 5px red;
}

/* === TOMBOL === */
.tombol-menu {
  border: none;
  color: white;
  padding: 12px 24px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 10px;
  cursor: pointer;
  border-radius: 25px;
  font-weight: bold;
  transition: 0.3s;
}

.tombol-wa {
  background-color: red; /* tombol WhatsApp merah */
}
.tombol-wa:hover {
  background-color: darkred;
  transform: scale(1.05);
}

.tombol-tg {
  background-color: blue; /* tombol Telegram biru */
}
.tombol-tg:hover {
  background-color: darkblue;
  transform: scale(1.05);
}

.container {
  text-align: center;
  margin-top: 30px;
}
/* === EFEK NAGA TERBANG === */
.naga {
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  animation: nagaTerbang 8s ease-in-out infinite;
  z-index: 1;
  filter: drop-shadow(0 0 10px red);
}

@keyframes nagaTerbang {
  0% { top: -150px; transform: translateX(-50%) rotate(10deg); }
  50% { top: 80%; transform: translateX(-50%) rotate(-10deg); }
  100% { top: -150px; transform: translateX(-50%) rotate(10deg); }
}
 @media (max-width: 600px) {
  .led-text {
    font-size: 16px;
  }
  .led-text li {
    font-size: 14px;
  }
  .tombol-menu {
    font-size: 15px;
    padding: 10px;
  }
  .naga {
    width: 350px;
  }
}
 
 .layout-wrapper,
.layout-page,
.layout-content,
.content-wrapper {
    height: auto !important;
    overflow: visible !important;
}

    </style>
</head>

<body>
    <div class="main-wrapper"> 
        <div class="preloader">
            <div class="lds-ripple">
                <div class="lds-pos"></div>
                <div class="lds-pos"></div>
            </div>
        </div>

        <div class="auth-wrapper d-flex justify-content-center align-items-center">
            <div class="auth-box text-center">
                <div id="loginform">
                    <div class="logo">
                        <span class="db">
                            <img src="/assets/images/big/o.gif" alt="<?php echo $title ?>">
                        </span>
                        <h5 class="font-medium m-b-20">Only Login For Administrator</h5>
                    </div>
                    <!-- Notifikasi error -->
              <?php
              error_reporting(0);
              $err = $_GET['error'] ?? '';
              $errors = [
                '1' => 'Username dan Password wajib diisi!',
                '2' => 'Username salah!',
                '3' => 'Password salah!',
                '4' => 'Username dan Password tidak cocok!',
                '5' => 'Akun Anda login di perangkat lain!',
                '6' => 'Akun belum aktif, silakan hubungi admin!'
              ];
              if (!empty($errors[$err])) {
                echo '
                <div class="alert alert-warning d-flex align-items-center" role="alert">
                  <span class="alert-icon text-warning me-2"><i class="ti ti-bell ti-xs"></i></span>
                  <span><strong>Warning!</strong> ' . $errors[$err] . '</span>
                </div>';
              }
              ?>

              <!-- Form Login -->
              <form id="formAuthentication" class="mb-3" action="<?php echo $urlweb; ?>/login-proses.php" method="POST">
                <div class="mb-3">
                  <label for="email" class="form-label text-white">Username</label>
                  <input type="text" class="form-control" id="email" name="user" placeholder="Masukkan username" autofocus />
                </div>
                <div class="mb-3 form-password-toggle">
                  <div class="mb-3 form-password-toggle">
  <label class="form-label text-white" for="password">Password</label>
  <div class="input-group input-group-merge">
    <input type="password" id="password" class="form-control" name="pass"
      placeholder="••••••••••••" />
      
    <span class="input-group-text cursor-pointer" id="togglePassword">
      <i class="ti ti-eye-off" id="iconEye"></i>
    </span>
  </div>
</div>
                    
                <div class="form-group text-center">
                            <button class="btn btn-block btn-lg btn-info" name="login" type="submit" onclick="bunyi();">LOGIN</button>
                        </div>
                    </form>
                    </div>
          <img src="<?php echo $urlwebs; ?>/upload/naga1.gif" alt="Naga Terbang" class="naga">

<!-- ✨ Teks LED -->
<div class="led-text">
  <p>SITUS INI DI JUAL/SEWA</p>
  <li>HUBUNGI KONTAK KAMI DI BAWAH</li>
  <li>SELAIN KONTAK DI BAWAH</li>
  <li>HATI-HATI OKNUM PENIPU</li>
</div>

<div class="container">
  <a href="https://wa.me/6285799478550" class="tombol-menu tombol-wa">WHATSAPP</a>
  <a href="https://t.me/bah_abas" class="tombol-menu tombol-tg">TELEGRAM</a>
</div>
       </div>
            </div>
          </div>
          <!-- /Login -->
        </div>
      </div>
    </div>
    <!-- / Content -->
    <script>
    function bunyi() {
        var bel = new Audio('https://www.meramukoding.com/wp-content/uploads/2020/05/doorbell.mp3');
        bel.play();
    }

    function validasi() {
        var username = document.getElementById("username").value;
        var password = document.getElementById("password").value;       
        if (username != "" && password != "") {
            return true;
        } else {
            alert('Username dan Password harus di isi!');
            return false;
        }
    }
    
document.getElementById("togglePassword").addEventListener("click", function () {
    const password = document.getElementById("password");
    const icon = document.getElementById("iconEye");

    if (password.type === "password") {
        password.type = "text";
        icon.classList.remove("ti-eye-off");
        icon.classList.add("ti-eye");
    } else {
        password.type = "password";
        icon.classList.remove("ti-eye");
        icon.classList.add("ti-eye-off");
    }
});
</script>

    <!-- Core JS -->
    <script src="<?php echo $urlweb; ?>/assets/vendor/libs/jquery/jquery.js"></script>
    <script src="<?php echo $urlweb; ?>/assets/vendor/libs/popper/popper.js"></script>
    <script src="<?php echo $urlweb; ?>/assets/vendor/js/bootstrap.js"></script>
    <script src="<?php echo $urlweb; ?>/assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.js"></script>
    <script src="<?php echo $urlweb; ?>/assets/vendor/libs/node-waves/node-waves.js"></script>
    <script src="<?php echo $urlweb; ?>/assets/vendor/js/menu.js"></script>

    <!-- FormValidation -->
    <script src="<?php echo $urlweb; ?>/assets/vendor/libs/formvalidation/dist/js/FormValidation.min.js"></script>
    <script src="<?php echo $urlweb; ?>/assets/vendor/libs/formvalidation/dist/js/plugins/Bootstrap5.min.js"></script>
    <script src="<?php echo $urlweb; ?>/assets/vendor/libs/formvalidation/dist/js/plugins/AutoFocus.min.js"></script>

    <!-- Main JS -->
    <script src="<?php echo $urlweb; ?>/assets/js/main.js"></script>
    <script src="<?php echo $urlweb; ?>/assets/js/pages-auth.js"></script>
  </body>
</html>