/* =========================================================
   portal.css (ADMIN + TECH SKIN)
   Used by: Admin, Tech
   NOT used by: Items, ARAP
   ========================================================= */

/* EPIC Portal / Field style */
* { box-sizing: border-box; }

html, body { height: 100%; }

/* LOCK HORIZONTAL FLOAT / DRIFT */
html { overflow-x: hidden; }

body {
  margin: 0;
  overflow-x: hidden;          /* prevents sideways drift */
  max-width: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1f2937;
  background:
    radial-gradient(900px 520px at 18% 0%, rgba(31,111,214,0.08), transparent 58%),
    radial-gradient(900px 520px at 85% 10%, rgba(42,168,118,0.08), transparent 60%),
    radial-gradient(900px 520px at 60% 110%, rgba(242,201,76,0.10), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

/* Ensure no child element can cause sideways overflow */
img, svg, canvas, video {
  max-width: 100%;
  height: auto;
}

/* Portal container */
/* Portal layout — match Field App card width */
.wrap {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}


/* Brand block */
.brand {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

/* Match Field style logo sizing */
.logo {
  display: block;
  max-width: 200px;
  width: 100%;
  height: auto;
}

/* Card */
.card {
  background: #ffffff;
  border: 1px solid #e6e9ee;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  padding: 28px;
}

/* Typography */
.title {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 900;
  color: #111827;
}

.desc {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.6;
  color: #5f6b7a;
}

/* Bullets if present */
.bullets {
  margin: 0 0 22px;
  padding-left: 18px;
  color: #5f6b7a;
  font-size: 14px;
}
.bullets li { margin: 6px 0; }

/* Primary button (login) */
.btn-primary,
a.btn-primary,
button.btn-primary {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  font-weight: 750;
  color: #ffffff;
  cursor: pointer;
  background: linear-gradient(135deg, #1f6fd6, #2aa876);
  box-shadow: 0 10px 18px rgba(31,111,214,0.18);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:active,
a.btn-primary:active,
button.btn-primary:active {
  transform: translateY(1px);
}

.helper {
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  color: #5f6b7a;
}

/* Footer row (if any portals use it) */
.footer {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #8a94a6;
}

.link {
  color: #1f6fd6;
  text-decoration: none;
}
.link:hover { text-decoration: underline; }

/* =========================================================
   Admin/Portal menu blocks
   ========================================================= */

.menu {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.btn-menu {
  width: 100%;
  border: 1px solid #e6e9ee;
  background: #ffffff;
  color: #1f2937;
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  text-decoration: none; /* for <a> */
}

.btn-menu:active { transform: translateY(1px); }

.btn-menu .hint {
  font-size: 12px;
  font-weight: 700;
  color: #1f6fd6; /* EPIC blue */
  white-space: nowrap;
}

.menu-note {
  margin-top: 12px;
  font-size: 13px;
  color: #5f6b7a;
  text-align: center;
}

/* =========================================================
   Auth stage (stable height while auth resolves)
   ========================================================= */

.auth-stage {
  position: relative;
  width: 100%;
  min-height: 420px;
}

.auth-pane {
  position: absolute;
  inset: 0;
  width: 100%;
}

.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.is-shown {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 160ms ease;
}

.hidden { display: none !important; }

/* =========================================================
   Optional header-actions layout (if portal uses it)
   ========================================================= */

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-home,
a.btn-home {
  box-sizing: border-box;
  border: 1px solid #e6e9ee;
  background: #ffffff;
  color: #1f6fd6;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  appearance: none;
  -webkit-appearance: none;
}

.btn-home:active,
a.btn-home:active {
  transform: translateY(1px);
}

/* =========================================================
   Logout zone
   For ADMIN: you wanted BLUE filled button (not outline)
   ========================================================= */

.logout-zone {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid #eef1f5;
  display: flex;
  justify-content: center;
}

/* Admin Sign out — blue filled pill */
.btn-logout,
a.btn-logout,
button.btn-logout {
  background: #1f6fd6;
  border: 1px solid #1f6fd6;
  color: #ffffff;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-logout:active,
a.btn-logout:active,
button.btn-logout:active {
  transform: translateY(1px);
}

/* Small screens */
@media (max-width: 520px) {
  body { padding: 16px; }
  .card { padding: 20px; }
  .title { font-size: 26px; }
}

/* =========================================================
   Field App – Standard Card Header (Chrome)
   Used above each card in Tech (Field App)
   ---------------------------------------------------------
   LEFT:   Back to Apps (Admin portal)
   CENTER: App Home (Field App index)
   RIGHT:  Back (history.back)
   ========================================================= */

/* Header container */
.card-chrome {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px 0;
}

/* Slots */
.card-chrome .left {
  display: flex;
  justify-content: flex-start;
}

.card-chrome .center {
  display: flex;
  justify-content: center;
}

.card-chrome .right {
  display: flex;
  justify-content: flex-end;
}

/* Ensure buttons align cleanly */
.card-chrome a,
.card-chrome button {
  align-items: center;
}

/* =========================================================
   PWA behavior
   Hide "Back to Apps" ONLY when installed (standalone)
   ========================================================= */

/* Android / Chromium PWAs */
@media (display-mode: standalone) {
  .card-chrome .btn-home,
  .card-chrome a.btn-home {
    display: none !important;
  }
}

/* iOS standalone fallback (JS sets body.standalone) */
body.standalone .card-chrome .btn-home,
body.standalone .card-chrome a.btn-home {
  display: none !important;
}

/* =========================================================
   Field App – Chrome logo (small, consistent)
   ========================================================= */

.card-chrome .brand-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.card-chrome .brand-mini img {
  display: block;
  height: 28px;
  width: auto;
}

/* =========================================================
   Field App – Standard Card Header (INSIDE the card)
   Logo remains outside the card using existing .brand/.logo
   ========================================================= */

.card-chrome {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid #eef1f5;
}

.card-chrome .left {
  display: flex;
  justify-content: flex-start;
}

.card-chrome .center {
  display: flex;
  justify-content: center;
}

.card-chrome .right {
  display: flex;
  justify-content: flex-end;
}

/* =========================================================
   Shared pill base (ALL header buttons)
   ========================================================= */

.card-chrome a,
.card-chrome button {
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
  appearance: none;
  -webkit-appearance: none;
}

/* =========================================================
   LEFT: Back to Apps — BLUE FILLED
   ========================================================= */

.card-chrome .btn-home {
  background: #1f6fd6;
  border: 1px solid #1f6fd6;
  color: #ffffff;
}

.card-chrome .btn-home:active {
  transform: translateY(1px);
}

/* =========================================================
   CENTER: App Home — BLUE OUTLINE (pill, not text)
   ========================================================= */

.card-chrome .home-link {
  background: #ffffff;
  border: 1px solid #1f6fd6;
  color: #1f6fd6;
}

.card-chrome .home-link:active {
  transform: translateY(1px);
}

/* =========================================================
   RIGHT: Back — GRAY OUTLINE
   ========================================================= */

.card-chrome .btn-secondary {
  background: #ffffff;
  border: 1px solid #e6e9ee;
  color: #1f2937;
}

.card-chrome .btn-secondary:active {
  transform: translateY(1px);
}

/* =========================================================
   Hide "Back to Apps" ONLY in installed PWA mode
   (NOT hidden on mobile browser)
   ========================================================= */

@media (display-mode: standalone) {
  .card-chrome .btn-home {
    display: none !important;
  }
}

body.standalone .card-chrome .btn-home {
  display: none !important;
}

/* =========================================================
   Card metadata (Field App)
   Subtle build / update stamp (replaces Sign out)
   ========================================================= */

.card-meta {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid #f1f3f7;
  text-align: center;
  font-size: 11px;
  line-height: 1;
  color: #9aa3b2;
  opacity: 0.65;
  user-select: none;
}
