/* =====================================================================
   Website Pendaftaran Lomba — Stylesheet utama
   Sistem desain: warna, tipografi, komponen, layout, responsif.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Warna — Merah Marun Minang & Emas/Oranye Maskot */
  --primary: #581212;       /* merah marun Minang — brand utama */
  --primary-dark: #2d0b0b;
  --primary-light: #fff5f5;
  --accent: #f58220;         /* oranye harimau */
  --accent-dark: #c9660e;
  --accent-light: #fff7ed;
  --gold: #d4af37;           /* emas songket / piala */
  --gold-light: #fffbf0;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --warning: #d97706;
  --warning-bg: #fef3c7;

  --bg: #faf6f6;
  --surface: #ffffff;
  --text: #231515;
  --text-muted: #755a5a;
  --border: #eedada;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(88, 18, 18, 0.08), 0 1px 2px rgba(88, 18, 18, 0.04);
  --shadow-md: 0 4px 12px rgba(88, 18, 18, 0.08);
  --container: 1080px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Inter', "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3 { font-family: 'Outfit', sans-serif; line-height: 1.25; color: var(--text); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

a { color: var(--primary); }

/* ---------------------------------------------------------------------
   Navbar
   --------------------------------------------------------------------- */
.navbar {
  background: var(--surface);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}
.navbar-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}
.brand .logo {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--primary);
  color: #fff;
  border-radius: 9px;
  font-size: 1.05rem;
}
.nav-links { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--primary); }

/* ---------------------------------------------------------------------
   Layout
   --------------------------------------------------------------------- */
.container { max-width: var(--container); margin: 0 auto; padding: 1.75rem 1.25rem; }
.page-head { margin-bottom: 1.25rem; }
.page-head p { color: var(--text-muted); margin: 0.25rem 0 0; }

.section { margin-bottom: 2rem; }
.section > h2 { margin: 0 0 1rem; }

footer.site-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 1.5rem;
}

/* ---------------------------------------------------------------------
   Card
   --------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

/* ---------------------------------------------------------------------
   Form
   --------------------------------------------------------------------- */
