@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary-color: #004068;
  --primary-dark: #f8fafc;
  --orange-accent: #004068;
  --orange-hover: #002140;
  --bg-light: #f7f7f7;
  --success-color: #00a28f;
  --error-color: #d74b29;
  --text-primary: #002140;
  --text-secondary: #5d7b9a;
  --border-color: rgba(0, 64, 104, 0.1);
  --brand-color: #004068;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Brand override variables */
  --btn-bg: var(--orange-accent);
  --btn-hover: var(--orange-hover);
  --btn-text: #ffffff;
  --circle-border-color: rgba(0, 64, 104, 0.15);
  --header-divider-bg: linear-gradient(to right, #00a2b8 0%, var(--primary-color) 50%, #002140 100%);
  --switch-active-bg: var(--orange-accent);
  --footer-accent-color: var(--orange-accent);

  /* Option A / Fine styling overrides */
  --header-bg: #ffffff;
  --header-badge-text-color: #5d7b9a;
  --header-badge-icon-color: var(--orange-accent);
  --card-title-color: #002140;
  --card-subtitle-color: #5d7b9a;
  --circle-icon-color: var(--primary-color);
  --circle-bg-color: #ffffff;

  /* Employee Card properties */
  --emp-card-bg: #ffffff;
  --emp-card-border: 1px solid rgba(0, 64, 104, 0.15);
  --emp-card-name-color: #002140;
  --emp-card-title-color: #5d7b9a;
  --emp-card-email-color: #5d7b9a;
  --emp-card-type-color: #004068;
  --emp-card-footer-brand-color: #5d7b9a;
  --emp-card-logo-filter: none;
  --emp-card-photo-bg: #f8fafc;
  --emp-card-photo-border: 1px solid rgba(0, 64, 104, 0.15);
  --emp-card-photo-color: #004068;
  --emp-card-header-border: 1px solid rgba(0, 64, 104, 0.1);
  --emp-card-footer-border: 1px solid rgba(0, 64, 104, 0.1);
  --emp-card-status-bg: #f0fdf4;
  --emp-card-status-border: 1px solid rgba(22, 101, 52, 0.2);
  --emp-card-status-text: #166534;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* BASE STYLES: MOBILE FIRST (Optimized for ~320px–430px) */
body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-primary);
  overflow-y: auto;
}

/* Header styling */
header {
  width: 100%;
  background-color: var(--header-bg);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.header-container {
  width: 100%;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-logo {
  height: 32px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  display: block;
  cursor: pointer;
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.header-badge i,
.header-badge svg {
  color: var(--header-badge-icon-color);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.header-badge-text {
  color: var(--header-badge-text-color);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-divider {
  height: 4px;
  width: 100%;
  background: var(--header-divider-bg);
  flex-shrink: 0;
}

/* Main content layout */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  position: relative;
}

/* Card - mobile view gets full width with margin padding */
.card {
  width: 90%;
  max-width: 350px;
  background-color: white;
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  text-wrap: pretty;
}

.card-fixed-height {
  height: 540px;
}

.card:hover {
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.1);
}

/* Card Header Band */
.card-header-band {
  background-color: var(--primary-dark);
  padding: 12px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 120px;
}

.card-header-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-bottom: 8px;
}

.circle-brand {
  background-color: var(--circle-bg-color);
  border: 2px solid var(--circle-border-color);
}

.circle-success {
  background-color: rgba(0, 162, 143, 0.2);
  border: 2px solid var(--success-color);
}

.circle-failure {
  background-color: rgba(215, 75, 41, 0.2);
  border: 2px solid var(--error-color);
}

.card-header-circle i,
.card-header-circle svg {
  width: 20px;
  height: 20px;
}

.card-header-circle .text-orange {
  color: var(--circle-icon-color);
}

.card-header-circle .text-success {
  color: var(--success-color);
  width: 24px;
  height: 24px;
}

.card-header-circle .text-failure {
  color: var(--error-color);
  width: 24px;
  height: 24px;
}

.card-title {
  color: var(--card-title-color);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0;
  line-height: 1.3;
}

.card-subtitle {
  color: var(--card-subtitle-color);
  font-size: 12px;
  font-weight: 400;
  margin-top: 4px;
}

/* Card Body */
.card-body {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  gap: 12px;
}

.card-body > * {
  flex-shrink: 0;
}

/* States container */
.state-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex: 1;
  width: 100%;
  gap: 12px;
}

.hidden {
  display: none !important;
}

/* Description styles */
.body-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  text-align: center;
}

