/* 
   HOME PORTAL CSS (Total Micro-Isolation)
*/

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&display=swap');

:root {
  --portal-bg: #ffffff;
  --portal-text: #000000;
  --portal-nav-bg: #e0f2fe;
  --portal-nav-text: #0f172a;
  --portal-accent: #3b82f6;
  --portal-border: #bae6fd;
  --portal-hover: #bae6fd;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--portal-bg);
  display: flex;
  flex-direction: column;
}

/* SECRET 5-TAP LOCK SCREEN */
.erp-lock-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #0c192c;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

.erp-lock-screen.unlocked {
  opacity: 0;
  visibility: hidden;
}

.secret-lock-logo {
  height: 120px;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.1s;
  user-select: none;
  -webkit-user-drag: none;
}

.secret-lock-logo:active {
  transform: scale(0.95);
}

/* FULL WIDTH HEADER */
.portal-global-header {
  width: 100%;
  height: 70px;
  background: #0c192c;
  display: flex;
  align-items: center;
  padding: 0 20px;
  box-shadow: 0 2px 15px rgba(0,0,0,0.08);
  z-index: 200;
  position: relative;
}

.sidebar-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #f8fafc;
  margin-right: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.public-logo img {
  height: 45px;
  object-fit: contain;
}

/* SIGN IN BUTTON */
.sign-in-btn {
  background-color: #ffffff;
  color: #0c192c;
  border: none;
  padding: 10px 24px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sign-in-btn:hover {
  background-color: #e0f2fe;
}

.sign-in-btn:active {
  transform: scale(0.98);
}

/* BODY WRAPPER */
.portal-body-wrapper {
  display: flex;
  flex: 1;
  width: 100vw;
  height: calc(100vh - 70px);
  position: relative;
  overflow: hidden;
}

/* SIDEBAR NAVIGATION */
.portal-sidebar {
  width: 280px;
  background-color: var(--portal-nav-bg);
  color: var(--portal-nav-text);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--portal-border);
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.portal-sidebar.collapsed {
  transform: translateX(-100%);
  width: 0;
  border-right: none;
}

.portal-sidebar-header {
  padding: 20px 20px;
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--portal-border);
  position: sticky;
  top: 0;
  background-color: var(--portal-nav-bg);
  z-index: 10;
}

.portal-nav-list {
  list-style: none;
  padding: 10px 0;
}

.portal-nav-item {
  margin: 2px 10px;
}

.portal-nav-link {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: var(--portal-nav-text);
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s, padding-left 0.2s;
  white-space: nowrap;
}

.portal-nav-link:hover {
  background-color: var(--portal-hover);
  color: #0c192c;
  padding-left: 20px;
}

/* MAIN CONTENT AREA - IMAGE SLIDER */
.portal-main {
  flex: 1;
  background-color: #ffffff;
  position: relative;
  overflow: hidden;
}

.slider-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.slider-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 2s ease-in-out, transform 10s linear;
  transform: scale(1.05);
}

.slider-image.active {
  opacity: 1;
  transform: scale(1);
}

/* PREMIUM OVERLAY TEXT */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(12, 25, 44, 0.85) 0%, rgba(12, 25, 44, 0.4) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 0 40px;
}

.hero-text-content {
  text-align: center;
  max-width: 900px;
}

.hero-text-content h1 {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 58px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 24px;
  letter-spacing: 1px;
  line-height: 1.2;
  text-shadow: 2px 4px 15px rgba(0,0,0,0.5);
}

.hero-text-content p {
  font-family: 'Roboto', sans-serif;
  font-size: 18px;
  font-weight: 300;
  color: #e2e8f0;
  line-height: 1.8;
  letter-spacing: 0.5px;
}

/* LOGIN MODAL */
.login-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(12, 25, 44, 0.9);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.login-modal-box {
  background: #ffffff;
  width: 400px;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  padding: 40px;
  position: relative;
}

.login-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #94a3b8;
  transition: color 0.2s;
}

.login-modal-close:hover {
  color: #0c192c;
}

.login-modal-title {
  text-align: center;
  margin-bottom: 30px;
}

.login-modal-title h2 {
  font-size: 24px;
  font-weight: 700;
  color: #0c192c;
  margin-bottom: 5px;
}

.login-modal-title p {
  font-size: 14px;
  color: #64748b;
}

.login-form-group {
  margin-bottom: 20px;
}

.login-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.login-form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 15px;
  color: #0f172a;
  transition: border-color 0.2s;
}

