/*! HTML5 Boilerplate v9.0.1 | MIT License | https://html5boilerplate.com/ */

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
  color: #222;
  font-size: 1em;
  line-height: 1.4;
  height: 100%;
  overflow: hidden;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: #f8fafc;
  background: radial-gradient(circle at 12% 10%, #2f0a66 0, #13002d 38%, #080a1f 100%);
  min-height: 100vh;
  height: 100%;
  overflow: hidden;
}

.landing-logo {
  max-width: 260px;
  max-height: 90px;
  object-fit: contain;
  margin-bottom: 1.5rem;
}

.tablet-shell {
  position: relative;
  box-sizing: border-box;
  min-height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding: clamp(1rem, 2.8vh, 2.5rem) clamp(1rem, 4vw, 3.5rem);
  display: flex;
  flex-direction: column;
}

.screen {
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}

.welcome-screen {
  padding-top: clamp(0.6rem, 1.2vh, 2rem);
  color: #f8fafc;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.welcome-screen h1 {
  font-size: clamp(3.6rem, 8vw, 6.8rem);
  margin: 0;
  font-weight: 700;
  text-shadow: 0 2px 18px rgba(8, 10, 31, 0.35);
}

.welcome-screen p {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  margin: 0.2rem 0 2rem;
  color: #eef2ff;
}

.welcome-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  justify-content: center;
  width: 100%;
  max-width: 760px;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 0.9rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  font-size: 1.1rem;
}

.accent-btn {
  background: #7a00df;
  color: #fff;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.tap-pill {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 30px rgba(8, 10, 31, 0.4);
  padding: 1rem 2.2rem;
  font-size: 1.55rem;
}

.admin-link {
  display: block;
  margin-top: 1rem;
  background: transparent;
  color: #334155;
  text-decoration: underline;
  padding-left: 0;
}

.form-screen {
  background: #ffffff;
  color: #0f172a;
  border-radius: 24px;
  padding: clamp(1rem, 2vh, 1.6rem) clamp(1rem, 2vw, 2rem);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
  max-height: 100%;
  overflow: hidden;
}

.form-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.icon-btn {
  background: transparent;
  color: #0f172a;
  font-size: 2.1rem;
  line-height: 1;
  padding: 0.2rem;
}

.form-screen h2,
.form-screen h3 {
  margin: 0.8rem 0 0.5rem;
  font-size: 2rem;
  font-weight: 700;
  color: #0b1220;
  letter-spacing: 0.01em;
}

input {
  width: 100%;
  color: #0f172a;
  font-size: 1.7rem;
  padding: 0.8rem 0;
  border: 0;
  border-bottom: 3px solid #85cf56;
  border-radius: 0;
  background: transparent;
}

.company-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.company-option-btn {
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.75rem 0.85rem;
  text-align: center;
}

.company-option-btn.selected {
  border-color: #7a00df;
  background: rgba(122, 0, 223, 0.08);
  color: #4a0088;
}

.company-option-btn:focus-visible {
  outline: 3px solid rgba(122, 0, 223, 0.25);
  outline-offset: 1px;
}

input:focus {
  outline: none;
  border-bottom-color: #62a937;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.9rem;
  margin-bottom: 0.5rem;
}

.checkbox-row input {
  width: auto;
}

.continue-btn {
  margin-top: 1rem;
}

.alerts {
  min-height: 1.4rem;
  color: #2563eb;
  font-weight: 600;
  text-align: center;
  margin: 0.9rem 0;
}

.action-confirmation {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.5);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
}

.action-confirmation.is-visible {
  opacity: 1;
  animation: confirmation-fade 2s ease;
}

.action-confirmation.is-open {
  opacity: 1;
  pointer-events: auto;
}

.dialog-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.4rem;
}

.dialog-actions button {
  min-width: 140px;
}

.occupancy {
  width: 100%;
  max-width: 420px;
  margin: 1.6rem auto 0;
  padding: 1.4rem 1.6rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(8, 10, 31, 0.35);
  text-align: center;
  color: #f8fafc;
}

.occupancy__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
}

.occupancy__total {
  margin: 0.35rem 0 0;
  font-size: 1.25rem;
  color: #eef2ff;
}

.occupancy__total span {
  font-weight: 800;
  font-size: 1em;
  color: #ffffff;
}

.occupancy__breakdown {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
}

.occupancy__breakdown li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 1.15rem;
  color: #eef2ff;
}

