* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Plus Jakarta Sans", sans-serif;
  background: linear-gradient(135deg, #0f9a47 0%, #34b6d0 50%, #f18200 100%);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
  transition: background-image 1.5s ease-in-out;
}

body.loaded {
  background-image: var(--bg-image);
}

body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(15, 154, 71, 0.88) 0%,
    rgba(52, 182, 208, 0.88) 50%,
    rgba(241, 130, 0, 0.88) 100%
  );
  z-index: 1;
  transition: opacity 1.5s ease-in-out;
}

body.loaded::before {
  opacity: 0.85;
}

/* Loading Spinner */
.loading-spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
}

.loading-spinner.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.floating-shapes {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 2;
}

.shape {
  position: absolute;
  opacity: 0.15;
  animation: float 20s infinite ease-in-out;
  filter: blur(1px);
}

.shape:nth-child(1) {
  top: 10%;
  left: 10%;
  width: 100px;
  height: 100px;
  background: #0f9a47;
  border-radius: 50%;
  animation-delay: 0s;
}

.shape:nth-child(2) {
  top: 70%;
  left: 80%;
  width: 150px;
  height: 150px;
  background: #34b6d0;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  animation-delay: 3s;
}

.shape:nth-child(3) {
  top: 40%;
  left: 85%;
  width: 80px;
  height: 80px;
  background: #f18200;
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
  animation-delay: 6s;
}

.shape:nth-child(4) {
  top: 80%;
  left: 20%;
  width: 120px;
  height: 120px;
  background: #0f9a47;
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
  animation-delay: 9s;
}

.shape:nth-child(5) {
  top: 20%;
  left: 70%;
  width: 90px;
  height: 90px;
  background: #34b6d0;
  border-radius: 50%;
  animation-delay: 12s;
}

.shape:nth-child(6) {
  top: 60%;
  left: 5%;
  width: 110px;
  height: 110px;
  background: #f18200;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  animation-delay: 15s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }

  33% {
    transform: translateY(-40px) rotate(120deg) scale(1.1);
  }

  66% {
    transform: translateY(40px) rotate(240deg) scale(0.9);
  }
}

.login-container {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: 30px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  overflow: hidden;
  max-width: 480px;
  width: 90%;
  position: relative;
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.5);
  animation: slideIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transform-style: preserve-3d;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-header {
  background: transparent;
  color: #1d1d1f;
  padding: 20px 20px 10px 30px;
  text-align: center;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }

  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

.login-header .logo-icon {
  font-size: 70px;
  margin-bottom: 15px;
  animation: pulse 2.5s infinite;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4));
  position: relative;
  z-index: 1;
}

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

  50% {
    transform: scale(1.15);
  }
}

.login-header h2 {
  margin: 0;
  font-weight: 800;
  font-size: 38px;
  background: linear-gradient(135deg, #0f9a47 0%, #34b6d0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
  letter-spacing: 1px;
}

.login-header p {
  margin: 12px 0 0 0;
  font-size: 15px;
  color: rgba(0, 0, 0, 0.65);
  position: relative;
  z-index: 1;
  font-weight: 500;
}

.author-credit {
  margin-top: 8px;
  font-size: 13px;
  opacity: 0.9;
  font-style: italic;
  position: relative;
  z-index: 1;
}

.login-body {
  padding: 45px 40px;
}

.form-label {
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 10px;
  font-size: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.input-group {
  margin-bottom: 25px;
  position: relative;
}

.input-group-text {
  background: rgba(255, 255, 255, 0.5);
  color: #0f9a47;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-right: none;
  padding: 14px 18px;
  border-radius: 12px 0 0 12px;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.form-control {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #1d1d1f;
  padding: 14px 18px;
  border-radius: 0 12px 12px 0;
  transition: all 0.3s ease;
  border-left: none;
  font-size: 15px;
}

.form-control:focus {
  background: rgba(255, 255, 255, 0.85);
  border-color: #34b6d0;
  box-shadow: 0 0 0 4px rgba(52, 182, 208, 0.15);
  outline: none;
}

.input-group:focus-within .input-group-text {
  background: white;
  color: #34b6d0;
  border-color: #34b6d0;
  transform: none;
  box-shadow: none;
}
.btn-login {
  width: 100%;
  padding: 16px;
  font-weight: 700;
  font-size: 17px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #0f9a47 0%, #34b6d0 50%, #f18200 100%);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(15, 154, 71, 0.3);
  margin-top: 15px;
  letter-spacing: 0.5px;
}

.btn-login::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  transition: left 0.6s;
}

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

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(15, 154, 71, 0.4);
}

.btn-login:active {
  transform: translateY(0) scale(0.98);
}

.alert {
  border-radius: 12px;
  border: none;
  padding: 14px 18px;
  margin-bottom: 25px;
  animation: slideDown 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  font-weight: 500;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  background: linear-gradient(
    135deg,
    rgba(15, 154, 71, 0.12) 0%,
    rgba(15, 154, 71, 0.25) 100%
  );
  color: #0f9a47;
  border-left: 5px solid #0f9a47;
}

.alert-danger {
  background: linear-gradient(
    135deg,
    rgba(241, 130, 0, 0.12) 0%,
    rgba(241, 130, 0, 0.25) 100%
  );
  color: #f18200;
  border-left: 5px solid #f18200;
}

/* Photo Attribution */
.photo-attribution {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  padding: 12px 20px;
  border-radius: 25px;
  font-size: 13px;
  color: #2c3e50;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  opacity: 0;
}

.photo-attribution.show {
  opacity: 1;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.photo-attribution i {
  margin-right: 6px;
  color: #0f9a47;
}

.photo-attribution a {
  color: #109947;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.photo-attribution a:hover {
  color: #f18200;
  text-decoration: underline;
}

.photo-attribution:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Mobile responsive */
@media (max-width: 576px) {
  .photo-attribution {
    display: none !important;
  }
}

.photo-attribution i {
  font-size: 14px;
}

@media (max-width: 576px) {
  .login-container {
    margin: 20px;
    border-radius: 25px;
  }

  .login-header {
    padding: 40px 25px;
  }

  .login-header .logo-icon {
    font-size: 55px;
  }

  .login-header h2 {
    font-size: 30px;
  }

  .login-header p {
    font-size: 13px;
  }

  .login-body {
    padding: 35px 30px;
  }
}

.turnstile-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
  min-height: 65px;
}

.turnstile-error {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: none;
}

.turnstile-error.show {
  display: block;
}

.field-error {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.form-control.is-invalid {
  border-color: #dc3545;
}

.security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: linear-gradient(
    135deg,
    rgba(19, 152, 69, 0.1) 0%,
    rgba(19, 152, 69, 0.05) 100%
  );
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: #139845;
}

.security-badge i {
  font-size: 1.2rem;
}

.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Menengahkan Widget Turnstile */
.turnstile-container {
  display: flex;
  justify-content: center; /* Kunci untuk menengahkan horizontal */
  align-items: center;
  margin-bottom: 10px;
  width: 100%;
}

.form-control.is-invalid {
  background-image: none !important;
  box-shadow: none !important;
  border-color: #dc3545;
}

.is-invalid ~ .input-group-text,
.input-group:has(.is-invalid) .input-group-text {
  border-color: #dc3545;
  color: #dc3545;
  background-color: #fdf3f4;
}