/* 3-Step Flow Visualizer (Vertically Stacked for Mobile) */
.flow-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  margin-top: 6px;
  margin-bottom: 6px;
  flex: 1;
}

.flow-step {
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: left;
  width: 100%;
  gap: 12px;
}

.flow-step-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #e8eef3;
  border: 1px solid rgba(0, 64, 104, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.flow-step-icon i,
.flow-step-icon svg {
  color: var(--text-secondary);
  width: 18px;
  height: 18px;
}

.flow-step-icon.success i,
.flow-step-icon.success svg {
  color: var(--success-color);
}

.flow-step-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.4;
}

.flow-line {
  display: none;
  /* Hidden on mobile vertical layout */
}

/* Buttons */
.btn-brand {
  width: 100%;
  padding: 14px 20px;
  background-color: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  min-height: 44px;
  /* Accessible touch target */
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-brand:hover {
  background-color: var(--btn-hover);
  box-shadow:
    0 8px 12px -3px rgba(0, 0, 0, 0.1),
    0 3px 5px -2px rgba(0, 0, 0, 0.05);
}

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

.btn-brand i,
.btn-brand svg {
  width: 17px;
  height: 17px;
}

.btn-outline {
  flex: 1;
  padding: 14px 20px;
  background: transparent;
  color: var(--primary-color);
  border: 1px solid rgba(0, 64, 104, 0.25);
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  min-height: 44px;
  /* Accessible touch target */
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-outline:hover {
  background-color: #e8eef3;
}

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

/* QR Code responsive sizing */
.qrcode-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  flex: 1;
}

.qrcode-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 64, 104, 0.1);
  margin: 0 auto;
  max-width: 100%;
  position: relative;
}

.qrcode-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  z-index: 10;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: content-in 0.25s ease both;
}

.qrcode-overlay:hover {
  background: rgba(255, 255, 255, 0.92);
}

.qrcode-overlay.hidden {
  display: none !important;
}

.refresh-large-icon {
  width: 48px;
  height: 48px;
  color: var(--brand-color);
  opacity: 0.75;
  transition:
    color 0.3s ease,
    opacity 0.3s ease;
}

.qrcode-overlay:hover .refresh-large-icon {
  color: var(--orange-hover);
  opacity: 1;
}

/* Forces QR generated img and canvas to shrink responsively */
#qrcode img,
#qrcode canvas {
  display: block;
  max-width: 100%;
  height: auto !important;
  aspect-ratio: 1 / 1;
}

.countdown-text {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

.countdown-timer {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

.countdown-timer.warning {
  color: var(--error-color);
}

.countdown-timer.expired {
  color: var(--brand-color);
}

.scanning-subdesc {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
  max-width: 100%;
  text-wrap: pretty;
}

/* Demo simulation panel styling (Fixed to the bottom of the screen on mobile) */
.demo-controller-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  margin-top: 0;
  background-color: white;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.15);
  padding: 16px;
  border-top: 1px dashed rgba(0, 162, 143, 0.4);
  display: none;
  flex-direction: column;
  gap: 12px;
  z-index: 1000;
}

.demo-controller-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  margin-bottom: 2px;
}

.demo-controller-desc {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
  margin-bottom: 4px;
}

.demo-controller-buttons {
  display: flex;
  flex-direction: row;
  gap: 10px;
  width: 100%;
}

