/* ==========================================================================
   PORTAL LOGIN INSTITUSIONAL - ZERO-SCROLL 100VH MODERN DESIGN
   Institut Kesehatan Karsa Husada Garut
   Palette: Tosca IKKH (#09a89e), Royal Gold (#ffb830), Soft Luminous Gradients
   ========================================================================== */

/* Prevent vertical scroll on desktop/laptop viewports */
@media (min-height: 660px) {
  html:has(.auth-page-section),
  body:has(.auth-page-section) {
    overflow: hidden !important;
    height: 100vh !important;
  }
}

/* --------------------------------------------------------------------------
   1. SECTION & DYNAMIC GRADIENT BACKGROUND (FIT 100% VIEWPORT)
   -------------------------------------------------------------------------- */
.auth-page-section {
  position: relative;
  /* Fill exact remaining height below navbar (topbar ~36px + navbar ~70px = ~106px) */
  height: calc(100vh - 108px);
  min-height: 580px;
  max-height: calc(100vh - 108px);
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  background: 
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(9, 168, 158, 0.22) 0%, transparent 65%),
    radial-gradient(circle 500px at 10% 75%, rgba(255, 184, 48, 0.14) 0%, transparent 55%),
    radial-gradient(circle 550px at 90% 70%, rgba(9, 168, 158, 0.16) 0%, transparent 60%),
    linear-gradient(150deg, #e7f5f4 0%, #f2f9f8 35%, #edf6f5 65%, #dff2f0 100%);
  overflow: hidden;
}

/* Fallback for small screens or rotated mobile */
@media (max-height: 660px) {
  .auth-page-section {
    height: auto;
    max-height: none;
    padding: 2rem 1rem;
    overflow-y: auto;
  }
}

/* Subtle Geometric Pattern Overlay */
.auth-page-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(9, 168, 158, 0.12) 1.2px, transparent 1.2px);
  background-size: 26px 26px;
  pointer-events: none;
  opacity: 0.85;
}

/* Decorative Luminous Orbs */
.auth-bg-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.auth-glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.6;
  animation: orbFloat 14s ease-in-out infinite alternate;
}

.auth-glow-1 {
  top: -80px;
  left: 20%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(9, 168, 158, 0.35) 0%, transparent 70%);
}

.auth-glow-2 {
  bottom: -60px;
  right: 15%;
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(255, 184, 48, 0.22) 0%, transparent 70%);
  animation-delay: -5s;
}

.auth-glow-3 {
  top: 40%;
  left: -80px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(9, 168, 158, 0.25) 0%, transparent 70%);
  animation-delay: -9s;
}

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(25px, 20px) scale(1.08); }
  100% { transform: translate(-20px, -25px) scale(0.95); }
}

/* --------------------------------------------------------------------------
   2. AUTH CONTAINER & CARD (COMPACT HIGH-DENSITY FIT)
   -------------------------------------------------------------------------- */
.auth-container {
  position: relative;
  z-index: 1;
  max-width: 470px;
  margin: 0 auto;
  width: 100%;
}

.auth-card {
  background: #ffffff;
  border: 1px solid rgba(9, 168, 158, 0.18);
  border-radius: 18px;
  box-shadow: 
    0 20px 50px -15px rgba(9, 168, 158, 0.22),
    0 8px 20px -4px rgba(10, 25, 47, 0.07),
    0 0 0 1px rgba(255, 255, 255, 0.9) inset;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.auth-card:hover {
  box-shadow: 
    0 24px 60px -15px rgba(9, 168, 158, 0.26),
    0 12px 24px -4px rgba(10, 25, 47, 0.09),
    0 0 0 1px rgba(255, 255, 255, 0.95) inset;
}

/* --------------------------------------------------------------------------
   3. CARD HEADER (PRESTIGIOUS & COMPACT)
   -------------------------------------------------------------------------- */
.auth-header {
  position: relative;
  background: linear-gradient(135deg, #09a89e 0%, #078f86 55%, #056961 100%);
  color: #ffffff;
  padding: 1.15rem 1.5rem 1rem;
  text-align: center;
  overflow: hidden;
}

.auth-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 14px 14px;
  pointer-events: none;
  opacity: 0.9;
}

.auth-header-gold-line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, #ffb830 25%, #ffe699 50%, #ffb830 75%, transparent 100%);
  box-shadow: 0 -1px 6px rgba(255, 184, 48, 0.5);
}

.auth-emblem-wrap {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(6px);
}

.auth-emblem-icon {
  color: #ffffff;
}