form { display: grid; gap: 1rem; }
label { display: grid; gap: 0.35rem; font-size: 0.9rem; font-weight: 500; color: var(--text); }
input, select, textarea {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  width: 100%;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
input:disabled { background: #f8fafc; color: var(--text-muted); }
textarea { resize: vertical; }

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s, transform 0.05s;
}
button:hover, .btn:hover { background: var(--primary-dark); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-sekunder { background: #475569; }
.btn-sekunder:hover { background: #334155; }
.btn-hapus { background: var(--danger); }
.btn-hapus:hover { background: #b91c1c; }
.btn-ghost { background: transparent; color: var(--primary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--primary-light); }
.btn-kecil { padding: 0.35rem 0.7rem; font-size: 0.82rem; font-weight: 600; }
.btn-blok { width: 100%; }
.aksi-form { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ---------------------------------------------------------------------
   Pesan status
   --------------------------------------------------------------------- */
.pesan { min-height: 1.2em; font-size: 0.9rem; margin: 0.25rem 0 0; }
.pesan:empty { display: none; }
.pesan.sukses, .pesan.error, .pesan.info {
  padding: 0.6rem 0.8rem; border-radius: var(--radius-sm); font-weight: 500;
}
.pesan.sukses { color: #166534; background: var(--success-bg); }
.pesan.error  { color: #991b1b; background: var(--danger-bg); }
.pesan.info   { color: #92400e; background: var(--warning-bg); }

/* ---------------------------------------------------------------------
   Auth pages (login / register) — kartu di tengah
   --------------------------------------------------------------------- */
/* ---------------------------------------------------------------------
   Auth pages (login / register) — split panel layout
   --------------------------------------------------------------------- */
.auth-wrap {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #0d1b2a;
  overflow-y: auto;
}

.auth-container {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  width: 100%;
  max-width: 1100px;
  min-height: 680px;
  background: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Left panel style */
.auth-panel-left {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 4rem 3.5rem;
  background: #1a2e4a;
  overflow: hidden;
}

.auth-panel-bg {
  position: absolute;
  inset: 0;
  background-image: url('../img/elemen/backround.png?v=13');
  background-size: cover;
  background-position: 30% center;
  filter: brightness(0.85);
  z-index: 0;
}

.auth-panel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(13, 27, 42, 0.95) 0%,
    rgba(26, 46, 74, 0.75) 50%,
    rgba(26, 46, 74, 0.3) 100%
  );
  z-index: 1;
}

.auth-panel-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245, 130, 32, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 130, 32, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: 2;
  opacity: 0.8;
}

.auth-panel-math {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.panel-math-el {
  position: absolute;
  font-family: 'Outfit', sans-serif;
  color: rgba(255, 255, 255, 0.16);
  font-weight: 700;
  line-height: 1;
  user-select: none;
}

.panel-math-el-1 { top: 12%; left: 12%; font-size: 3rem; }
.panel-math-el-2 { top: 32%; right: 15%; font-size: 2.2rem; }
.panel-math-el-3 { top: 52%; left: 25%; font-size: 2.6rem; font-style: italic; }

.auth-panel-content {
  position: relative;
  z-index: 3;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.auth-panel-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-brand-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.auth-panel-brand span {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: #ffffff;
}

.auth-panel-headline {
  font-family: 'Outfit', sans-serif;
  font-size: 2.1rem;
  font-weight: 900;
  line-height: 1.35;
  margin: 0;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}



/* Right panel style */
.auth-panel-right {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  padding: 3rem 2.5rem;
}

.auth-panel-right .auth-card {
  box-shadow: none;
  border: none;
  background: transparent;
  padding: 0;
  max-width: 420px;
  width: 100%;
}

.auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(13, 27, 42, 0.16);
  padding: 3rem 2.5rem;
}

/* Page entry animations */
@keyframes authFadeInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Default left-panel animation */
.auth-panel-left .auth-panel-content {
  animation: authFadeInLeft 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}

/* Responsive split panel layout */
@media (max-width: 900px) {
  .auth-wrap {
    padding: 1rem;
  }
  
  .auth-container {
    grid-template-columns: 1fr;
    min-height: auto;
    border-radius: 16px;
  }
  
  .auth-panel-left {
    padding: 3rem 2.5rem 2.5rem;
    justify-content: center;
    border-bottom: 1px solid rgba(226, 232, 240, 0.1);
  }
  
  .auth-panel-bg {
    background-position: center 30%;
  }
  
  .auth-panel-headline {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
  }
  
  .auth-panel-right {
    padding: 3rem 2rem;
  }
  
  .auth-panel-right .auth-card {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .auth-panel-left {
    padding: 2.5rem 1.5rem 2rem;
  }
  
  .auth-panel-headline {
    font-size: 1.45rem;
  }
}
.auth-card .brand {
  justify-content: flex-start;
  margin-bottom: 1rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
}
.auth-card .btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 1.75rem;
  padding: 0.45rem 0.9rem;
  background: var(--primary-light);
  border-radius: 50px;
  transition: all 0.25s ease;
}
.auth-card .btn-back:hover {
  color: #fff;
  background: var(--primary);
  transform: translateX(-3px);
}
.auth-card h1 {
  text-align: left;
  font-size: 1.85rem;
  margin: 0.25rem 0 0.5rem;
  font-family: "Outfit", sans-serif;
  color: var(--primary-dark);
  font-weight: 800;
}
.auth-card .subtitle {
  text-align: left;
  color: var(--text-muted);
  margin: 0 0 2rem;
  font-size: 0.92rem;
  line-height: 1.5;
}
.auth-card form {
  gap: 1.25rem;
}
.auth-card label {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--primary);
  gap: 0.45rem;
}
.auth-card input {
  padding: 0.75rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
}
.auth-card input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 46, 74, 0.1);
}
.auth-card .switch {
  text-align: center;
  margin: 1.5rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.auth-card .switch a {
  color: var(--accent-dark);
  font-weight: 700;
}
.auth-card .switch a:hover {
  text-decoration: underline;
}
.auth-card .btn-blok {
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.25rem;
  box-shadow: 0 4px 14px rgba(245, 130, 32, 0.22);
  transition: all 0.25s ease;
}
.auth-card .btn-blok:hover {
  background: var(--accent-dark);
  box-shadow: 0 6px 20px rgba(245, 130, 32, 0.3);
  transform: translateY(-1px);
}
.auth-card .btn-blok:active {
  transform: translateY(0);
}
.auth-helper {
  margin: -0.4rem 0 0;
  text-align: right;
  font-size: 0.88rem;
}
.auth-helper a {
  color: var(--primary);
  font-weight: 600;
}
.auth-helper a:hover {
  text-decoration: underline;
}
.auth-note {
  margin: -0.2rem 0 0.2rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.auth-actions {
  display: grid;
  gap: 0.75rem;
}
.auth-actions .btn {
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(245, 130, 32, 0.22);
  transition: all 0.25s ease;
}
.auth-actions .btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 130, 32, 0.3);
}
.auth-actions .btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary-light);
  box-shadow: none;
}
.auth-actions .btn-ghost:hover {
  background: var(--primary-light);
  color: var(--primary);
  transform: translateY(-1px);
}
.auth-actions .btn + .btn,
.auth-actions button + button {
  margin-top: 0;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  padding: 0.2rem;
  width: 1.9rem;
  height: 1.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  background: transparent;
  color: var(--primary-dark);
}

.password-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  stroke: currentColor;
  pointer-events: none;
}

.password-toggle {
  user-select: none;
  touch-action: manipulation;
}

.password-toggle .icon-visible {
  display: none;
}

.password-toggle.is-visible .icon-visible {
  display: block;
}

.password-toggle.is-visible .icon-hidden {
  display: none;
}


.password-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------------
   Topbar (judul + tombol di dalam halaman ber-login)
   --------------------------------------------------------------------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* Tab menu (pill) di dalam dashboard */
.tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1.25rem 0; }
.tabs a {
  padding: 0.45rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
}
.tabs a:hover, .tabs a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------------------------------------------------------------------
   Kartu lomba (grid)
   --------------------------------------------------------------------- */
.grid-lomba { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.kartu-lomba {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex; flex-direction: column;
  transition: box-shadow 0.15s, transform 0.15s;
}
.kartu-lomba:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.kartu-lomba h3 { margin: 0 0 0.5rem; }
.kartu-lomba .deskripsi { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 0.75rem; flex: 1; }
.kartu-lomba .meta { list-style: none; padding: 0; margin: 0 0 1rem; font-size: 0.88rem; display: grid; gap: 0.3rem; }
.kartu-lomba .meta strong { color: var(--text); }
.badge {
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px;
  font-size: 0.78rem; font-weight: 600;
}
.badge-biaya { background: var(--primary-light); color: var(--primary-dark); }

/* ---------------------------------------------------------------------
   Tabel data
   --------------------------------------------------------------------- */
.tabel-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.tabel { width: 100%; border-collapse: collapse; font-size: 0.9rem; background: var(--surface); }
.tabel th, .tabel td { padding: 0.7rem 0.8rem; text-align: left; border-bottom: 1px solid var(--border); }
.tabel th { background: #f8fafc; font-weight: 600; color: var(--text-muted); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.03em; }
.tabel tbody tr:last-child td { border-bottom: none; }
.tabel tbody tr:hover { background: #f8fafc; }
.tabel td button { margin-right: 0.3rem; }

/* Status pill */
.status { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.status-menunggu { background: var(--warning-bg); color: var(--warning); }
.status-valid, .status-terverifikasi { background: var(--success-bg); color: var(--success); }
.status-ditolak { background: var(--danger-bg); color: var(--danger); }

/* ---------------------------------------------------------------------
   Statistik dashboard
   --------------------------------------------------------------------- */
.grid-statistik { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: grid; gap: 0.25rem;
}
.stat .angka { font-size: 2rem; font-weight: 700; color: var(--primary); line-height: 1; }
.stat .label { color: var(--text-muted); font-size: 0.85rem; }

/* Util */
.muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.empty-state { text-align: center; color: var(--text-muted); padding: 2rem 1rem; }

/* ---------------------------------------------------------------------
   Responsif
   --------------------------------------------------------------------- */
@media (max-width: 820px) {
  .layout-kelola { grid-template-columns: 1fr !important; }
}
@media (max-width: 600px) {
  .container { padding: 1.25rem 1rem; }
  h1 { font-size: 1.35rem; }
  .nav-links { gap: 0.85rem; }
  .auth-card { padding: 1.5rem; }
}
