:root {
  --brand: #0f766e;
  --brand-strong: #0f4f5d;
  --accent: #f59e0b;
  --ink: #12243a;
  --muted: #64748b;
  --border: #d7e2ea;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --danger-bg: #fff1f2;
  --danger-text: #9f1239;
  --success-bg: #ecfdf5;
  --success-text: #047857;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-height: var(--scaled-vh, 100vh);
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .12) 0 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(120deg, #0d2438 0 42%, #f7fafc 42.2% 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(128deg, rgba(94, 234, 212, .16), transparent 28%),
    linear-gradient(22deg, transparent 62%, rgba(245, 158, 11, .16));
  animation: access-shift 12s ease-in-out infinite alternate;
}

@keyframes access-shift {
  from { opacity: .72; transform: translateY(0); }
  to { opacity: 1; transform: translateY(-12px); }
}

button,
input {
  font: inherit;
}

.access-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, .72fr) minmax(360px, 1fr);
  gap: clamp(24px, 5vw, 58px);
  width: min(1120px, calc(100% - 36px));
  min-height: var(--scaled-vh, 100vh);
  margin: 0 auto;
  padding: clamp(28px, 7vh, 80px) 0;
  align-items: center;
}

.access-brand {
  color: #fff;
}

.access-brand img {
  display: block;
  width: min(260px, 84%);
  height: auto;
  filter: drop-shadow(0 18px 32px rgba(2, 6, 23, .24));
}

.access-brand > span {
  display: inline-flex;
  margin-top: 24px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  padding: 7px 10px;
  color: #b7f3ed;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
}

.access-brand h1 {
  margin: 28px 0 10px;
  max-width: 380px;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

.access-brand p {
  max-width: 370px;
  margin: 0;
  color: #cbd5e1;
  font-size: 15px;
  line-height: 1.65;
}

.access-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, .9);
  border-radius: 8px;
  background: rgba(255,255,255,.96);
  padding: clamp(18px, 3vw, 24px);
  box-shadow: 0 28px 70px rgba(15, 23, 42, .22);
}

.access-card-accent {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), #0ea5e9, var(--accent));
}

.access-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.access-choice {
  position: relative;
  display: grid;
  min-height: 184px;
  align-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 18px;
  cursor: pointer;
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.access-choice:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 118, 110, .45);
  box-shadow: 0 16px 32px rgba(15, 23, 42, .08);
}

.access-choice.active {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand), 0 18px 38px rgba(15, 118, 110, .16);
}

.choice-check {
  position: absolute;
  top: 12px;
  right: 12px;
  display: none;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--brand, #0f766e);
  color: #fff;
}

.choice-check svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.access-choice.active .choice-check { display: grid; }

.choice-icon,
.panel-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: #e6fffb;
  color: var(--brand);
}

.choice-icon svg,
.panel-icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.access-choice strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
}

.access-choice small {
  display: block;
  max-width: 210px;
  color: var(--muted);
  line-height: 1.45;
}

.choice-action {
  display: inline-flex;
  width: fit-content;
  border-radius: 7px;
  background: #10243a;
  color: #fff;
  padding: 9px 13px;
  font-weight: 800;
}

.access-panel {
  scroll-margin-top: 14px;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: clamp(22px, 4vw, 32px);
  background: var(--surface-soft);
  text-align: center;
  opacity: 0;
  transform: translateY(-8px) scale(.985);
  transform-origin: top center;
  transition:
    opacity .18s ease,
    transform .18s ease,
    max-height .22s ease,
    margin-top .18s ease,
    padding-top .18s ease,
    padding-bottom .18s ease;
  max-height: 0;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

.access-panel.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  max-height: 680px;
  margin-top: 14px;
  padding-top: clamp(22px, 4vw, 32px);
  padding-bottom: clamp(22px, 4vw, 32px);
  pointer-events: auto;
}

.panel-icon {
  margin: 0 auto 12px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .04);
}

.access-panel h2 {
  margin: 0 0 7px;
  font-size: 21px;
}

.access-panel > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

#workerLookupForm,
#workerCredentialForm,
#loginForm {
  display: grid;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
}

.phone-field {
  display: grid;
  grid-template-columns: auto 1fr;
  min-height: 48px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.country-code {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-right: 1px solid #e2e8f0;
  color: #0f4f5d;
  font-size: 13px;
  font-weight: 800;
}

.phone-field input,
.access-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  padding: 10px 12px;
}

.phone-field input {
  border: 0;
  border-radius: 0;
}

.access-field {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.access-primary {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #0ea5e9);
  color: #fff;
  cursor: pointer;
  font-weight: 850;
  transition: transform .18s ease, box-shadow .18s ease;
}

.access-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(15, 118, 110, .18);
}

.access-primary:disabled {
  opacity: .6;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.credential-type {
  display: flex;
  justify-content: center;
  gap: 18px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.credential-type label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.credential-type input { accent-color: var(--brand); }

.text-action {
  border: 0;
  background: none;
  color: var(--brand-strong);
  cursor: pointer;
  font-weight: 800;
}

.privacy-copy {
  margin: 16px 0 0 !important;
  color: var(--muted) !important;
  font-size: 11px !important;
}

.access-message {
  display: none;
  max-width: 480px;
  margin: 13px auto 0;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 12px;
  text-align: left;
}

.access-message.show { display: block; }
.access-message.error { border: 1px solid #fecdd3; background: var(--danger-bg); color: var(--danger-text); }
.access-message.success { border: 1px solid #a7f3d0; background: var(--success-bg); color: var(--success-text); }

input:focus,
button:focus-visible {
  outline: 3px solid rgba(14, 165, 233, .24);
  outline-offset: 2px;
}

@media (max-width: 820px) {
  body {
    background:
      linear-gradient(135deg, rgba(15, 118, 110, .12) 0 1px, transparent 1px) 0 0 / 30px 30px,
      linear-gradient(180deg, #0d2438 0 40%, #f7fafc 40.2% 100%);
  }

  .access-shell {
    grid-template-columns: 1fr;
    gap: 22px;
    width: min(680px, calc(100% - 24px));
    padding: 28px 0 34px;
  }

  .access-brand {
    text-align: center;
  }

  .access-brand img,
  .access-brand p {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 560px) {
  .access-choice-grid {
    grid-template-columns: 1fr;
  }

  .access-choice {
    min-height: 150px;
  }

  .access-card {
    padding: 12px;
  }

  .access-panel {
    padding: 20px 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