.login-form-group input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-submit-btn {
  width: 100%;
  background: #3b82f6;
  color: white;
  border: none;
  padding: 14px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 10px;
}

.login-submit-btn:hover {
  background: #2563eb;
}

.login-error {
  color: #ef4444;
  font-size: 13px;
  text-align: center;
  margin-top: 15px;
  min-height: 20px;
}

/* ========================================================= */
/* MOBILE RESPONSIVENESS INITIATIVE                          */
/* ========================================================= */
@media (max-width: 768px) {
  /* Off-Canvas Sidebar */
  .portal-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    height: 100vh;
    z-index: 9500;
  }
  .portal-sidebar.mobile-open {
    left: 0;
    transform: translateX(0);
    width: 280px;
  }
  
  /* Mobile Backdrop */
  .mobile-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9400;
    backdrop-filter: blur(2px);
    transition: opacity 0.3s;
    opacity: 0;
  }
  .mobile-backdrop.show {
    display: block;
    opacity: 1;
  }

  /* Anti-Bleed Header */
  .portal-global-header {
    flex-wrap: nowrap !important;
    overflow: hidden;
    padding: 0 15px;
  }
  .public-logo img {
    height: 35px; /* Shrink logo slightly on mobile */
  }
  .sign-in-btn {
    padding: 8px 16px;
    font-size: 12px;
  }

  /* Typography Scaling for Main Screen */
  .hero-text-content {
    padding: 0 15px;
  }
  .hero-text-content h1 {
    font-size: 32px;
    margin-bottom: 15px;
  }
  .hero-text-content p {
    font-size: 14px;
    line-height: 1.5;
  }

  /* Adjust lock screen logo for mobile */
  .secret-lock-logo {
    height: 80px;
  }

  /* Touch targets — Apple HIG 44pt / Material 48dp (DESIGN_SYSTEM.md -> Mobile Standard).
     The nav links measured 31px and the hamburger 30px, both too small to hit reliably
     on the yard floor. */
  .portal-nav-link {
    min-height: 44px;
    padding: 12px 16px;
    font-size: 15px;
    white-space: normal;
  }
  .sidebar-toggle-btn {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .sign-in-btn {
    min-height: 44px;
  }
  
  /* Login Modal Scaling */
  .login-modal-box {
    width: 90%;
    padding: 25px;
  }
}

/* ============================================================================
   SIGN-IN GATE (2026-09-01 handover rebuild)
   The portal is now the login page itself: split hero — brand copy on the left
   with the looping color-wave headline, the sign-in card on the right.
   Palette stays the VM three: white, dark navy #0c192c/#0F2942, sky #e0f2fe/#0284c7.
   ========================================================================== */

.vm-gate-overlay { padding: 24px; }

