/* ======================
   :root - Variabel Warna
====================== */
:root {
  --primary-color: #374151;
  --secondary-color: #1f2937;
  --accent-color: #3b82f6;
  --text-color: #374151;
  --light-text: #6b7280;
  --white: #ffffff;
  --light-bg: #f9fafb;
  --border-color: #d1d5db;
  --border-radius: 16px;
  --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ======================
   Reset & Global
====================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f3f4f6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px;
  /* Reduced from 16px */
  position: relative;
  overflow-x: hidden;
  overflow-y: hidden;
  /* Prevent vertical scrolling */
  line-height: 1.5;
}

.greeting-text {
  color: var(--greeting-color, #1f2937);
}

/* ======================
   Login Container
====================== */
.login-container {
  width: 100%;
  max-width: 1134px;
  /* Reduced by 10% from 1260px */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
}

/* ======================
   Login Wrapper
====================== */
.login-wrapper {
  display: flex;
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  width: 100%;
  max-width: 864px;
  /* Reduced by 10% from 960px */
  height: 525px;
  /* Reduced by 10% from 585px */
  max-height: 85vh;
  /* Reduced from 90vh */
  margin: 0 auto;
}

/* ======================
   Image Panel (Left - Desktop)
====================== */
.login-image {
  flex: 1;
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #e5e7eb;
  min-height: 0;
}

.church-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.greeting-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  /* Changed from center to flex-start */
  justify-content: center;
  z-index: 2;
  padding-top: 20%;
  /* Raised position by 20% */
}

.greeting-text {
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  padding: 14px 22px;
  /* Reduced by 10% from 16px 24px */
  max-width: 85%;
  margin: 0;
  z-index: 3;
  text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.8);
  line-height: 1.4;
  word-wrap: break-word;
}

/* ======================
   Form Panel (Right - Desktop)
====================== */
.login-form {
  flex: 1;
  padding: 32px 40px;
  /* Reduced vertical padding, kept horizontal */
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Back to center for balanced layout */
  background: var(--white);
  width: 50%;
}

.form-header {
  text-align: center;
  margin-bottom: 2px;
  /* Reduced from 20px */
  flex-shrink: 0;
  /* Prevent header from shrinking */
}

.logo {
  width: 160px;
  /* Reduced from 180px to save space */
  height: auto;
  margin: 0 auto 8px;
  /* Reduced bottom margin */
  display: block;
  /* Ensure block display */
}

.form-group {
  margin-bottom: 16px;
  /* Reduced from 24px to save vertical space */
  flex-shrink: 0;
  /* Prevent form groups from shrinking */
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-color);
  font-size: 1rem;
}

.form-control {
  width: 100%;
  padding: 10px 0;
  border: none;
  border-bottom: 2px solid #d1d5db;
  border-radius: 0;
  font-size: 1.1rem;
  background: transparent !important;
  color: var(--text-color);
  transition: border-color 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-bottom-color: var(--primary-color);
  box-shadow: none;
}

/* Override browser autofill background */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus,
.form-control:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px white inset !important;
  box-shadow: 0 0 0 30px white inset !important;
  background-color: transparent !important;
  background-clip: content-box !important;
}

.form-control::placeholder {
  color: #9ca3af;
  opacity: 0.8;
}

/* ======================
   Button
====================== */
.login-btn {
  width: 100%;
  max-width: 198px;
  /* Reduced by 10% from 220px */
  background: #374151;
  /* Dark gray/blue */
  color: var(--white);
  border: none;
  padding: 14px 25px;
  /* Reduced by 10% from 16px 28px */
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  margin: 16px auto;
  /* Reduced from 24px to save space */
  text-transform: none;
  transition: all 0.3s ease;
  display: block;
}

