/* ETICS Login Page - Color Story Implementation */
/* Colors: Cream (#F7E3A1), Red Coral (#E74C3C), Navy Blue (#2F4358), White */

/* Base Styles */
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  position: fixed;
  background-color: #2F4358;
}

/* Particles container with animated gradient background */
#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #1e2a3a 0%, #2F4358 25%, #1a2533 50%, #2F4358 75%, #1e2a3a 100%);
  background-size: 400% 100%;
  background-position: 0% 50%;
  background-repeat: no-repeat;
  z-index: -1;
  overflow: hidden;
  animation: gradientX 15s ease infinite;
}

/* Gradient X Animation */
@keyframes gradientX {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Overlay for depth */
#particles-js:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(47, 67, 88, 0.2) 0%, rgba(30, 42, 58, 0.15) 100%);
  z-index: 0;
}

/* Login Container */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  height: 100vh;
  padding: 20px;
  position: relative;
  z-index: 1;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Login Box - Transparent dengan backdrop blur */
.login-box {
  width: 100%;
  max-width: 1000px;
  height: auto;
  max-height: 90vh;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(47, 67, 88, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  display: flex;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  padding: 20px;
  position: relative;
}

.login-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 70px rgba(47, 67, 88, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

/* Left side - Image section with Navy Blue background */
.login-image {
  width: 50%;
  background: linear-gradient(135deg, #2F4358 0%, #1e2a3a 100%);
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  border-radius: 16px 0 0 16px;
  box-shadow: inset -2px 0 10px rgba(0, 0, 0, 0.1);
}

.back-link {
  position: absolute;
  top: 20px;
  left: 20px;
  color: #F7E3A1;
  text-decoration: none;
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(247, 227, 161, 0.1);
}

.back-link:hover {
  background: rgba(247, 227, 161, 0.2);
  color: #ffffff;
  transform: translateX(-3px);
}

.back-link svg {
  margin-right: 5px;
}

.image-container {
  position: relative;
  height: auto;
  min-height: 300px;
  max-height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.illustration {
  transform-origin: center;
}

/* Float animation */
.float-simple {
  animation: floatSimple 6s ease-in-out infinite;
}

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

.slide {
  display: none;
  text-align: center;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.slide.active {
  display: block;
  opacity: 1;
}

.image-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
}

/* SVG Animations */
.slide-svg {
  width: 100%;
  height: 100%;
  max-width: 400px;
  max-height: 300px;
  margin: 0 auto;
}

.svg-group {
  animation: fadeIn 0.8s ease-in;
}

/* Person animation */
.person-animation {
  animation: floatUpDown 3s ease-in-out infinite;
}

@keyframes floatUpDown {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* Pulse animation */
.pulse-animation {
  animation: pulse 2s ease-in-out infinite;
}

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

/* Card animation */
.card-animation {
  animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
  0% {
    opacity: 0;
    transform: translateX(-20px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Progress animation */
.progress-animation {
  animation: progressFill 2s ease-out;
  transform-origin: left;
}

@keyframes progressFill {
  0% {
    width: 0;
  }
  100% {
    width: 62.5%;
  }
}

/* Line draw animation */
.line-draw {
  stroke-dasharray: 500;
  stroke-dashoffset: 500;
  animation: drawLine 2s ease-out forwards;
}

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

/* Node animation */
.node-animation {
  animation: nodePulse 2s ease-in-out infinite;
}

@keyframes nodePulse {
  0%, 100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* Shield animation */
.shield-animation {
  animation: shieldGlow 2s ease-in-out infinite;
}

@keyframes shieldGlow {
  0%, 100% {
    opacity: 0.9;
    filter: drop-shadow(0 0 5px rgba(247, 227, 161, 0.5));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 15px rgba(247, 227, 161, 0.8));
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.image-caption {
  margin-top: 30px;
  text-align: center;
}

.image-caption h2 {
  font-size: 32px;
  color: #F7E3A1;
  margin-bottom: 10px;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.image-caption p {
  font-size: 18px;
  color: rgba(247, 227, 161, 0.85);
  font-weight: 400;
}

.slide-indicators {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

.indicator {
  width: 30px;
  height: 4px;
  background-color: rgba(247, 227, 161, 0.3);
  margin: 0 5px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.3s;
}

.indicator.active {
  background-color: #E74C3C;
  width: 40px;
}

.indicator:hover {
  background-color: rgba(247, 227, 161, 0.6);
}

/* Right side - Login Form */
.login-form {
  width: 50%;
  padding: 50px;
  border-radius: 0 16px 16px 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
}

.login-form-container {
  max-width: 400px;
  margin: 0 auto;
  width: 100%;
}

.logo-container {
  text-align: center;
  margin-bottom: 10px;
}

.logo-container img {
  max-width: 280px;
  height: auto;
}

.login-header {
  margin-bottom: 40px;
  text-align: center;
}

.login-header h1 {
  font-size: 42px;
  color: #2F4358;
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.login-header h5 {
  font-size: 16px;
  color: #2F4358;
  font-weight: 500;
  opacity: 0.8;
  letter-spacing: 0.5px;
}

.login-header p {
  font-size: 16px;
  color: #2F4358;
  opacity: 0.7;
}

/* Form Elements */
.form-group {
  margin-bottom: 24px;
}

.form-control {
  height: 50px;
  border-radius: 10px;
  border: 2px solid rgba(47, 67, 88, 0.15);
  padding: 0 15px;
  font-size: 15px;
  transition: all 0.3s;
  background-color: #ffffff;
  color: #2F4358;
  font-weight: 400;
}

.form-control::placeholder {
  color: rgba(47, 67, 88, 0.5);
}

.form-control:focus {
  border-color: #E74C3C;
  box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.15);
  outline: none;
  background-color: #ffffff;
}

.password-field {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(47, 67, 88, 0.5);
  cursor: pointer;
  transition: color 0.3s;
  padding: 5px;
}

.password-toggle:hover {
  color: #E74C3C;
}

/* Remember Me Switch */
.checkbox-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 30px;
}

.remember-me-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  margin-right: 10px;
}

.remember-me-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(47, 67, 88, 0.2);
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background-color: #E74C3C;
}

input:focus + .slider {
  box-shadow: 0 0 1px #E74C3C;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.remember-text {
  color: #2F4358;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.8;
}

.forgot-link {
  color: #E74C3C;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s;
}

.forgot-link:hover {
  color: #c0392b;
  text-decoration: underline;
}

/* Login Button - Red Coral CTA */
.login-btn {
  width: 100%;
  height: 50px;
  background: linear-gradient(135deg, #E74C3C 0%, #c0392b 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
  position: relative;
  overflow: hidden;
}

.login-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.login-btn:hover::before {
  left: 100%;
}

.login-btn:hover {
  background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
  transform: translateY(-2px);
}

.login-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
}

.login-btn:disabled {
  background: rgba(47, 67, 88, 0.3);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Social Login */
.social-login {
  margin-top: 40px;
  text-align: center;
}

.social-login-label {
  display: flex;
  align-items: center;
  color: rgba(47, 67, 88, 0.6);
  font-size: 14px;
  margin-bottom: 20px;
}

.social-login-label::before,
.social-login-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: rgba(47, 67, 88, 0.2);
}

.social-login-label::before {
  margin-right: 15px;
}

.social-login-label::after {
  margin-left: 15px;
}

.social-buttons {
  display: flex;
  justify-content: space-between;
}

.social-btn {
  flex: 1;
  margin: 0 10px;
  height: 45px;
  border-radius: 10px;
  border: 2px solid rgba(47, 67, 88, 0.15);
  background: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.social-btn:hover {
  background: #F7E3A1;
  border-color: #E74C3C;
}

.social-btn img {
  height: 24px;
}

/* Error Alert Styling */
.error-alert {
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 20px;
  background-color: rgba(231, 76, 60, 0.15);
  border-left: 4px solid #E74C3C;
  color: #2F4358;
  display: flex;
  align-items: center;
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
  transform-origin: center;
  box-shadow: 0 4px 6px rgba(231, 76, 60, 0.1);
}

.error-icon {
  margin-right: 10px;
  font-size: 18px;
  color: #E74C3C;
}

.error-message {
  flex: 1;
  font-weight: 500;
  color: #2F4358;
}

.error-close {
  background: none;
  border: none;
  color: rgba(47, 67, 88, 0.6);
  cursor: pointer;
  font-size: 16px;
  transition: color 0.2s;
  padding: 5px;
}

.error-close:hover {
  color: #E74C3C;
}

/* Shake Animation for Error */
@keyframes shake {
  10%, 90% {
    transform: translate3d(-1px, 0, 0);
  }
  20%, 80% {
    transform: translate3d(2px, 0, 0);
  }
  30%, 50%, 70% {
    transform: translate3d(-4px, 0, 0);
  }
  40%, 60% {
    transform: translate3d(4px, 0, 0);
  }
}

/* Field Error Styling */
.form-control.is-invalid {
  border-color: #E74C3C;
  box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.15);
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

/* Slide in animation */
@keyframes slideIn {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-in {
  animation: slideIn 0.4s ease forwards;
}

/* Fade out animation */
@keyframes fadeOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.fade-out {
  animation: fadeOut 0.5s ease forwards;
}

/* Loading animation styles */
.btn-loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-loader .spinner-border {
  margin-right: 8px;
  color: #ffffff;
}

/* Custom checkbox styling */
.checkbox-container {
  display: flex;
  align-items: center;
  position: relative;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkbox-container label {
  padding-left: 30px;
  cursor: pointer;
  font-size: 14px;
  color: #2F4358;
  user-select: none;
  font-weight: 500;
}

.checkbox-container label:before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: 2px solid rgba(47, 67, 88, 0.3);
  background-color: #ffffff;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.checkbox-container input:checked + label:before {
  background-color: #E74C3C;
  border-color: #E74C3C;
}

.checkbox-container label:after {
  content: '';
  position: absolute;
  left: 7px;
  top: 50%;
  transform: translateY(-70%) rotate(45deg);
  width: 6px;
  height: 12px;
  border: solid white;
  border-width: 0 2px 2px 0;
  opacity: 0;
  transition: all 0.2s ease;
}

.checkbox-container input:checked + label:after {
  opacity: 1;
}

.checkbox-container input:focus + label:before {
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

/* Switch animation enhancement */
.slider, .slider:before {
  transition: all 0.3s cubic-bezier(.175, .885, .32, 1.275);
}

.remember-me-switch input:checked ~ .slider:before {
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Responsive Design */
@media (max-width: 991px) {
  .login-container {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  
  .login-box {
    flex-direction: column;
    max-height: none;
    overflow-y: auto;
  }
  
  .login-image,
  .login-form {
    width: 100%;
  }
  
  .login-image {
    padding: 30px;
    border-radius: 16px 16px 0 0;
  }
  
  .login-form {
    border-radius: 0 0 16px 16px;
  }
  
  .image-container {
    height: auto;
    min-height: 250px;
    max-height: 300px;
  }
  
  .login-form {
    padding: 30px;
  }
}

@media screen and (min-resolution: 120dpi) {
  .login-box {
    max-width: 900px;
    max-height: 85vh;
  }
  
  .image-container {
    max-height: 320px;
  }
  
  .image-caption h2 {
    font-size: 28px;
  }
  
  .image-caption p {
    font-size: 16px;
  }
}

@media screen and (min-resolution: 144dpi) {
  .login-box {
    max-width: 850px;
    max-height: 80vh;
  }
  
  .login-form {
    padding: 30px;
  }
  
  .login-image {
    padding: 25px;
  }
}

@media (max-width: 767px) {
  html, body {
    overflow: hidden;
    height: 100vh;
    position: fixed;
    width: 100%;
  }
  
  .login-container {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 10px;
  }
  
  .login-image {
    display: none;
  }
  
  .login-form {
    width: 100%;
    padding: 25px 15px;
  }
  
  .login-box {
    padding: 0;
    box-shadow: 0 10px 30px rgba(47, 67, 88, 0.2);
    max-width: 100%;
    max-height: 100vh;
    overflow-y: auto;
  }
  
  .login-form-container {
    max-width: 100%;
  }
  
  .remember-me-switch {
    width: 40px;
    height: 20px;
  }
  
  .slider:before {
    height: 14px;
    width: 14px;
  }
  
  input:checked + .slider:before {
    transform: translateX(20px);
  }
  
  .error-alert {
    padding: 10px;
    margin-bottom: 15px;
  }
  
  .error-icon {
    font-size: 16px;
  }
  
  .error-message {
    font-size: 14px;
  }
  
  .login-header h1 {
    font-size: 36px;
  }
  
  .login-header h5 {
    font-size: 14px;
  }
}

/* iPad Mini and other tablets */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
  .login-container {
    padding: 20px;
    align-items: center;
  }
  
  .login-box {
    max-width: 90%;
    padding: 0;
    height: auto;
  }
  
  .login-form {
    padding: 30px 20px;
    width: 55%;
  }
  
  .login-image {
    width: 45%;
    padding: 20px;
  }
  
  .image-container {
    min-height: 200px;
  }
  
  .login-form-container {
    padding: 0;
  }
  
  .form-control {
    height: 45px;
  }
  
  .login-btn {
    height: 45px;
  }
}

/* iPad Mini portrait mode */
@media only screen and (min-device-width: 768px) and (max-device-width: 834px) and (orientation: portrait) {
  .login-box {
    max-width: 95%;
    max-height: none;
    flex-direction: column;
  }
  
  .login-image, .login-form {
    width: 100%;
  }
  
  .login-image {
    min-height: 300px;
    border-radius: 16px 16px 0 0;
  }
  
  .login-form {
    border-radius: 0 0 16px 16px;
    padding: 30px 40px;
  }
  
  .image-container {
    max-height: 220px;
  }
}

/* iPad Mini specific fix */
@media only screen and (min-device-width: 750px) and (max-device-width: 850px) and (min-device-height: 1000px) and (max-device-height: 1200px) {
  html, body {
    height: 100vh;
    overflow: hidden;
    position: fixed;
    width: 100%;
  }
  
  .login-container {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 20px 10px;
  }
  
  .login-box {
    margin: 0 auto;
    flex-direction: column;
    overflow-y: auto;
    padding: 0;
    max-height: calc(100vh - 40px);
    box-shadow: 0 15px 40px rgba(47, 67, 88, 0.3);
  }
  
  .login-image {
    width: 100%;
    min-height: auto;
    border-radius: 16px 16px 0 0;
  }
  
  .login-form {
    width: 100%;
    padding: 35px 30px;
    border-radius: 0 0 16px 16px;
  }
  
  .form-control {
    height: 50px;
    background-color: rgba(255, 255, 255, 0.9);
  }
  
  .login-btn {
    margin-top: 10px;
  }
}

/* iPad Mini landscape */
@media only screen and (min-device-width: 834px) and (max-device-width: 1112px) and (orientation: landscape) {
  .login-box {
    max-height: none;
    padding: 0;
  }
  
  .login-form {
    padding: 30px;
  }
  
  .login-image {
    padding: 20px;
  }
}

