:root {
  --app-red: #bc0b0f;
  --app-red-dark: #d53a2f;
  --logo-red-match: #b20e0f;
  --accent-yellow: #ffc107;
  --panel-border: rgba(255, 255, 255, 0.18);
  --timer-height: 42px;
  --brand-logo-h-desktop: clamp(104px, 11.4vh, 148px);
  --brand-logo-h-mobile: clamp(74px, 13.5vh, 108px);
  --brand-logo-h-mobile-small: clamp(58px, 11.2vh, 86px);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  font-family: "Roboto", sans-serif !important;
  color: #fff;
  background: var(--app-red);
  overflow: hidden;
}

button,
.btn {
  min-width: 44px;
  min-height: 44px;
}

.kiosk-page {
  width: 100vw;
  height: 100dvh;
  min-height: 100vh;
  display: block;
  padding: 0;
}

.phone-mockup {
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--app-red);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.phone-content {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--app-red);
}

.screens-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: var(--timer-height);
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  padding: clamp(10px, 1.8vh, 14px) clamp(16px, 3vw, 28px) clamp(10px, 1.8vh, 14px);
  position: relative;
  overflow: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.45) transparent;
}

.screen::-webkit-scrollbar {
  width: 5px;
}

.screen::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.45);
  border-radius: 10px;
}

.screen.active {
  display: flex;
}

.fade-in {
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#screen-1 {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: clamp(12px, 2.2vh, 24px);
}

#screen-1 .my-auto {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

#screen-1 .mt-1.text-center {
  margin-top: 0 !important;
}

#screen-1 .mb-5.text-center {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.screen-top-meta {
  min-height: 20px;
}

.header-nav {
  margin-top: 0;
  padding: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 24px;
}

.header-gear,
.header-refresh {
  line-height: 1;
}

.header-nav .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-gear svg,
.header-refresh svg,
.header-nav .btn svg {
  width: clamp(14px, 1.8vw, 20px);
  height: clamp(14px, 1.8vw, 20px);
}

.header-nav .back-btn {
  min-width: clamp(58px, 5vw, 74px);
  min-height: clamp(58px, 5vw, 74px);
  padding: 0 !important;
}

.header-nav .back-btn svg {
  width: clamp(28px, 2.8vw, 38px) !important;
  height: clamp(28px, 2.8vw, 38px) !important;
}

.header-nav .back-btn svg path {
  stroke: currentColor;
  stroke-width: 0.35;
  paint-order: stroke fill;
}

#screen-1 .small {
  font-size: clamp(11px, 0.95vw, 13px) !important;
  line-height: 1.2;
}

#screen-1 h2 {
  font-size: clamp(28px, 3.2vw, 40px) !important;
  margin-top: 2px;
  margin-bottom: 8px;
}

#screen-1 img.w-75 {
  width: min(38vw, 260px) !important;
}

#screen-1 .btn-light {
  background: transparent;
  border: 0;
  color: #fff;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  font-size: clamp(28px, 3vw, 46px);
  line-height: 1;
}

#screen-2 .img-fluid,
#screen-3 .img-fluid,
#screen-4 .img-fluid,
#screen-5 .img-fluid,
#screen-6 .img-fluid,
#screen-7 .img-fluid,
#screen-8 .img-fluid {
  height: var(--brand-logo-h-desktop) !important;
  width: auto;
  object-fit: contain;
}

#screen-2 .mt-2.mb-4,
#screen-3 .mt-2.mb-4,
#screen-4 .mt-2.mb-4,
#screen-5 .mt-2.mb-4,
#screen-6 .mt-2.mb-4,
#screen-7 .mt-2.mb-4,
#screen-8 .mt-2.mb-4 {
  margin-top: 6px !important;
  margin-bottom: clamp(16px, 2.6vh, 28px) !important;
}

.choice-grid {
  flex-wrap: nowrap !important;
  flex-direction: row !important;
  justify-content: center !important;
  gap: clamp(10px, 1.2vw, 14px) !important;
  margin-top: 4px;
}

.square-btn,
.square-btn-screen3 {
  width: min(42vw, 280px);
  min-height: min(36vh, 230px);
  background-color: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.1s ease;
  border-width: 2px !important;
  padding: 16px 12px 12px;
}