.login-btn:hover {
  background: #1f2937;
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

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

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* ======================
   Footer
====================== */
.copyright-footer {
  position: absolute;
  bottom: 18px;
  /* Reduced by 10% from 20px */
  left: 0;
  right: 0;
  text-align: center;
  padding: 0 12px;
  /* Reduced from 16px */
  color: var(--text-color);
  font-size: 0.85rem;
  z-index: 5;
}

.footer {
  display: none;
}

/* ======================
   Alerts
====================== */
.alert {
  padding: 13px 16px;
  /* Reduced by 10% from 14px 18px */
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-success {
  background: #ecfdf5;
  border: 2px solid #a7f3d0;
  color: #047857;
}

.alert-danger {
  background: #fef2f2;
  border: 2px solid #fecaca;
  color: #dc2626;
}

/* ======================
   Google Sign-In Styles
====================== */
.btn-google-clean {
  width: 100%;
  padding: 13px 16px;
  /* Reduced by 10% from 14px 18px */
  border: none;
  border-radius: 8px;
  background: #f9fafb;
  color: #374151;
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-decoration: none;
  margin: 20px 0;
  transition: all 0.3s ease;
}

.btn-google-clean:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
}

/* ======================
   DESKTOP STYLES (768px+)
   Enforcing 1024px style for all larger screens as requested
====================== */
@media (min-width: 768px) {
  body {
    padding: 8px;
    /* Reduced from 12px */
  }

  .login-wrapper {
    max-width: 780px;
    /* Reduced by 10% from 900px */
    height: 650px;
    /* Increased to accommodate more spacing */
    max-height: 95vh;
    /* Increased from 90vh */
    border-radius: 14px;
  }

  .login-form {
    padding: 18px;
    /* Reduced by 10% from 40px */
    height: fit-content;
  }

  .logo {
    width: 150px;
    /* Reduced by 10% from 140px */
    margin-bottom: 2px;
  }

  .form-control {
    padding: 10px 12px;
    /* Reduced by 10% from 12px 16px */
    font-size: 1rem;
  }

  .login-btn {
    max-width: 162px;
    /* Reduced by 10% from 180px */
    padding: 6px;
    /* Reduced by 10% from 14px 20px */
    font-size: 1rem;
  }

  .greeting-text {
    font-size: 1.2rem;
    padding: 11px 18px;
    /* Reduced by 10% from 12px 20px */
  }

  .copyright-footer {
    font-size: 0.75rem;
    bottom: auto;
    left: auto;
    right: -120px;
    top: 50%;
    width: 300px;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: center;
    text-align: center;
    position: fixed;
  }

  .btn-google-clean {
    padding: 11px 14px;
    /* Reduced by 10% from 12px 16px */
    font-size: 0.95rem;
  }
}

/* ======================
   MOBILE STYLES (< 768px)
====================== */
@media (max-width: 767px) {
  body {
    padding: 8px;
    /* Reduced from 12px */
    justify-content: flex-start;
  }

  .login-container {
    min-height: auto;
    padding: 8px 0;
    /* Reduced by 10% from 20px */
  }

  .login-wrapper {
    flex-direction: column;
    height: auto;
    max-height: none;
    max-width: 100%;
    margin: 0;
  }

  .login-image {
    flex: none;
    width: 100%;
    height: 225px;
    /* Reduced by 10% from 250px */
    min-height: 180px;
    /* Reduced by 10% from 200px */
    max-height: 36vh;
    /* Reduced by 10% from 40vh */
    order: 1;
  }

  .church-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .login-form {
    width: 100%;
    padding: 22px;
    /* Reduced by 10% from 24px */
    order: 2;
    min-height: 252px;
    /* Reduced by 10% from 280px */
  }

  .logo {
    width: 150px;
    /* Reduced by 10% from 140px */
    margin-bottom: 6px;
  }

  .form-control {
    font-size: 16px;
    padding: 13px;
    /* Reduced by 10% from 14px */
  }

  .login-btn {
    max-width: none;
    padding: 6px;
    /* Reduced by 10% from 16px */
  }

  .copyright-footer {
    position: relative;
    bottom: auto;
    margin-top: 18px;
    /* Reduced by 10% from 20px */
    font-size: 0.75rem;
  }

  .greeting-text {
    font-size: 1.1rem;
    padding: 11px 16px;
    /* Reduced by 10% from 12px 18px */
  }
}

/* ======================
   Extra Small Mobile (< 375px)
====================== */
@media (max-width: 375px) {
  body {
    padding: 6px;
    /* Reduced from 8px */
  }

  .login-image {
    height: 198px;
    /* Reduced by 10% from 220px */
  }

  .login-form {
    padding: 18px;
    /* Reduced by 10% from 20px */
  }

  .logo {
    width: 120px;
    /* Reduced by 10% from 120px */
  }

  .login-btn {
    padding: 6px;
    /* Reduced by 10% from 14px */
    font-size: 0.95rem;
  }

  .greeting-text {
    font-size: 1rem;
    padding: 9px 14px;
    /* Reduced by 10% from 10px 16px */
  }
}