/* --- Agro Water Platform Keycloak Premium Login Theme --- */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --color-bg-dark: #05070c;
  --color-card-bg: rgba(13, 20, 38, 0.6);
  --color-primary: #0ea5e9; /* Sky Blue */
  --color-accent: #10b981;  /* Emerald */
  --color-text: #f8fafc;
  --color-text-muted: #94a3b8;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-glow: rgba(14, 165, 233, 0.25);
  --glass-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  margin: 0 !important;
  padding: 0 !important;
  background: var(--color-bg-dark) url(../img/water_bg.jpg) no-repeat center center !important;
  background-size: cover !important;
  font-family: var(--font-sans) !important;
  color: var(--color-text) !important;
  overflow: hidden !important; /* Lock outer body scroll */
}

/* Base Layout Wrapper */
.login-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* --- LEFT SIDE: Stretched slideshow showcase (absolute layer container) --- */
.story-showcase {
  width: 100%;
  height: 100%;
  overflow: hidden; /* Disable browser scrolling */
  position: relative;
}

/* Slide Container: Stacked absolutely on top of each other */
.story-slide {
  position: absolute;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: flex-end;
  padding: 8% 8% 10%;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  z-index: 1;
  transition: opacity 1.5s ease, visibility 1.5s ease;
}

/* Active Slide: top layer with delayed slow fade-in */
.story-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 3;
  transition: opacity 2.0s ease 1.0s, visibility 2.0s ease 1.0s;
}

/* Exit Slide: middle layer with rapid disintegration fade-out */
.story-slide.exit {
  opacity: 0;
  visibility: visible;
  z-index: 2;
  transition: opacity 1.0s ease, visibility 1.0s ease;
}

/* Slide Background with zoom-in exit dissolution */
.slide-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transform: scale(1.18) rotate(1.5deg);
  filter: blur(18px) saturate(40%);
  opacity: 0;
  z-index: 1;
}

.story-slide.active .slide-bg {
  transform: scale(1.02) rotate(0deg);
  filter: blur(0px) saturate(100%);
  opacity: 0.65;
  transition: transform 2.0s cubic-bezier(0.16, 1, 0.3, 1) 1.0s, filter 2.0s ease 1.0s, opacity 2.0s ease 1.0s;
}

.story-slide.exit .slide-bg {
  transform: scale(1.3) rotate(3deg);
  filter: blur(25px) saturate(20%);
  opacity: 0;
  transition: transform 1.0s cubic-bezier(0.16, 1, 0.3, 1), filter 1.0s ease, opacity 1.0s ease;
}

.slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(0deg, rgba(5, 7, 12, 0.95) 0%, rgba(5, 7, 12, 0.3) 50%, rgba(5, 7, 12, 0.85) 100%);
  z-index: 2;
}

/* Slide Content with staggered skew, scale, and blur reveals */
.slide-content {
  position: relative;
  z-index: 3;
  max-width: 580px;
  transform: translateY(45px) skewY(2deg);
  opacity: 0;
  filter: blur(12px);
}

.story-slide.active .slide-content {
  transform: translateY(0) skewY(0deg);
  filter: blur(0px);
  opacity: 1;
  transition: transform 1.8s cubic-bezier(0.16, 1, 0.3, 1) 1.3s, filter 1.8s ease 1.3s, opacity 1.8s ease 1.3s;
}

.story-slide.exit .slide-content {
  transform: translateY(-50px) skewY(-2deg);
  filter: blur(15px);
  opacity: 0;
  transition: transform 0.8s ease, filter 0.8s ease, opacity 0.8s ease;
}


.slide-hud {
  font-size: 0.6875rem;
  letter-spacing: 0.15em;
  color: var(--color-primary);
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: uppercase;
  font-family: monospace;
}

.slide-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #ffffff;
}

.slide-description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin: 0 0 28px;
}

/* KPIs */
.slide-kpis {
  display: flex;
  gap: 20px;
}

.kpi-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
}

.kpi-val {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-accent);
}

.kpi-lbl {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* Canvas Particles */
.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* --- RIGHT SIDE: Overlay glassmorphic login container --- */
.login-form-container {
  position: fixed;
  right: 6%;
  top: 0;
  width: 440px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none; /* Let scroll events pass to the slideshow underneath */
}

#kc-container-wrapper {
  background: none !important;
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Card Container */
.card-pf {
  background: var(--color-card-bg) !important;
  backdrop-filter: blur(30px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(30px) saturate(180%) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 16px !important;
  box-shadow: var(--glass-shadow) !important;
  padding: 50px 45px !important;
  max-width: 420px;
  width: 100% !important;
  box-sizing: border-box !important;
  position: relative;
  overflow: hidden;
  pointer-events: auto; /* Re-enable clicks inside the card */
}

.card-pf::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}

.card-pf::after {
  content: 'AIS AGRO WATER' !important;
  position: absolute;
  bottom: 15px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.6875rem;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

.login-pf-page .login-pf-header {
  margin-bottom: 28px !important;
  text-align: center !important;
}

#kc-page-title {
  font-family: var(--font-sans) !important;
  color: var(--color-text) !important;
  font-size: 1.8rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  margin-bottom: 8px !important;
}

/* Custom logo icon drop style */
#kc-content::before {
  content: '💧' !important;
  display: block !important;
  font-size: 2.8rem !important;
  text-align: center !important;
  margin-bottom: 12px !important;
  filter: drop-shadow(0 0 15px var(--color-primary));
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0px); }
}

/* Form labels */
.control-label {
  color: var(--color-text-muted) !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  margin-bottom: 8px !important;
  display: block;
}