.square-btn img {
  width: clamp(62px, 6.8vw, 96px);
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.square-btn-screen3 {
  width: min(42vw, 280px);
  min-height: min(36vh, 230px);
  justify-content: center;
}

.square-btn-screen3 img {
  width: clamp(62px, 6.8vw, 96px);
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.square-btn:hover,
.square-btn-screen3:hover {
  filter: brightness(1.08);
}

.square-btn:active,
.square-btn-screen3:active {
  transform: scale(0.98);
}

#screen-2 .square-btn span,
#screen-3 .square-btn-screen3 .screen3-card-title {
  font-size: clamp(26px, 3.5vw, 50px) !important;
  line-height: 1;
}

#screen-3 .screen3-card {
  height: min(36vh, 230px);
  min-height: min(36vh, 230px);
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
  padding: clamp(14px, 2vh, 20px) clamp(10px, 1.4vw, 14px)
    clamp(12px, 1.6vh, 16px);
}

#screen-3 .screen3-card-title {
  display: block;
  width: 100%;
  margin-top: 0 !important;
  line-height: 1;
}

#screen-3 .screen3-card-visitors .screen3-card-title {
  text-align: center;
}

#screen-3 .screen3-card-icon-row {
  width: 100%;
  min-height: clamp(64px, 7.2vh, 96px);
  align-items: center;
  margin-top: auto !important;
}

#screen-3 .screen3-card-visitors .screen3-card-icon-row img {
  width: clamp(62px, 6.3vw, 92px);
}

.Employees-MD-NS-title {
  letter-spacing: 0.25px;
}

#screen-3 .screen3-card-subtitle {
  display: block;
  font-size: 14px !important;
  line-height: 1.05;
  margin-bottom: clamp(2px, 0.5vh, 6px);
}

@media (min-width: 992px) and (max-width: 1599.98px) {
  #screen-3 .screen3-card-subtitle {
    font-size: 16px !important;
  }
}

@media (min-width: 1600px) {
  #screen-3 .screen3-card-subtitle {
    font-size: 18px !important;
  }
}

#screen-2,
#screen-3,
#screen-4,
#screen-5,
#screen-6,
#screen-7,
#screen-8 {
  background-color: var(--logo-red-match);
}

#screen-3 .Employees-img {
  transform: rotate(180deg);
}

#screen-3 .screen3-employee-title {
  width: 100%;
  margin: 0 !important;
  padding-left: clamp(2px, 0.5vw, 10px);
}

#screen-3 .square-btn-screen3 .fw-bold.fs-6.fs-lg-5 {
  font-size: clamp(22px, 2.8vw, 40px) !important;
}

#screen-3 .screen3-employee-title .screen3-card-title {
  text-align: left;
}

#screen-3 .screen3-employee-icons {
  width: 100%;
  margin-top: auto !important;
  align-items: flex-end !important;
  justify-content: center !important;
  gap: clamp(8px, 1.1vw, 14px) !important;
}

#screen-3 .screen3-employee-building {
  width: clamp(58px, 6.6vw, 94px);
}

#screen-3 .screen3-employee-arrow {
  width: clamp(62px, 6.3vw, 92px);
}

.next-button-tight {
  color: #fff;
  border: 2px solid #fff;
  border-radius: 0;
  padding: 6px 14px;
  line-height: 1;
  font-size: clamp(14px, 1.7vw, 22px);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  text-transform: uppercase;
  background: transparent;
}

.form-container {
  width: 100%;
  margin: 2px 0 0;
}

#screen-4 h6,
#screen-6 h6,
#screen-7 h6 {
  font-size: clamp(28px, 3.2vw, 44px);
  color: var(--accent-yellow) !important;
  margin-bottom: 10px !important;
}

.label-box {
  background-color: rgba(0, 0, 0, 0.24);
  color: #fff;
  display: inline-block;
  padding: 8px 14px;
  font-size: clamp(12px, 1.3vw, 18px);
  font-weight: 500;
  border-radius: 2px;
}

.custom-input {
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--accent-yellow);
  color: #fff;
  padding: 6px 0;
  font-size: clamp(14px, 1.8vw, 22px);
  outline: none;
}

#screen-4 .custom-input,
#screen-6 .custom-input {
  font-size: clamp(15px, 2vw, 24px);
}

.custom-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
  font-size: clamp(12px, 1.4vw, 18px);
}

.custom-input:focus {
  border-bottom: 2px solid #fff;
}

#nameError,
#companyError,
#nameempError {
  font-size: clamp(11px, 1.1vw, 15px);
}

.main-content-area {
  width: min(100%, 820px);
  margin: 0 auto;
}

.thankyou-description {
  font-size: clamp(12px, 1.4vw, 18px);
  line-height: 1.35;
}

.user-item {
  cursor: pointer;
}

.user-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

#screen-7 .results-list {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#screen-7 .signout-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#screen-7 .label-box {
  align-self: flex-start;
  width: auto;
}

#screen-7 {
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#screen-7::-webkit-scrollbar {
  width: 0;
  height: 0;
}

