/* ============================================================
   1. GLOBAL VARIABLES & ROOT
   ============================================================ */
:root {
  --wap-bg: #f5f7fb;
  --wap-card: rgba(255, 255, 255, 0.82);
  --wap-card-border: rgba(255, 255, 255, 0.55);
  --wap-text: #111827;
  --wap-muted: #5f6b7a;
  --wap-border: #dfe5ee;
  --wap-primary: #2563eb;
  --wap-primary-hover: #1d4ed8;
  --wap-secondary: #64748b;
  --wap-secondary-hover: #475569;
  --wap-ring: rgba(37, 99, 235, 0.25);
  --wap-success-bg: rgba(232, 255, 236, 0.94);
  --wap-success-text: #237a2a;
  --wap-shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
  --wap-card-blur: 18px;
  --wap-card-opacity: 0.82;
}

/* ============================================================
   2. CORE PAGE & LAYOUT
   ============================================================ */
.wapgeo-page {
  background: var(--wap-bg);
  padding: clamp(14px, 3vw, 28px);
}

.wapgeo-card {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 28px);
  background: #fff;
  border: 1px solid var(--wap-border);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--wap-text);
}

.wapgeo-login-screen {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    linear-gradient(115deg, rgba(13, 35, 66, 0.52) 0%, rgba(28, 68, 129, 0.34) 36%, rgba(234, 205, 156, 0.22) 100%),
    url('../images/login-bg.webp') center center / cover no-repeat;
  overflow: hidden;
}

.wapgeo-login-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(13, 35, 66, 0.22) 0%, rgba(28, 68, 129, 0.14) 36%, rgba(234, 205, 156, 0.10) 100%);
}

.wapgeo-login-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ============================================================
   3. PANEL & PORTAL CONTAINERS
   ============================================================ */
.wapgeo-login-panel {
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, var(--wap-card-opacity, 0.82));
  border: 1px solid var(--wap-card-border);
  box-shadow: var(--wap-shadow);
  border-radius: 26px;
  padding: 24px;
  color: var(--wap-text);
  backdrop-filter: blur(var(--wap-card-blur, 18px));
  -webkit-backdrop-filter: blur(var(--wap-card-blur, 18px));
}

/* Specific Portal Expansion */
.wapgeo-portal-panel { 
  max-width: 760px !important; 
}

#wapgeo-portal.wapgeo-portal-panel {
  padding: 30px !important;
}

/* ============================================================
   4. TYPOGRAPHY & BRANDING
   ============================================================ */
.wapgeo-login-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

.wapgeo-login-logo {
  width: 72px;
  height: auto;
  display: block;
}

.wapgeo-title { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.wapgeo-subtitle { margin-top: 6px; color: var(--wap-muted); font-size: 13px; line-height: 1.4; }

.wapgeo-login-heading {
  margin: 0;
  text-align: center;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: #111827;
}

.wapgeo-portal-heading {
  text-align: left;
  font-size: clamp(26px, 4vw, 34px);
}

.wapgeo-login-text {
  margin: 12px auto 22px;
  text-align: center;
  color: #222f40;
  font-size: clamp(15px, 2vw, 17px);
  line-height: 1.45;
  max-width: 470px;
}

.wapgeo-portal-text {
  text-align: left;
  margin: 8px 0 0;
  max-width: none;
}

/* ============================================================
   5. FORM ELEMENTS & INPUTS
   ============================================================ */
.wapgeo-field { margin: 14px 0 0; }
.wapgeo-field label,
.wapgeo-login-inline label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
  color: #111827;
}

.wapgeo-form input[type="text"],
.wapgeo-form input[type="password"],
.wapgeo-job {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--wap-border);
  box-sizing: border-box;
  outline: none;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
}

.wapgeo-form input:focus,
.wapgeo-job:focus {
  border-color: var(--wap-primary);
  box-shadow: 0 0 0 4px var(--wap-ring);
}

.wapgeo-input-wrap { position: relative; }

/* ============================================================
   6. BUTTONS & ACTIONS
   ============================================================ */