.occupancy__breakdown li span:last-child {
  font-weight: 700;
  color: #ffffff;
}

.action-confirmation__card {
  min-width: min(88vw, 520px);
  text-align: center;
  background: #ffffff;
  color: #0f172a;
  border-radius: 24px;
  padding: 2rem 1.6rem;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.35);
  transform: scale(0.95);
  animation: confirmation-pop 320ms ease forwards;
}

.action-confirmation .ghost-btn {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

.action-confirmation__icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 0.9rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: #e2f7db;
}

.action-confirmation--error .action-confirmation__icon {
  background: #fde2e2;
}

.action-confirmation--error .action-confirmation__title {
  color: #dc2626;
}

.action-confirmation__title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.7rem);
}

.action-confirmation__message {
  margin: 0.5rem 0 0;
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  color: #334155;
}

.search-results {
  list-style: none;
  margin: 0.5rem 0 1rem;
  padding: 0;
  max-height: min(28vh, 240px);
  overflow: auto;
  background: #f8fafc;
  border-radius: 14px;
}

.search-results li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid #e2e8f0;
}

.search-results li.selected {
  background: #e2f2d9;
}

.search-results li button {
  padding: 0.35rem 0.7rem;
  background: #1d4ed8;
  color: #fff;
}

.admin-group-item {
  display: block !important;
  padding: 0.9rem 1rem;
}

.admin-group-title {
  margin: 0;
  font-size: 1.2rem;
  color: #0f172a;
}

.admin-group-visitors {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  border-top: 1px solid #e2e8f0;
}

.admin-group-visitors li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 1rem;
}

.admin-group-visitors li:last-child {
  border-bottom: 0;
}

.admin-group-visitor-details {
  display: flex;
  flex: 1;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-signout-btn {
  margin-left: 0.75rem;
  padding: 0.4rem 0.8rem;
  background: #dc2626;
  color: #fff;
  font-size: 0.9rem;
  white-space: nowrap;
}

.admin-history-results {
  max-height: min(30vh, 250px);
}

.admin-history-item {
  align-items: flex-start !important;
}

.admin-history-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.92rem;
  color: #334155;
}

@keyframes confirmation-pop {
  from {
    transform: scale(0.9);
  }

  to {
    transform: scale(1);
  }
}

@keyframes confirmation-fade {
  0% {
    opacity: 0;
  }

  12% {
    opacity: 1;
  }

  85% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .tablet-shell {
    padding: 1rem;
  }

  .tap-pill {
    font-size: 1.2rem;
  }

  .welcome-actions {
    flex-direction: column;
  }

  .welcome-actions button {
    width: 100%;
  }

  .form-screen h2,
  .form-screen h3 {
    font-size: 1.5rem;
  }

  input {
    font-size: 1.3rem;
  }

  .company-options {
    grid-template-columns: 1fr;
  }

  .search-results {
    max-height: min(30vh, 210px);
  }
}

@media (max-height: 760px) {
  .landing-logo {
    max-width: 210px;
    max-height: 70px;
    margin-bottom: 0.8rem;
  }

  .welcome-screen h1 {
    font-size: clamp(2.8rem, 7vw, 4.6rem);
  }

  .welcome-screen p {
    font-size: clamp(1.6rem, 3.8vw, 2.3rem);
    margin: 0.15rem 0 1.1rem;
  }

  .welcome-actions {
    margin-bottom: 1rem;
  }

  .tap-pill {
    padding: 0.75rem 1.6rem;
    font-size: 1.15rem;
  }
}

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

.hidden,
[hidden] {
  display: none !important;
}

/*
 * Hide only visually, but have it available for screen readers:
 * https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 *
 * 1. For long content, line feeds are not interpreted as spaces and small width
 *    causes content to wrap 1 word per line:
 *    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
 */

.visually-hidden {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
  /* 1 */
}

/*
 * Extends the .visually-hidden class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
  visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * The use of `table` rather than `block` is only necessary if using
 * `::before` to contain the top-margins of child elements.
 */

.clearfix::before,
.clearfix::after {
  content: "";
  display: table;
}

.clearfix::after {
  clear: both;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
  /* Style adjustments for viewports that meet the condition */
}

@media print,
  (-webkit-min-device-pixel-ratio: 1.25),
  (min-resolution: 1.25dppx),
  (min-resolution: 120dpi) {
  /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   https://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    /* Black prints faster */
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  /*
   * Don't show links that are fragment identifiers,
   * or use the `javascript:` pseudo protocol
   */
  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}