.vm-gate-split {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 72px;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.vm-gate-copy { flex: 1 1 520px; max-width: 620px; animation: vmGateIn 700ms ease-out both; }

.vm-gate-kicker {
  color: #7dd3fc;
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 4px;
  margin-bottom: 18px;
}

/* THE WAVE (owner ask): a white→sky gradient clipped to the letters, sweeping
   across on loop like a wave of light passing over the text. */
.vm-wave-text {
  font-family: 'Playfair Display', 'Roboto', serif;
  font-size: 56px;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 22px 0;
  background: linear-gradient(100deg,
      #ffffff 0%, #ffffff 35%,
      #7dd3fc 45%, #0284c7 50%, #7dd3fc 55%,
      #ffffff 65%, #ffffff 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #ffffff; /* fallback for engines without background-clip:text */
  animation: vmWaveSweep 5s linear infinite;
}
@keyframes vmWaveSweep {
  0%   { background-position: 125% 0; }
  100% { background-position: -125% 0; }
}

.vm-gate-lead {
  color: #e2e8f0;
  font-family: 'Roboto', sans-serif;
  font-size: 17px;
  font-weight: 300;
  line-height: 1.8;
  letter-spacing: 0.4px;
  margin-bottom: 26px;
}

.vm-gate-points { display: flex; flex-wrap: wrap; gap: 10px 12px; }
.vm-gate-points span {
  background: rgba(224, 242, 254, 0.12);
  border: 1px solid rgba(186, 230, 253, 0.35);
  color: #e0f2fe;
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 30px;
  backdrop-filter: blur(4px);
}

/* ---- The card ---- */
.vm-gate-cardwrap { flex: 0 0 400px; animation: vmGateIn 700ms 150ms ease-out both; }

.vm-login-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(4, 12, 24, 0.5);
  padding: 36px 34px 30px;
  text-align: center;
  animation: vmCardUp 500ms ease-out both;
}
@keyframes vmGateIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes vmCardUp { from { opacity: 0; transform: translateY(26px) scale(0.98); } to { opacity: 1; transform: none; } }

.vm-login-logo { height: 46px; margin-bottom: 16px; }
.vm-login-mono {
  width: 64px; height: 64px; border-radius: 50%;
  background: #e0f2fe; color: #0F2942;
  font-weight: 800; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; border: 3px solid #bae6fd;
}
.vm-login-h {
  color: #0c192c; font-family: 'Roboto', sans-serif;
  font-size: 21px; font-weight: 700; margin: 0 0 12px;
}
/* island-local copy of the VM signature rule (no shared CSS files — island law) */
.vm-login-rule {
  height: 3px; width: 120px; margin: 0 auto 14px; border-radius: 3px;
  background: linear-gradient(90deg, #0c192c, #0284c7, #bae6fd, #0c192c);
  background-size: 300% 100%;
  animation: vmFlowGate 4s linear infinite;
}
@keyframes vmFlowGate { 0% { background-position: 0% 0; } 100% { background-position: 300% 0; } }

.vm-login-sub {
  color: #6C757D; font-family: 'Roboto', sans-serif;
  font-size: 13.5px; line-height: 1.6; margin-bottom: 22px;
}

.vm-login-group { text-align: left; margin-bottom: 16px; }
.vm-login-group label {
  display: block; color: #0F2942; font-family: 'Roboto', sans-serif;
  font-size: 12.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; margin-bottom: 7px;
}
.vm-login-group input {
  width: 100%; box-sizing: border-box;
  border: 1px solid #bae6fd; border-radius: 10px;
  padding: 13px 14px; font-size: 15px; color: #0c192c;
  font-family: 'Roboto', sans-serif;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  min-height: 48px;
}
.vm-login-group input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 4px #e0f2fe;
}
.vm-login-pwdwrap { position: relative; }
.vm-login-pwdwrap input { padding-right: 48px; }
.vm-login-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 17px;
  padding: 8px; border-radius: 8px; min-width: 38px; min-height: 38px;
}
.vm-login-eye:hover { background: #f0f9ff; }

.vm-login-btn {
  display: block; width: 100%; box-sizing: border-box;
  background: #0F2942; color: #ffffff !important;
  border: none; border-radius: 10px;
  padding: 14px 18px; font-size: 15.5px; font-weight: 800;
  font-family: 'Roboto', sans-serif; letter-spacing: 0.3px;
  cursor: pointer; text-decoration: none; text-align: center;
  transition: background .15s ease, transform .1s ease;
  min-height: 50px; margin-top: 4px;
}
.vm-login-btn:hover { background: #134074; }
.vm-login-btn:active { transform: scale(0.98); }
.vm-login-btn:disabled { opacity: 0.75; cursor: default; }

.vm-login-spin {
  display: inline-block; width: 14px; height: 14px; vertical-align: -2px;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: #ffffff;
  border-radius: 50%; animation: vmSpin 700ms linear infinite;
}
@keyframes vmSpin { to { transform: rotate(360deg); } }

.vm-login-links {
  margin-top: 16px; font-family: 'Roboto', sans-serif; font-size: 13.5px;
  color: #6C757D; display: flex; gap: 8px; justify-content: center;
}
.vm-login-links a { color: #0284c7; font-weight: 700; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.vm-login-links a:hover { text-decoration: underline; }

/* Respect users who turn animations off */
@media (prefers-reduced-motion: reduce) {
  .vm-wave-text, .vm-login-rule, .vm-gate-copy, .vm-gate-cardwrap, .vm-login-card { animation: none; }
}

/* ---- Mobile: the card leads, the copy follows ---- */
@media (max-width: 900px) {
  .vm-gate-overlay { overflow-y: auto; align-items: flex-start; }
  .vm-gate-split { flex-direction: column-reverse; gap: 28px; padding: 18px 0 40px; }
  .vm-gate-copy { max-width: 100%; text-align: center; }
  .vm-wave-text { font-size: 34px; }
  .vm-gate-points { justify-content: center; }
  .vm-gate-cardwrap { flex: none; width: 100%; max-width: 420px; }
}
