:root {
  --teal: #0a6e74;
  --teal-dark: #08565b;
  --red: #b91c1c;
  --red-btn: #9b1c1c;
  --ink: #1a2332;
  --muted: #5a6a7a;
  --line: #c5d0db;
  --card: #ffffff;
  --tab-inactive: #d9e6ef;
  --ok: #22d3ee;
  --font: "Montserrat", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body.reg-body-page {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: #f4f9fc;
  position: relative;
  overflow-x: hidden;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #fff url("../bg.png") center bottom / cover no-repeat;
  pointer-events: none;
}

.reg-layout {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  padding: 0;
  display: flex;
  align-items: stretch;
}

.split-66 {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  min-height: 100vh;
}

.col-left {
  flex: 0 0 50%;
  width: 50%;
  max-width: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* justify-content: center; */
  text-align: center;
  /* padding: 0.5rem; */
  min-height: 0;
}

.col-right {
  flex: 0 0 50%;
  width: 50%;
  max-width: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* justify-content: center; */
  padding: 0.5rem 1rem;
  min-height: 0;
}

.brand-main {
  width: 100%;
  max-width: 100%;
  max-height: min(62vh, 520px);
  height: auto;
  display: block;
  margin: 0 auto 0.6rem;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(10, 40, 70, 0.08));
}

.btn-guidelines {
  display: inline-block;
  background: var(--red-btn);
  color: #fff !important;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1.15rem;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 18px rgba(155, 28, 28, 0.28);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-guidelines:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  color: #fff;
}

/* Form card */
.form-card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(20, 50, 80, 0.14);
  overflow: hidden;
  width: 100%;
  max-width: 420px;
}

.form-card-header {
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.55rem 0.85rem;
  text-align: center;
}

.form-tab-content {
  padding: 0.7rem 0.95rem 0.8rem;
}

/* Compact floating inputs */
.field-box {
  position: relative;
  margin-bottom: 0.45rem;
}

.field-box input,
.field-box select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 1rem 0.75rem 0.3rem;
  font-size: 0.84rem;
  color: var(--ink);
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.field-box select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235a6a7a' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  padding-right: 1.8rem;
}

.field-box label {
  position: absolute;
  left: 0.75rem;
  top: 21px; /* center of 42px input */
  transform: translateY(-50%);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  pointer-events: none;
  transition: 0.15s ease;
  background: transparent;
  margin: 0;
  line-height: 1;
  z-index: 1;
}

.field-box label span {
  color: var(--red);
  margin-left: 2px;
}

.field-box input:focus,
.field-box select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(10, 110, 116, 0.12);
}

.field-box input:focus + label,
.field-box input:not(:placeholder-shown) + label,
.field-box select:focus + label,
.field-box select:valid + label,
.field-box-select.is-filled label {
  top: 6px;
  transform: none;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--teal);
}

.field-box input.is-invalid,
.field-box select.is-invalid {
  border-color: var(--red);
}

.field-box input[readonly] {
  background: #f0f7f8;
  color: var(--teal-dark);
  font-weight: 600;
  cursor: default;
}

.field-box-dob .dob-icon {
  position: absolute;
  right: 0.7rem;
  top: 21px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  display: flex;
}

.field-box-dob input {
  padding-right: 2.2rem;
}

.field-hint {
  font-size: 0.6rem;
  color: var(--muted);
  margin-top: 0.15rem;
  line-height: 1.25;
  padding-left: 0.15rem;
}

.field-error {
  min-height: 0.7rem;
  font-size: 0.6rem;
  color: var(--red);
  margin-top: 0.1rem;
  line-height: 1.15;
  padding-left: 0.15rem;
}

.consent-row {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  margin-top: 0.2rem;
  font-size: 0.65rem;
  line-height: 1.35;
  color: var(--ink);
}

.consent-row input {
  margin-top: 0.15rem;
  accent-color: var(--teal);
  flex-shrink: 0;
}

.consent-row a {
  color: var(--teal);
  text-decoration: underline;
  font-weight: 600;
}

.btn-submit {
  background: var(--teal);
  color: #fff !important;
  border: none;
  border-radius: 6px;
  min-width: 110px;
  padding: 0.4rem 1.35rem;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  transition: filter 0.15s, transform 0.15s;
  margin-top: 0.15rem;
}

