:root {
  --green: #004d32;
  --green-dark: #003a27;
  --green-deep: #002e20;
  --green-soft: #e9f3ef;
  --gold: #d9b44a;
  --gold-dark: #b68d23;
  --text: #16362b;
  --muted: #63766f;
  --line: #e3e8e5;
  --danger: #a52525;
  --danger-bg: #fff1f1;
  --success-bg: #eaf7ef;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #02150f;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 28px 16px;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(74, 126, 78, 0.48), transparent 38%),
    radial-gradient(circle at bottom right, rgba(3, 116, 79, 0.28), transparent 42%),
    linear-gradient(135deg, #05291d, #003a29 54%, #02150f);
}

button,
a,
input {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

.is-hidden {
  display: none !important;
}

.page-shell {
  width: min(590px, 100%);
  margin: 0 auto;
}

.company-logo {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  background: transparent;
}

/* =========================================================
   ROOT VERIFICATION PORTAL
   ========================================================= */

.portal-panel {
  overflow: hidden;
  border-radius: 24px;
  background: var(--white);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

.portal-hero {
  min-height: 236px;
  padding: 34px 30px 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: white;
  text-align: center;
  background:
    linear-gradient(
      130deg,
      transparent 74%,
      rgba(217, 180, 74, 0.96) 75%,
      rgba(217, 180, 74, 0.96) 82%,
      transparent 83%
    ),
    linear-gradient(135deg, #006044, #003b2a);
}

.portal-logo {
  width: 292px;
  max-height: 116px;
}

.portal-hero-title {
  font-size: 23px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 1.3px;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.portal-content {
  position: relative;
  padding: 68px 38px 32px;
  text-align: center;
}

.portal-shield {
  width: 104px;
  height: 104px;
  position: absolute;
  top: -52px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  border: 14px solid var(--white);
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 46px;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

.portal-eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
}

.portal-title {
  margin: 0;
  color: var(--green);
  font-size: 31px;
  line-height: 1.18;
}

.portal-description {
  max-width: 470px;
  margin: 14px auto 27px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.verification-form {
  padding: 20px;
  border: 1px solid #dbe6e1;
  border-radius: 16px;
  background: #f8faf9;
  text-align: left;
}

.verification-form label {
  display: block;
  margin-bottom: 9px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.verification-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.verification-input-row input {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 15px;
  border: 1px solid #bfcfc8;
  border-radius: 10px;
  outline: none;
  background: white;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.verification-input-row input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(0, 77, 50, 0.1);
}

.verify-code-btn {
  min-width: 112px;
  height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: white;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.7px;
  cursor: pointer;
}

.verify-code-btn:hover {
  filter: brightness(1.08);
}

.portal-message {
  margin-top: 14px;
  padding: 13px 15px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
}

.portal-message.error {
  border: 1px solid #f2c0c0;
  background: var(--danger-bg);
  color: var(--danger);
}

.portal-message.success {
  border: 1px solid #b9e1c8;
  background: var(--success-bg);
  color: #126634;
}

.access-guide {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  text-align: left;
}

.access-guide-item {
  min-height: 116px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.access-guide-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 20px;
}

.access-guide-item strong,
.access-guide-item span {
  display: block;
}

.access-guide-item strong {
  margin: 2px 0 6px;
  color: var(--green);
  font-size: 14px;
}

.access-guide-item div > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.portal-security-note {
  margin-top: 18px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 12px;
  background: var(--green-soft);
  color: #31594b;
  text-align: left;
}

.portal-security-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}

.admin-login-link {
  display: inline-block;
  margin-top: 24px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.admin-login-link:hover {
  text-decoration: underline;
}

/* =========================================================
   LOADING SCREEN
   ========================================================= */

.loading-panel {
  min-height: 460px;
  padding: 50px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  border-radius: 24px;
  background: #f9fbfa;
  color: var(--green);
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

.loading-panel strong {
  font-size: 18px;
}

.loading-panel span {
  color: var(--muted);
  font-size: 14px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  border: 5px solid #d5e8e1;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================================================
   PUBLIC EMPLOYEE PROFILE
   ========================================================= */

.phone-panel {
  overflow: hidden;
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.verification-panel {
  padding-bottom: 18px;
  background: linear-gradient(180deg, #00583a, #003a27);
}

.brand-header {
  min-height: 215px;
  padding: 24px 28px 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  background:
    linear-gradient(
      130deg,
      transparent 76%,
      rgba(217, 180, 74, 0.95) 77%,
      rgba(217, 180, 74, 0.95) 83%,
      transparent 84%
    ),
    linear-gradient(135deg, #005b3d, #003b29);
}

.brand-header-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.header-logo {
  width: 290px;
  max-height: 112px;
}

.header-title {
  color: white;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 1.4px;
  white-space: nowrap;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
}

.status-banner {
  margin: 14px 18px;
  padding: 13px 16px;
  border-radius: 10px;
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 700;
  line-height: 1.4;
}

.profile-card {
  width: calc(100% - 34px);
  margin: 0 auto;
  padding: 86px 28px 26px;
  position: relative;
  border-radius: 22px;
  background: white;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.verify-icon {
  width: 108px;
  height: 108px;
  position: absolute;
  top: -54px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  border: 15px solid white;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 46px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.13);
}

.profile-card h1 {
  margin: 0;
  color: var(--green);
  font-size: 26px;
  text-align: center;
}

.certification {
  max-width: 600px;
  margin: 14px auto 28px;
  color: #416559;
  line-height: 1.55;
  text-align: center;
}

.section-title {
  margin-top: 24px;
  padding-bottom: 8px;
  position: relative;
  border-bottom: 1px solid var(--line);
  color: var(--green);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.section-title::after {
  content: "";
  width: 36px;
  height: 2px;
  position: absolute;
  bottom: -1px;
  left: 0;
  background: var(--gold);
}

.info-list {
  display: grid;
  gap: 0;
}

.info-row {
  display: grid;
  grid-template-columns: 34px 150px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f2f1;
}

.info-row:last-child {
  border-bottom: 0;
}

.info-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 14px;
}

.info-label {
  color: #39564d;
  font-size: 14px;
}

.info-value {
  overflow-wrap: anywhere;
  color: #1c332b;
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

.status-badge {
  display: inline-block;
  min-width: 120px;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-active {
  background: #16a34a;
  color: #ffffff;
}

.status-on-leave {
  background: #7c3aed;
  color: #ffffff;
}

.status-absent {
  background: #facc15;
  color: #332700;
}

.status-suspended {
  background: #f97316;
  color: #ffffff;
}

.status-terminated {
  background: #dc2626;
  color: #ffffff;
}

.status-default {
  background: #6b7280;
  color: #ffffff;
}

.action-row {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 12px;
}

.action-btn,
.download-btn {
  min-height: 54px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: white;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.action-btn.primary,
.download-btn {
  background: var(--green);
  color: white;
}

.action-btn:hover,
.download-btn:hover {
  filter: brightness(0.96);
}

.button-icon {
  font-size: 17px;
}

.verification-footer {
  width: calc(100% - 34px);
  margin: 16px auto 0;
  padding: 18px 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 0;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.13);
  color: white;
  text-align: left;
  cursor: pointer;
}

.verification-footer:hover {
  background: rgba(0, 0, 0, 0.22);
}

.verification-footer:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.verification-footer-content {
  display: grid;
  gap: 5px;
}

.verification-footer strong {
  color: white;
  font-size: 15px;
}

.verification-footer span {
  color: #d8eee6;
  font-size: 14px;
}

.footer-arrow {
  color: white !important;
  font-size: 32px !important;
  line-height: 1;
}

.return-home-link {
  display: block;
  width: fit-content;
  margin: 17px auto 2px;
  color: #d8eee6;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.return-home-link:hover {
  color: white;
  text-decoration: underline;
}

/* =========================================================
   VCARD PAGE
   ========================================================= */

.vcard-panel {
  padding: 26px 22px 34px;
  background: #fbfbf9;
}

.vcard-heading-row {
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
}

.vcard-heading-row h2 {
  margin: 4px 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--green);
  font-size: 23px;
  text-align: center;
}

.vcard-heading-row h2 span {
  width: 40px;
  height: 2px;
  background: var(--gold);
}

.back-btn {
  padding: 0 0 18px;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 42px;
  line-height: 1;
  cursor: pointer;
}

.heading-spacer {
  width: 42px;
}

.vcard-card {
  overflow: hidden;
  border: 1px solid #e5e8e6;
  border-radius: 18px;
  background: white;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.vcard-brand {
  min-height: 160px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  background:
    linear-gradient(
      135deg,
      transparent 76%,
      rgba(217, 180, 74, 0.95) 77%,
      rgba(217, 180, 74, 0.95) 83%,
      transparent 84%
    ),
    linear-gradient(135deg, #005c3d, #003824);
}

.vcard-logo {
  width: 260px;
  max-height: 110px;
}

.compact {
  padding: 10px 18px 18px;
}

.compact .info-row {
  grid-template-columns: 30px 125px 1fr;
  padding: 10px 0;
}

.compact .info-value {
  font-size: 14px;
}

.download-btn {
  width: 100%;
  margin: 24px 0 20px;
  font-size: 16px;
}

.code-preview {
  overflow: hidden;
  border: 1px solid #e0e4e2;
  border-radius: 12px;
  background: white;
}

.code-label {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

pre {
  max-height: 290px;
  margin: 0;
  padding: 16px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #384a43;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  line-height: 1.45;
}

.help-note {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  background: #f1f3f2;
  color: #5a6863;
  font-size: 14px;
  line-height: 1.4;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 880px) {
  body {
    padding: 0;
    background: #f2f4f3;
  }

  .page-shell {
    width: 100%;
  }

  .portal-panel,
  .phone-panel,
  .loading-panel {
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }

  .vcard-panel {
    padding: 24px 16px 34px;
  }

  .info-row,
  .compact .info-row {
    grid-template-columns: 30px 120px 1fr;
  }
}

@media (max-width: 520px) {
  .portal-hero {
    min-height: 220px;
    padding: 30px 18px 68px;
  }

  .portal-logo {
    width: 245px;
  }

  .portal-hero-title {
    font-size: 20px;
    letter-spacing: 1px;
  }

  .portal-content {
    padding: 64px 20px 28px;
  }

  .portal-title {
    font-size: 27px;
  }

  .portal-description {
    font-size: 15px;
  }

  .verification-input-row {
    grid-template-columns: 1fr;
  }

  .verify-code-btn {
    width: 100%;
  }

  .access-guide {
    grid-template-columns: 1fr;
  }

  .access-guide-item {
    min-height: auto;
  }

  .brand-header {
    min-height: 195px;
    padding: 20px 18px 55px;
  }

  .header-logo {
    width: 245px;
    max-height: 98px;
  }

  .header-title {
    font-size: 20px;
    letter-spacing: 1px;
  }

  .profile-card {
    width: calc(100% - 20px);
    padding-left: 18px;
    padding-right: 18px;
  }

  .info-row,
  .compact .info-row {
    grid-template-columns: 30px 1fr;
  }

  .info-value {
    grid-column: 2;
    padding-bottom: 2px;
    text-align: left;
  }

  .action-row {
    grid-template-columns: 1fr;
  }

  .action-btn {
    width: 100%;
  }

  .vcard-heading-row h2 {
    gap: 8px;
    font-size: 19px;
  }

  .vcard-heading-row h2 span {
    width: 24px;
  }

  .vcard-brand {
    min-height: 150px;
  }

  .vcard-logo {
    width: 225px;
    max-height: 100px;
  }
}

@media (max-width: 380px) {
  .portal-logo {
    width: 220px;
  }

  .portal-hero-title {
    font-size: 18px;
  }

  .portal-title {
    font-size: 24px;
  }

  .brand-header {
    min-height: 185px;
    padding: 18px 14px 52px;
  }

  .header-logo {
    width: 215px;
  }

  .header-title {
    font-size: 18px;
    letter-spacing: 0.7px;
  }

  .vcard-logo {
    width: 200px;
  }
}