#screen-7 .results-shell {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

#screen-7 .alphabet-scrollbar {
  width: clamp(18px, 2.1vw, 24px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  padding: 4px 0 6px;
  position: relative;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

#screen-7 .alphabet-track {
  height: 100%;
  display: grid;
  grid-template-rows: repeat(26, minmax(0, 1fr));
  position: relative;
  z-index: 2;
}

#screen-7 .alphabet-letter {
  font-size: clamp(8px, 0.8vw, 10px);
  line-height: 1;
  text-align: center;
  color: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#screen-7 .alphabet-letter.active {
  color: var(--accent-yellow);
  font-weight: 700;
}

#screen-7 .alphabet-letter.has-match {
  color: #fff;
}

#screen-7 .alphabet-letter.no-match {
  color: rgba(255, 255, 255, 0.28);
}

#screen-7 .alphabet-thumb {
  position: absolute;
  left: 3px;
  right: 3px;
  top: 0;
  height: clamp(24px, 3.2vh, 34px);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  z-index: 1;
  pointer-events: none;
}

#screen-7 .results-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

#screen-7 .results-list::-webkit-scrollbar-thumb {
  background: transparent;
}

#screen-7 .results-list::-webkit-scrollbar-track {
  background: transparent;
}

.time-info {
  font-size: clamp(12px, 1.6vw, 20px);
}

#screen-8 .time-title {
  font-weight: 700;
}

.signout-btn {
  background-color: #cf372c;
  color: #fff;
  border: 1px solid #fff;
  border-radius: 0;
  padding: 6px 12px;
  font-size: clamp(12px, 1.4vw, 18px);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.signout-btn:hover {
  background-color: transparent;
  color: #fff;
}

.timer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--timer-height);
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  text-align: center;
  background: var(--app-red-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer p,
.timer p.small {
  margin: 0;
  font-size: clamp(12px, 1.8vw, 22px) !important;
  line-height: 1;
}

.app-toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--timer-height) + 10px);
  transform: translate(-50%, 12px);
  max-width: min(88vw, 520px);
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.38);
  color: #fff;
  font-size: clamp(11px, 1.2vw, 15px);
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 40;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.app-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

@media (max-width: 767.98px) {
  :root {
    --timer-height: 36px;
    --brand-logo-h-mobile: clamp(72px, 14vh, 102px);
  }

  .kiosk-page {
    padding: 0;
  }

  .phone-mockup {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .screen {
    padding: clamp(8px, 2.4vh, 12px) clamp(14px, 5vw, 20px);
  }

  #screen-2 .img-fluid,
  #screen-3 .img-fluid,
  #screen-4 .img-fluid,
  #screen-5 .img-fluid,
  #screen-6 .img-fluid,
  #screen-7 .img-fluid,
  #screen-8 .img-fluid {
    height: var(--brand-logo-h-mobile) !important;
  }

  .choice-grid {
    flex-direction: column !important;
    gap: clamp(8px, 2vh, 12px) !important;
    align-items: center !important;
  }

  .square-btn,
  .square-btn-screen3 {
    width: min(84vw, 280px);
    min-height: clamp(120px, 28vh, 182px);
    padding: 10px 10px 8px;
  }

  #screen-3 .screen3-card {
    height: clamp(120px, 28vh, 182px);
    min-height: clamp(120px, 28vh, 182px);
  }

  #screen-3 .screen3-card-subtitle {
    font-size: clamp(11px, 3.2vw, 14px) !important;
  }

  #screen-3 .screen3-employee-building {
    width: clamp(56px, 14vw, 84px);
  }

  #screen-3 .screen3-card-visitors .screen3-card-icon-row img,
  #screen-3 .screen3-employee-arrow {
    width: clamp(54px, 13vw, 80px);
  }

  #screen-2 .square-btn span,
  #screen-3 .square-btn-screen3 .screen3-card-title {
    font-size: clamp(22px, 7vw, 34px) !important;
  }

  #screen-3 .square-btn-screen3 .fw-bold.fs-6.fs-lg-5 {
    font-size: clamp(20px, 6vw, 32px) !important;
  }

  #screen-4 h6,
  #screen-6 h6,
  #screen-7 h6 {
    font-size: clamp(24px, 7vw, 34px);
    margin-bottom: clamp(8px, 1.8vh, 10px) !important;
  }

  .label-box {
    padding: 7px 10px;
    font-size: clamp(12px, 3.6vw, 15px);
  }

  .custom-input,
  #screen-4 .custom-input,
  #screen-6 .custom-input {
    font-size: clamp(14px, 4vw, 18px);
  }

  .custom-input::placeholder {
    font-size: clamp(12px, 3.5vw, 15px);
  }

  #screen-7 .results-list {
    min-height: 0;
    max-height: none;
  }
}