/* Form Inputs */
.form-control {
  background: rgba(9, 13, 22, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  color: var(--color-text) !important;
  font-family: var(--font-sans) !important;
  font-size: 0.95rem !important;
  padding: 14px 16px !important;
  height: auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
  transition: all 0.2s ease !important;
}

.form-control:focus {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px var(--color-border-glow) !important;
  outline: none !important;
}

.form-group {
  margin-bottom: 20px !important;
}

/* Login Button */
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, #0284c7 100%) !important;
  border: none !important;
  border-radius: 8px !important;
  color: #ffffff !important;
  font-family: var(--font-sans) !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  padding: 14px 20px !important;
  width: 100% !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.25) !important;
  margin-top: 15px !important;
  letter-spacing: 0.02em;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%) !important;
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.4) !important;
}

/* Links & Help text */
#kc-registration, #kc-info {
  margin-top: 24px !important;
  text-align: center !important;
  font-size: 0.8125rem !important;
  color: var(--color-text-muted) !important;
  border-top: 1px solid var(--color-border);
  padding-top: 20px;
}

a {
  color: var(--color-accent) !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  transition: color 0.15s ease !important;
}

a:hover {
  color: #34d399 !important;
}

/* Remember me & Forgot password */
.login-pf-settings {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  font-size: 0.8125rem !important;
  color: var(--color-text-muted) !important;
  margin-bottom: 20px !important;
}

.checkbox label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox input[type="checkbox"] {
  accent-color: var(--color-primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* Alerts */
.alert {
  border-radius: 8px !important;
  padding: 12px 14px !important;
  margin-bottom: 20px !important;
  font-size: 0.8125rem !important;
}

.alert-error {
  background-color: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  color: #fca5a5 !important;
}

.alert-info {
  background-color: rgba(14, 165, 233, 0.15) !important;
  border: 1px solid rgba(14, 165, 233, 0.3) !important;
  color: #bae6fd !important;
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.15) !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  color: #a7f3d0 !important;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  body {
    overflow-y: auto !important; /* Allow scroll on small devices */
  }
  .login-layout {
    flex-direction: column !important;
    height: auto !important;
  }
  .story-showcase {
    width: 100% !important;
    height: auto !important;
    overflow-y: visible !important;
    border-right: none !important;
    border-bottom: 1px solid var(--color-border);
  }
  .story-slide {
    height: 60vh !important;
  }
  .slide-bg {
    opacity: 0.35 !important;
  }
  .login-form-container {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    padding: 60px 20px !important;
    pointer-events: auto !important;
  }
}

/* --- SATELLITE SCANNING ANIMATIONS (SLIDE 1) --- */

/* 1. Pulsing laser source emitter aligned with the satellite nozzle in slide1.jpg */
.satellite-beam-emitter {
  position: absolute;
  top: 38.3%;
  left: 51.15%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  margin-top: -4px;
  background-color: #fff;
  border-radius: 50%;
  box-shadow: 0 0 15px 4px #0ea5e9, 0 0 6px 1px #fff;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 1.5s ease 2s;
}

.story-slide.active .satellite-beam-emitter {
  opacity: 1;
  animation: emitterPulse 1.5s ease-in-out infinite alternate;
}

/* 2. Scanning laser sweep line following the 3D grid perspective cone */
.satellite-sweep-line {
  position: absolute;
  top: 38.5%;
  left: 51.15%;
  width: 2px;
  height: 2px;
  background-color: #0ea5e9;
  border-radius: 50%;
  box-shadow: 0 0 25px 6px rgba(14, 165, 233, 0.85);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.story-slide.active .satellite-sweep-line {
  opacity: 1;
  animation: laserConeSweep 4.5s ease-in-out infinite;
}

/* 3. Pulsing radar target ellipse centered on the ground scan target in slide1.jpg */
.scanning-radar-circle {
  position: absolute;
  top: 73.5%;
  left: 51.5%;
  width: 220px;
  height: 70px;
  margin-left: -110px;
  margin-top: -35px;
  border: 2px solid rgba(14, 165, 233, 0.85);
  border-radius: 50%;
  transform-origin: center;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 1.5s ease 2s;
}

.story-slide.active .scanning-radar-circle {
  opacity: 1;
  animation: radarPulse 3s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.scanning-radar-circle::after {
  content: '';
  position: absolute;
  top: -4px; left: -4px; right: -4px; bottom: -4px;
  border: 1.5px dashed rgba(16, 185, 129, 0.75);
  border-radius: 50%;
  animation: radarRotate 12s linear infinite;
}

@keyframes emitterPulse {
  0% {
    transform: scale(0.85);
    box-shadow: 0 0 10px 2px #0ea5e9, 0 0 4px 1px #fff;
  }
  100% {
    transform: scale(1.2);
    box-shadow: 0 0 22px 6px #0ea5e9, 0 0 10px 2px #fff;
  }
}

@keyframes laserConeSweep {
  0% {
    top: 38.5%;
    left: 51.15%;
    width: 4px;
    height: 1px;
    margin-left: -2px;
    box-shadow: 0 0 15px 3px rgba(14, 165, 233, 0.9);
    background-color: #fff;
  }
  50% {
    background-color: rgba(14, 165, 233, 0.8);
  }
  100% {
    top: 73.5%;
    left: 51.5%;
    width: 210px; /* expands to match the bottom grid shape */
    height: 3px;
    margin-left: -105px;
    box-shadow: 0 0 35px 10px rgba(14, 165, 233, 0.75), 0 0 8px 1px #fff;
    background-color: rgba(255, 255, 255, 0.5);
  }
}

@keyframes radarPulse {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
    box-shadow: 0 0 45px rgba(14, 165, 233, 0);
  }
}

@keyframes radarRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}