.btn-submit:hover {
  /* filter: brightness(1.08); */
  background: var(--teal-dark);
  transform: translateY(-1px);
  color: #fff;
}

.login-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.powered-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0.4rem;
  width: 100%;
}

.powered-img {
  max-width: 150px;
  width: 70%;
  height: auto;
  display: block;
}

/* Guidelines modal */
.guidelines-modal {
  border: none;
  border-radius: 12px;
  overflow: hidden;
}

.guidelines-header {
  background: #e11d2e;
  color: #fff;
  border: none;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.guidelines-header .modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.btn-close-circle {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  line-height: 0;
  box-shadow: none;
  opacity: 1;
}

.btn-close-circle:hover,
.btn-close-circle:focus {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  outline: none;
  box-shadow: none;
}

.btn-close-circle svg {
  width: 12px;
  height: 12px;
  display: block;
  pointer-events: none;
}

.eligibility-box {
  background: #fde8ea;
  border-left: 5px solid #c41e2a;
  color: #b91c1c;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.85rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.guidelines-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.guidelines-list li {
  position: relative;
  padding-left: 1.15rem;
  margin-bottom: 0.7rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #222;
}

.guidelines-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e11d2e;
}

.guidelines-footer {
  border: none;
  padding: 0.5rem 1.15rem 1rem;
}

.btn-ok {
  background: #22d3ee;
  color: #111 !important;
  border: none;
  border-radius: 6px;
  min-width: 88px;
  font-weight: 800;
  padding: 0.45rem 1.2rem;
}

.btn-ok:hover {
  background: #67e8f9;
  color: #111;
}

/* Flatpickr tweaks */
.flatpickr-calendar {
  font-family: var(--font);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
}

/* ---------- Viewer ---------- */
.viewer-page {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: #000;
  position: relative;
  margin: 0;
  font-family: var(--font);
}

.viewer-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  pointer-events: none;
  background: transparent;
}

.viewer-user {
  pointer-events: none;
  color: #102033;
  font-size: 0.8rem;
  font-weight: 700;
  max-width: min(70vw, 420px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(16, 32, 51, 0.12);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  box-shadow: 0 6px 18px rgba(16, 32, 51, 0.14);
}

.btn-logout {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(16, 32, 51, 0.12);
  border-radius: 50%;
  background: #ffffff;
  color: #102033;
  box-shadow: 0 6px 18px rgba(16, 32, 51, 0.16);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
  text-decoration: none;
}

.btn-logout:hover {
  background: #0a6e74;
  border-color: #0a6e74;
  color: #fff;
  transform: scale(1.05);
}

.btn-logout svg {
  width: 20px;
  height: 20px;
}

.viewer-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #0b1220;
  z-index: 1;
}

.viewer-iframe[hidden] {
  display: none !important;
}

.viewer-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  text-align: center;
  color: #fff;
  background: #0b1220;
  z-index: 2;
}

.viewer-empty[hidden] {
  display: none !important;
}

.viewer-empty h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.viewer-empty p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1.25rem;
}

.viewer-empty a {
  color: #fff;
  background: var(--teal);
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 991.98px) {
  .reg-layout {
    padding: 0;
    align-items: flex-start;
  }

  .split-66 {
    flex-direction: column;
    gap: 0;
    min-height: auto;
  }

  .col-left,
  .col-right {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    padding: 1rem;
  }

  .col-left {
    order: -1;
  }

  .brand-main {
    max-width: 100%;
    max-height: none;
  }

  .form-card {
    max-width: 420px;
    margin-inline: auto;
  }

  .col-right {
    align-items: center;
  }
}

@media (max-width: 575.98px) {
  .form-tab-content {
    padding: 0.85rem;
  }

  .btn-guidelines {
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
  }

  .form-card {
    max-width: 100%;
  }
}

/* Short laptop screens */
@media (min-width: 992px) and (max-height: 820px) {
  .brand-main {
    max-height: 52vh;
  }

  .form-card-header {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  .form-tab-content {
    padding: 0.45rem 0.75rem 0.55rem;
  }

  .underline-field input,
  .underline-field select {
    padding: 0.12rem 0.1rem;
    font-size: 0.78rem;
  }

  .field-error {
    min-height: 0.55rem;
  }

  .powered-img {
    max-width: 130px;
  }

  .btn-guidelines {
    padding: 0.4rem 0.9rem;
    font-size: 0.75rem;
  }
}