.auth-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 184, 48, 0.18);
  color: #ffd675;
  border: 1px solid rgba(255, 184, 48, 0.45);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.2rem 0.7rem;
  border-radius: 9999px;
  margin-bottom: 0.45rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffb830;
  box-shadow: 0 0 6px #ffb830;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.auth-title {
  position: relative;
  z-index: 1;
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.2rem;
  letter-spacing: -0.015em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.auth-subtitle {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  color: #d1f4f1;
  margin: 0;
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   4. ROLE SEGMENTED TABS (COMPACT PILL)
   -------------------------------------------------------------------------- */
.auth-tabs-wrap {
  padding: 0.75rem 1.5rem 0;
  background: #ffffff;
}

.auth-tabs {
  display: flex;
  background: #eef6f5;
  border: 1px solid rgba(9, 168, 158, 0.15);
  padding: 3px;
  border-radius: 10px;
  gap: 3px;
}

.auth-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  background: transparent;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: #5a6a85;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-tab-btn svg {
  color: #8896ab;
  transition: color 0.2s ease;
}

.auth-tab-btn:hover {
  color: #09a89e;
}

.auth-tab-btn.active {
  background: #ffffff;
  color: #09a89e;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(9, 168, 158, 0.14), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.auth-tab-btn.active svg {
  color: #09a89e;
}

/* --------------------------------------------------------------------------
   5. FORM BODY & INPUTS (COMPACT MODERN PROPORTIONS)
   -------------------------------------------------------------------------- */
.auth-body {
  padding: 1.35rem 1.5rem 1.4rem;
  background: #ffffff;
}

/* Alert Boxes */
.auth-alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.auth-alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #b45309;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.45;
}

.auth-alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Form Groups */
.form-group-modern {
  margin-bottom: 0.85rem;
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.modern-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0;
}

.label-pill {
  font-size: 0.65rem;
  font-weight: 600;
  background: #e6f7f6;
  color: #09a89e;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.forgot-link {
  font-size: 0.775rem;
  color: #09a89e;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

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

/* Inputs */
.modern-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-left {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: color 0.2s ease;
}

.modern-input {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 2.65rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: #0f172a;
  background: #f8fafc;
  border: 1.5px solid #dbe5e4;
  border-radius: 10px;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.modern-input::placeholder {
  color: #94a3b8;
  font-size: 0.825rem;
}

.modern-input:focus {
  background: #ffffff;
  border-color: #09a89e;
  box-shadow: 0 0 0 3px rgba(9, 168, 158, 0.14);
}

.modern-input-wrapper:focus-within .input-icon-left {
  color: #09a89e;
}

.modern-input.is-invalid {
  border-color: #ef4444;
  background: #fff8f8;
}

.modern-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
}

.btn-toggle-pwd {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.btn-toggle-pwd:hover {
  color: #09a89e;
  background: #e6f7f6;
}

/* --------------------------------------------------------------------------
   6. REMEMBER ME & SUBMIT BUTTON
   -------------------------------------------------------------------------- */
.modern-remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.65rem 0 0.95rem;
}

.modern-checkbox-container {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.8125rem;
  color: #334155;
}

.modern-checkbox-container input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #09a89e;
  cursor: pointer;
  border-radius: 4px;
}

.checkbox-label-text {
  font-weight: 500;
}

/* Submit Button */
.btn-modern-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.925rem;
  font-weight: 700;
  font-family: inherit;
  color: #ffffff;
  background: linear-gradient(135deg, #09a89e 0%, #078f86 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(9, 168, 158, 0.3);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.btn-modern-submit::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.6s ease;
}

.btn-modern-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(9, 168, 158, 0.4);
  background: linear-gradient(135deg, #0ab8ad 0%, #089b91 100%);
}

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

.btn-modern-submit:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(9, 168, 158, 0.25);
}

.btn-submit-icon {
  transition: transform 0.2s ease;
}

.btn-modern-submit:hover .btn-submit-icon {
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   7. COMPACT SECURITY NOTICE
   -------------------------------------------------------------------------- */
.auth-security-notice {
  background: #f4faf9;
  border: 1px solid #d5ece9;
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  margin-top: 0.85rem;
  font-size: 0.75rem;
  color: #5a6a85;
  display: flex;
  gap: 0.65rem;
  align-items: center;
  line-height: 1.4;
}

.auth-security-icon-wrap {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #e6f7f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #09a89e;
}

.auth-security-text {
  flex: 1;
}

.auth-security-text strong {
  color: #0f172a;
  display: block;
  font-size: 0.775rem;
  margin-bottom: 0.1rem;
}

/* --------------------------------------------------------------------------
   8. COMPACT SINGLE-LINE FOOTER FOR LOGIN SCREEN
   -------------------------------------------------------------------------- */
.auth-compact-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 0.75rem;
  color: #64748b;
  padding: 0.45rem 1rem 0;
  margin-top: 0.25rem;
}

.auth-compact-footer a {
  color: #09a89e;
  text-decoration: none;
  font-weight: 600;
}

.auth-compact-footer a:hover {
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .auth-page-section {
    padding: 1.25rem 0.75rem;
  }

  .auth-header {
    padding: 1rem 1.25rem;
  }

  .auth-tabs-wrap {
    padding: 0.5rem 1rem 0;
  }

  .auth-body {
    padding: 0.85rem 1rem 1.25rem;
  }

  .auth-title {
    font-size: 1.15rem;
  }
}