.btn-demo-success {
  width: 100%;
  padding: 10px;
  min-height: 44px;
  /* Accessible touch target */
  border-radius: 8px;
  background-color: rgba(0, 162, 143, 0.1);
  border: 1px solid rgba(0, 162, 143, 0.3);
  color: var(--success-color);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-demo-success:hover {
  background-color: rgba(0, 162, 143, 0.2);
}

.btn-demo-failure {
  width: 100%;
  padding: 10px;
  min-height: 44px;
  /* Accessible touch target */
  border-radius: 8px;
  background-color: rgba(215, 75, 41, 0.1);
  border: 1px solid rgba(215, 75, 41, 0.3);
  color: var(--error-color);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-demo-failure:hover {
  background-color: rgba(215, 75, 41, 0.2);
}

.btn-demo-timeout {
  width: 100%;
  padding: 10px;
  min-height: 44px;
  border-radius: 8px;
  background-color: rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(217, 119, 6, 0.3);
  color: #d97706;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-demo-timeout:hover {
  background-color: rgba(217, 119, 6, 0.2);
}

/* Error details (Failure state) on mobile */
.error-box {
  background-color: rgba(215, 75, 41, 0.06);
  border: 1px solid rgba(215, 75, 41, 0.25);
  border-radius: 12px;
  padding: 16px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.error-header {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.error-header i,
.error-header svg {
  color: var(--error-color);
  width: 14px;
  height: 14px;
}

.error-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--error-color);
  letter-spacing: 0.05em;
}

.error-desc {
  font-size: 13px;
  color: #3c3d3e;
  line-height: 1.5;
}

.error-support-separator {
  width: 100%;
  height: 1px;
  background-color: rgba(215, 75, 41, 0.15);
  margin: 8px 0;
}

.error-support-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.error-support-text a {
  text-decoration: none;
}

.error-support-text a:hover span {
  text-decoration: underline;
}

.error-support-text span {
  color: var(--footer-accent-color);
  font-weight: 600;
}

/* Localhost Tunnel Helper Notification */
.support-notification {
  border-left: 3px solid;
  border-radius: 8px;
  padding: 12px;
  text-align: left;
  display: flex;
  gap: 12px;
  width: 100%;
}

.support-notification-icon {
  font-size: 18px;
  line-height: 1;
}

.support-notification-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.support-notification-desc {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-secondary);
}

/* Employee Card layout: Vertically stacked on mobile */
.employee-card {
  width: 100%;
  background: var(--emp-card-bg);
  border-radius: 12px;
  padding: 12px 16px;
  color: white;
  box-shadow:
    0 8px 20px -5px rgba(0, 0, 0, 0.15),
    0 6px 8px -6px rgba(0, 0, 0, 0.15);
  border: var(--emp-card-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* Space out header, body, and footer vertically */
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease;
  text-align: left;
  /* Left align on mobile */
  height: 160px;
  /* Constrain card height to enforce rectangular shape on mobile */
}

.employee-card:hover {
  transform: translateY(-2px);
}

.employee-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    115deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.03) 30%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.03) 70%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(-10deg);
  pointer-events: none;
}

.emp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: var(--emp-card-header-border);
  padding-bottom: 6px;
  width: 100%;
}

.emp-card-logo {
  height: 18px;
  width: auto;
  max-width: 90px;
  object-fit: contain;
  filter: var(--emp-card-logo-filter);
  opacity: 0.9;
}

.emp-card-type {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--emp-card-type-color);
  text-transform: uppercase;
}

.emp-card-body {
  display: flex;
  flex-direction: row;
  /* Side-by-side user photo and text by default */
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  width: 100%;
}

.emp-card-photo {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background-color: var(--emp-card-photo-bg);
  border: var(--emp-card-photo-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--emp-card-photo-color);
}

.emp-card-photo svg,
.emp-card-photo i {
  width: 28px;
  height: 28px;
}

.emp-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  align-items: flex-start;
  /* Left-align text */
  width: 100%;
}

.emp-card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--emp-card-name-color);
  margin: 0;
  width: 100%;
  white-space: normal;
  /* Wraps cleanly on mobile */
  word-break: break-word;
}

.emp-card-title {
  font-size: 12px;
  color: var(--emp-card-title-color);
  margin: 0;
  width: 100%;
  white-space: normal;
  /* Wraps cleanly on mobile */
  word-break: break-word;
}

.emp-card-email {
  font-size: 11px;
  color: var(--emp-card-email-color);
  margin: 0;
  width: 100%;
  white-space: normal;
  /* Wraps cleanly on mobile */
  word-break: break-all;
  /* Break long email addresses */
}

.emp-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: var(--emp-card-footer-border);
  padding-top: 8px;
  margin-top: 4px;
  width: 100%;
}

.emp-card-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: var(--emp-card-status-bg);
  border: var(--emp-card-status-border);
  color: var(--emp-card-status-text);
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.emp-card-status svg,
.emp-card-status i {
  width: 12px;
  height: 12px;
}

.emp-card-footer-brand {
  font-size: 11px;
  font-weight: 600;
  color: var(--emp-card-footer-brand-color);
  letter-spacing: 0.05em;
}

/* Helper table cells configuration */
td:first-child {
  width: 40%;
}

