/* Login page styles extracted from inline <style> in index.php
   Colors adjusted to match Kemala Run primary blue palette.
*/
:root{
  --primary: #667eea;
  --primary-dark: #4c51bf;
}
/* Harabara font for headings/title */
@font-face {
  font-family: 'HarabaraMais';
  src: url('../fonts/HarabaraMais-HarabaraMais.woff2') format('woff2'),
       url('../fonts/HarabaraMais-HarabaraMais.woff') format('woff'),
       url('../fonts/HarabaraMais-HarabaraMais.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'HarabaraMais Bold';
  src: url('../fonts/HarabaraMaisBold-HarabaraMaisBold.woff2') format('woff2'),
       url('../fonts/HarabaraMaisBold-HarabaraMaisBold.woff') format('woff'),
       url('../fonts/HarabaraMaisBold-HarabaraMaisBold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Source Sans Pro', 'Poppins', sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.app-wrapper {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  background: #fff;
  position: relative;
  overflow: hidden;
}

/* ── Banner ───────────────────────────────────────────── */
.banner-wrap {
  width: 100%;
  position: relative;
  overflow: hidden;
  max-height: 220px;
  margin-bottom: 50px;
}
.banner-wrap img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* ── Title Section ────────────────────────────────────── */
.title-section { text-align: center; padding: 18px 20px 8px; background: #fff; margin-top: 30px; }
.title-section h2 {
  font-family: 'HarabaraMais', 'Poppins', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #6a1b9a;
  line-height: 0.5;
  display: inline-block;
}
.title-sub  { font-size: 20px; font-weight: 400; color: #6a1b9a; }

/* ── Login Card ───────────────────────────────────────── */
.login-card {
  margin: 12px 18px 24px;
  background: #fff;
  border-radius: 12px;
  padding: 22px 20px 20px;
  box-shadow: none;
}
.login-heading {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  text-align: center;
  margin-bottom: 18px;
}

.login-intro {
  font-size: 18px;
  text-align: center;
  color: var(--primary-dark);
  font-weight: 500;
  margin-bottom: 10px;
}

/* ── Form Elements ────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-control {
  width: 100%;
  background: rgba(255,255,255,0.95);
  border: 1px solid #d6d6d6;
  color: #222;
  padding: 10px 25px;
  border-radius: 25px;
  font-size: 15px;
  font-family: 'Source Sans Pro', sans-serif;
  outline: none;
  transition: border-color .18s, box-shadow .12s ease-in-out;
  display: block;
  box-sizing: border-box;
}
.form-control::placeholder { color: #9f9f9f; }
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(102,126,234,0.06);
}

/* Small pink label/link used on login page (matches kemala_run_2026 style) */
.label-pink {
  color: #e637a0;
  font-weight: 600;
  margin: 6px 0 8px;
  display: block;
  font-size: 14px;
}
.label-pink a { color: inherit; text-decoration: underline; }

/* Inline field error messages placed under inputs */
.field-error {
  color: #e637a0;
  font-size: 13px;
  margin-top: 6px;
  display: none;
}
.field-error:not(:empty) {
  display: block;
}

/* General form-level error (displayed under the form/button) */
.form-error {
  color: #e637a0;
  font-size: 14px;
  margin-top: 12px;
  text-align: center;
  display: none;
}
.form-error:not(:empty) { display: block; }

.debug-preview {
  margin-top: 8px;
  max-height: 160px;
  overflow: auto;
  background: #fff0f6;
  border: 1px solid #f3c2dd;
  padding: 8px;
  font-family: monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

/* Gradient animation used by Kemala Run buttons */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Buttons ──────────────────────────────────────────── */
.btn-main {
  display: block;
  width: 100%;
  padding: 12px;
  background: linear-gradient(45deg, #131e91, #e637a0, #131e91);
  background-size: 200% 200%;
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Source Sans Pro', sans-serif;
  cursor: pointer;
  letter-spacing: 0.4px;
  margin-top: 28px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  animation: gradientShift 3s ease infinite;
}
.btn-main:hover {
  animation-play-state: paused;
  background: linear-gradient(to right, #e637a0 0%, #131e91 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(19,30,145,0.12);
}
.btn-main:active { transform: translateY(0); opacity: .95; }
.btn-main:disabled { opacity: .6; cursor: not-allowed; animation: none; }

/* Match Kemala Run primary button look (blue, full width) */
.btn.btn-primary.btn-block {
  display: block;
  width: 100%;
  padding: 12px;
  background: linear-gradient(45deg, #131e91, #e637a0, #131e91);
  background-size: 200% 200%;
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Source Sans Pro', 'Poppins', sans-serif;
  cursor: pointer;
  letter-spacing: 0.5px;
  margin-top: 4px;
  transition: all 0.3s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: gradientShift 3s ease infinite;
}
.btn.btn-primary.btn-block:hover {
  animation-play-state: paused;
  background: linear-gradient(to right, #e637a0 0%, #131e91 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(19,30,145,0.12);
}
.btn.btn-primary.btn-block:active { transform: translateY(0); opacity: .95; }
.btn.btn-primary.btn-block:disabled { opacity: .6; cursor: not-allowed; animation: none; }

/* ── Links ────────────────────────────────────────────── */
.login-links {
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: #666;
  line-height: 1.9;
}
.login-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.login-links a:hover { text-decoration: underline; }

/* ── Toast / Alert ────────────────────────────────────── */
.toast {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 9999;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.toast.error  { background: #c0392b; }
.toast.success{ background: #27ae60; }
.toast.show   { display: block; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity:0; transform: translateX(-50%) translateY(10px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }

/* ── Loading Overlay ──────────────────────────────────── */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.7);
  z-index: 9998;
  justify-content: center;
  align-items: center;
}
.loading-overlay.show { display: flex; }
.spinner {
  width: 40px; height: 40px;
  border: 4px solid #f0f0f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