@media (max-width: 767.98px) and (orientation: landscape) {
  :root {
    --timer-height: 32px;
    --brand-logo-h-mobile: var(--brand-logo-h-mobile-small);
  }

  #screen-1 {
    gap: clamp(8px, 1.8vh, 14px);
  }

  #screen-1 .small {
    font-size: clamp(10px, 2.2vw, 12px) !important;
  }

  #screen-1 h2 {
    font-size: clamp(24px, 5vw, 32px) !important;
    margin-bottom: 6px;
  }

  #screen-1 img.w-75 {
    width: min(24vw, 170px) !important;
  }

  #screen-1 .mb-5.text-center {
    margin-top: 0 !important;
  }

  #screen-1 .btn-light {
    font-size: clamp(26px, 5.2vw, 34px);
  }

  #screen-2 .mt-2.mb-4,
  #screen-3 .mt-2.mb-4,
  #screen-4 .mt-2.mb-4,
  #screen-5 .mt-2.mb-4,
  #screen-6 .mt-2.mb-4,
  #screen-7 .mt-2.mb-4,
  #screen-8 .mt-2.mb-4 {
    margin-top: 4px !important;
    margin-bottom: clamp(10px, 2.2vh, 16px) !important;
  }

  .choice-grid {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: clamp(8px, 2.4vw, 14px) !important;
    align-items: stretch !important;
  }

  .square-btn,
  .square-btn-screen3 {
    width: min(40vw, 250px);
    min-height: clamp(108px, 45vh, 158px);
    padding: 8px 8px 6px;
  }

  #screen-3 .screen3-card {
    height: clamp(108px, 45vh, 158px);
    min-height: clamp(108px, 45vh, 158px);
    padding: 8px 8px 6px;
  }

  #screen-3 .screen3-card-subtitle {
    font-size: clamp(10px, 2.3vw, 13px) !important;
    margin-bottom: 2px;
  }

  #screen-3 .screen3-employee-building {
    width: clamp(52px, 11vw, 76px);
  }

  #screen-3 .screen3-card-visitors .screen3-card-icon-row img,
  #screen-3 .screen3-employee-arrow {
    width: clamp(48px, 10vw, 70px);
  }

  #screen-2 .square-btn span,
  #screen-3 .square-btn-screen3 .screen3-card-title {
    font-size: clamp(18px, 4vw, 28px) !important;
  }

  #screen-3 .square-btn-screen3 .fw-bold.fs-6.fs-lg-5 {
    font-size: clamp(17px, 3.6vw, 26px) !important;
  }

  #screen-4 h6,
  #screen-6 h6,
  #screen-7 h6 {
    margin-bottom: clamp(6px, 1.4vh, 8px) !important;
  }

  .input-wrapper.mb-2,
  .input-wrapper.mb-4 {
    margin-bottom: clamp(6px, 1.5vh, 10px) !important;
  }

  .custom-input {
    padding: 4px 0;
  }

  #screen-7 .results-list {
    min-height: 0;
    max-height: none;
  }
}

@media (min-width: 1600px) {
  #screen-1 .small {
    font-size: clamp(14px, 0.9vw, 20px) !important;
  }

  #screen-1 h2 {
    font-size: clamp(44px, 3vw, 74px) !important;
    margin-bottom: 14px;
  }

  #screen-1 img.w-75 {
    width: min(30vw, 460px) !important;
  }

  #screen-1 .btn-light {
    font-size: clamp(42px, 3.2vw, 76px);
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  #screen-7 .mt-2.mb-4 {
    margin-top: 2px !important;
    margin-bottom: 6px !important;
  }

  #screen-7 .img-fluid {
    height: clamp(44px, 13vh, 64px) !important;
  }

  #screen-7 h6 {
    font-size: clamp(22px, 5vh, 30px);
    margin-bottom: 4px !important;
  }

  #screen-7 .label-box {
    padding: 5px 8px;
    font-size: clamp(10px, 2.3vh, 12px);
  }

  #screen-7 .custom-input {
    font-size: clamp(13px, 2.9vh, 16px);
    padding: 2px 0;
    margin-bottom: 6px !important;
  }

  #screen-7 .results-shell {
    min-height: clamp(120px, 42vh, 240px);
    gap: 6px;
  }

  #screen-7 .alphabet-scrollbar {
    width: clamp(16px, 2.6vh, 20px);
  }

  #screen-7 .alphabet-letter {
    font-size: clamp(8px, 1.9vh, 10px);
  }
}