td:last-child {
  width: 60%;
}

/* Animations definitions */
@keyframes content-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes icon-pop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  70% {
    transform: scale(1.1);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translate(20px, -50%);
  }

  to {
    opacity: 1;
    transform: translate(0, -50%);
  }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.content-in {
  animation: content-in 0.3s ease both;
}

.icon-pop {
  animation: icon-pop 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* SMALL HEIGHT MOBILE DEVICES (e.g. iPhone SE) */
@media (max-height: 650px) and (max-width: 767px) {
  .card-fixed-height {
    height: 480px;
  }

  main {
    padding: 8px 12px;
  }

  .flow-container {
    gap: 12px;
  }
}

/* TABLET AND DESKTOP OVERRIDES (Widths >= 768px) */
@media (min-width: 768px) {
  body {
    height: 100vh;
    overflow: hidden;
  }

  .header-container {
    padding: 16px 24px;
    gap: 0;
  }

  .header-logo {
    height: 32px;
    max-width: 140px;
  }

  .header-badge {
    gap: 8px;
  }

  .header-badge i,
  .header-badge svg {
    width: 16px;
    height: 16px;
  }

  .header-badge-text {
    font-size: 13px;
    max-width: none;
  }

  main {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    overflow: hidden;
  }

  .card {
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
  }

  .card-fixed-height {
    height: 540px;
    max-height: none;
    /* Reset mobile height restrictions */
  }

  .card-header-band {
    padding: 0 32px;
    height: 140px;
  }

  .card-header-circle {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
  }

  .card-header-circle i,
  .card-header-circle svg {
    width: 20px;
    height: 20px;
  }

  .card-header-circle .text-success,
  .card-header-circle .text-failure {
    width: 24px;
    height: 24px;
  }

  .card-title {
    font-size: 16px;
  }

  .card-body {
    padding: 16px 24px;
    overflow-y: auto;
    gap: 0;
  }

  .state-container {
    justify-content: space-around;
    gap: 0;
  }

  #state-idle .flow-container {
    margin-top: auto;
    margin-bottom: auto;
  }

  #state-idle .body-desc {
    margin-top: 8px;
    margin-bottom: 12px;
  }

  /* Horizontal flow step design for tablets/desktops */
  .flow-container {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    margin-top: 24px;
    margin-bottom: 8px;
    gap: 0;
    flex: none;
  }

  .flow-step {
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 96px;
    gap: 8px;
  }

  .flow-step-icon {
    width: 56px;
    height: 56px;
  }

  .flow-step-icon i,
  .flow-step-icon svg {
    width: 24px;
    height: 24px;
  }

  .flow-step-text {
    font-size: 10px;
    line-height: 1.25;
  }

  .flow-line {
    display: block;
    flex: 1;
    height: 1px;
    background-color: rgba(0, 64, 104, 0.15);
    margin-top: 28px;
    position: relative;
  }

  .flow-line::after {
    content: '';
    position: absolute;
    right: 0;
    top: -3px;
    width: 6px;
    height: 6px;
    border-top: 1.5px solid rgba(0, 64, 104, 0.25);
    border-right: 1.5px solid rgba(0, 64, 104, 0.25);
    transform: rotate(45deg);
  }

  /* Horizontal layout for employee card on Success state */
  .employee-card {
    border-radius: 16px;
    padding: 16px 20px;
    gap: 16px;
    text-align: left;
    height: auto;
    /* Reset mobile height limit */
    justify-content: flex-start;
    /* Reset mobile alignment distribution */
  }

  .emp-card-logo {
    height: 24px;
    max-width: 110px;
  }

  .emp-card-body {
    flex-direction: row;
    /* Side by side user photo and text */
    gap: 16px;
    align-items: center;
  }

  .emp-card-info {
    align-items: flex-start;
    text-align: left;
    gap: 3px;
  }

  .emp-card-name {
    font-size: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .emp-card-title {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .emp-card-email {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .emp-card-footer {
    padding-top: 10px;
  }

  /* Left-aligned error box on tablet/desktop */
  .error-box {
    margin-bottom: 20px;
    text-align: left;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .error-header {
    justify-content: flex-start;
  }

  /* Restore static positioning for tablet range */
  .demo-controller-panel {
    position: static;
    transform: none;
    width: 100%;
    max-width: 448px;
    margin-top: 20px;
    border-radius: 16px;
    padding: 24px;
    bottom: auto;
    left: auto;
    border: 1px dashed rgba(0, 162, 143, 0.4);
    box-shadow: var(--shadow-xl);
  }

  .demo-controller-buttons {
    flex-direction: column;
  }
}

/* WIDE DESKTOP BREAKPOINTS (Widths >= 1024px) */
@media (min-width: 1024px) {
  main {
    overflow: visible;
  }

  /* Float demo controls to the side of the main verification card */
  .demo-controller-panel {
    position: absolute;
    left: calc(50% + 224px + 24px);
    top: 50%;
    transform: translateY(-50%);
    width: 280px;
    bottom: auto;
    /* Reset mobile absolute bottom positioning */
    margin-top: 0;
    border-radius: 16px;
    padding: 24px;
    animation: slide-in 0.3s ease-out;
    display: none;
    /* Controlled dynamically by JS classes */
  }
}

@media (max-height: 580px) and (min-width: 768px) {
  .card-fixed-height {
    height: 500px;
  }

  .card-header-band {
    height: 110px;
  }

  .card-header-circle {
    width: 36px;
    height: 36px;
    margin-bottom: 4px;
  }

  .card-header-circle i,
  .card-header-circle svg {
    width: 16px;
    height: 16px;
  }

  .card-header-circle .text-success,
  .card-header-circle .text-failure {
    width: 20px;
    height: 20px;
  }

  .card-title {
    font-size: 14px;
  }

  .card-subtitle {
    display: none;
  }

  .card-body {
    padding: 12px 20px;
  }

  header .header-container {
    padding: 6px 24px;
  }

  main {
    padding: 8px 16px;
  }
}

@media (max-height: 690px) and (min-width: 768px) {
  body {
    height: auto;
    overflow-y: auto;
  }

  main {
    overflow-y: visible;
  }
}

.emp-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9px;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1.2s linear infinite;
}

.refresh-request-container {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.btn-text-link {
  background: none;
  border: none;
  color: var(--brand-color);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  transition:
    background-color 0.2s,
    color 0.2s;
}

.btn-text-link:hover {
  background-color: rgba(0, 64, 104, 0.05);
  color: var(--orange-hover);
}

.btn-text-link i,
.btn-text-link svg {
  width: 13px;
  height: 13px;
}

/* Language Switcher Styling */
.lang-switcher-container {
  position: relative;
  display: inline-block;
  font-family: 'Inter', sans-serif;
  z-index: 1000;
}

.lang-btn {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.lang-btn:hover,
.lang-btn.active {
  background-color: rgba(0, 64, 104, 0.05);
  border-color: var(--brand-color);
}

.lang-btn i,
.lang-btn svg {
  width: 15px;
  height: 15px;
  color: var(--brand-color);
  flex-shrink: 0;
}

.lang-btn .chevron-icon {
  width: 12px;
  height: 12px;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.lang-btn.active .chevron-icon {
  transform: rotate(180deg);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-switcher-container {
  position: relative;
}

.lang-modal-overlay {
  position: absolute;
  top: 100%;
  right: 0;
  width: 200px;
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  padding: 6px 0;
}

.lang-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(4px);
}

.lang-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.lang-item {
  width: 100%;
}

.lang-item a {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  padding: 10px 16px;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
  white-space: nowrap;
}

.lang-item a:hover {
  background-color: rgba(0, 0, 0, 0.04);
  color: var(--brand-color);
}

.lang-item.active a {
  color: var(--brand-color);
  font-weight: 700;
  background-color: rgba(0, 0, 0, 0.02);
}

@media (max-width: 767px) {
  .lang-modal {
    padding: 0;
  }

  .lang-modal-content {
    position: relative;
    padding: 40px 24px 24px 24px;
    display: block;
  }

  .lang-close-btn {
    position: absolute;
    top: 8px;
    right: 16px;
    padding: 4px;
  }

  .lang-list {
    grid-template-columns: repeat(2, 1fr);
    max-height: 50vh;
    overflow-y: auto;
  }
}

@media (max-width: 479px) {
  .lang-list {
    grid-template-columns: 1fr;
  }

  .header-badge {
    display: none;
    /* Hide badge on very narrow screens if space is tight */
  }
}

@media (max-width: 360px) {
  .lang-btn {
    padding: 6px 8px;
    font-size: 12px;
  }

  .lang-btn span {
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