.wapgeo-actions {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 12px !important;
  margin-top: 18px !important;
  align-items: center;
}

.wapgeo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 14px !important;
  border-radius: 12px !important;
  font-weight: 700;
  font-size: 16px !important;
  min-height: 52px !important;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

#wapgeo-portal .wapgeo-btn {
  min-height: 54px !important;
  font-size: 18px !important;
}

.wapgeo-login-btn {
  background: linear-gradient(90deg, #2f68ff 0%, #2357e6 100%);
  color: white;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.24);
}

.wapgeo-login-btn:hover { background: linear-gradient(90deg, #295ce2 0%, #1f4fd2 100%); }
.wapgeo-btn:active { transform: translateY(1px); }
.wapgeo-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.wapgeo-secondary { background-color: var(--wap-secondary); color: white; }
.wapgeo-secondary:hover { background-color: var(--wap-secondary-hover); }

/* ============================================================
   7. STATUS, LOGS & BADGES
   ============================================================ */
.wapgeo-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.wapgeo-userchip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--wap-border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--wap-muted);
  background: #fff;
}

.wapgeo-status {
  font-weight: 700;
  font-size: 13px;
  color: #111827;
  margin-top: 8px;
}

#wapgeo-portal .wapgeo-status {
  margin-bottom: 12px;
  font-size: 15px;
}

.wapgeo-log {
  margin-top: 14px;
  font-size: 13px;
  color: var(--wap-text);
}

#wapgeo-portal .wapgeo-log {
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  padding: 16px;
}

.wapgeo-login-badge {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--wap-success-text);
  background: var(--wap-success-bg);
  border: 1px solid rgba(77, 188, 96, 0.24);
  border-radius: 999px;
  padding: 8px 12px;
  line-height: 1;
}

.wapgeo-login-badge.is-verified {
  color: var(--wap-success-text);
  background: var(--wap-success-bg);
  border-color: rgba(77,188,96,0.24);
}

/* ============================================================
   8. FOOTER & MISC
   ============================================================ */
.wapgeo-divider {
  height: 1px;
  background: var(--wap-border);
  margin: 18px 0;
}

.wapgeo-footnote { margin-top: 12px; color: var(--wap-muted); font-size: 12px; line-height: 1.5; }

.wapgeo-login-footer {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: #4b5563;
  font-size: 12px;
  flex-wrap: wrap;
}

.wapgeo-login-copyright { opacity: .95; }
.wapgeo-login-developed { opacity: .9; }

.wapgeo-link { color: var(--wap-primary); text-decoration: none; font-weight: 700; }
.wapgeo-link:hover { text-decoration: underline; }

.wapgeo-error {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #9f1239;
  padding: 10px 12px;
  border-radius: 12px;
  margin: 12px 0 10px;
}

/* ============================================================
   9. RESPONSIVE DESIGN (MEDIA QUERIES)
   ============================================================ */

/* Tablet & Smaller */
@media (max-width: 900px) {
  .wapgeo-login-screen {
    padding: 18px;
    min-height: 100svh;
  }
  .wapgeo-login-panel {
    max-width: 520px;
    border-radius: 22px;
    padding: 24px 20px;
  }
}

/* Mobile Devices */
@media (max-width: 640px) {
  /* Force 2 columns for Clock In/Out even on small screens */
  .wapgeo-actions {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .wapgeo-login-screen {
    padding: 12px;
    align-items: stretch;
  }

  .wapgeo-login-shell {
    align-items: center;
  }

  .wapgeo-login-panel {
    max-width: 100%;
    border-radius: 20px;
    padding: 20px 16px;
  }

  .wapgeo-login-logo { width: 58px; }
  .wapgeo-login-heading { font-size: 28px; }
  .wapgeo-login-text { font-size: 15px; margin: 10px auto 18px; }

  .wapgeo-login-inline {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .wapgeo-btn {
    font-size: 15px !important;
    min-height: 48px !important;
  }

  .wapgeo-login-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .wapgeo-portal-heading { text-align: left; font-size: 28px; }
  .wapgeo-portal-text { text-align: left; }
}