@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300..700;1,300..700&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

:root {
  --Poppins: "Poppins", sans-serif;
  --Cormorant: "Cormorant Garamond", serif;

  --fontsize-header: 40px;
  --fontsize-subheader: 24px;

  --fontsize-20: 20px;
  --fontsize-18: 18px;
  --fontsize-16: 16px;
  --fontsize-14: 14px;

  --boxshadow: 2px 4px 12px #00000014;

  --primary: #1a73e7;
  --secondary: #cde0f9;
  --selection: var(--secondary);
  --light: #fff;
  --dark: #444746;
  --background: #fff;

  --animation-default-fast: 0.4s cubic-bezier(0.625, 0.05, 0, 1);
  --animation-default: 0.8s cubic-bezier(0.625, 0.05, 0, 1);
  --animation-bounce-fast: 0.6s cubic-bezier(0.35, 1.75, 0.6, 1);
  --animation-bounce: 0.8s cubic-bezier(0.35, 1.75, 0.6, 1);
  --animation-ease: 0.2s ease;
  --animation-expo: 0.8s cubic-bezier(0.87, 0, 0.13, 1);
  --animation-expo-fast: 0.4s cubic-bezier(0.87, 0, 0.13, 1);
  --apple-animation: 0.3s cubic-bezier(0, 0, 0.5, 1);
}

::selection {
  background-color: var(--selection);
  color: var(--primary);
  text-shadow: none;
}

&::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  cursor: var(--pointer);
  position: relative;
  width: 100dvw;
  height: auto;
  background-color: var(--background);
  margin: 0px;
  font-family: var(--Poppins);
  color: var(--dark);
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  transition: all var(--animation-default-fast);
}

main {
  position: relative;
  width: 100%;
}

a {
  color: var(--dark);
  display: block;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

ul,
li {
  list-style: none;
  text-decoration: none;
  padding: 0px;
  margin: 0;
}

h1,
h2,
h3,
p {
  padding: 0px;
  margin: 0px;
}

img {
  user-select: none;
}

button {
  all: unset;
}

input {
  background-color: var(--background);
  padding: 0 30px;
  user-select: none;
  cursor: pointer;
  border-radius: 7px;
  height: 50px;
  font-size: var(--fontsize-input);
  font-weight: 600;
  color: var(--dark);
  text-align: left;
  transition: all var(--animation-default-fast);
}

input {
  border: 1px solid #d1d1d6;
  border-radius: 10px;
  transition: all 0.3s ease;
  outline: none;
}

input:focus {
  border-color: var(--primary);
  /* box-shadow: 0 0 0 4px rgb(255, 188, 13, 0.1); */
}

input:not(:placeholder-shown):valid {
  border-color: #004aad;
}

input:not(:placeholder-shown):invalid {
  border-color: #ff3b30;
}

label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.filled {
  font-variation-settings:
    "FILL" 1,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24 !important;
}

summary {
  display: flex;
  cursor: pointer;
}

summary::-webkit-details-marker {
  display: none;
}

.button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;

  position: relative;
  width: fit-content;
  padding: 10px 15px;
  background-color: transparent;
  text-transform: uppercase;
  border-radius: 5px;
  border: 2px solid white;

  font-size: 16px;
  font-weight: 500;
  color: white;
  transition: var(--apple-animation);
}

.button::before {
  content: "";
  -webkit-backdrop-filter: blur(9.8px);
  backdrop-filter: blur(9.8px);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #191919ba url(../../assets/texture/grainy.png) 0 0 / 200px 200px;
  background-blend-mode: overlay;
  /* opacity: 0.2;  */
  z-index: -1;
}

.button span {
  font-size: 20px !important;
}

.button:hover {
  background-color: white;
  color: var(--dark);
  box-shadow: var(--boxshadow);
  transition: var(--apple-animation);
}

.navBar-wrapper {
  width: 100vw;
  background-color: white;
}

.navBar {
  padding: 25px 0;
  width: 90%;
  height: 50px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#icon-mobile {
  display: none;
}

.nav-logo {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-logo img {
  height: 100%;
  width: auto;
}

.nav-logo h1 {
  position: relative;
  color: black;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -5%;
}

.nav-logo h1::after {
  content: "MY";
  font-size: 60%;
  font-weight: 400;

  padding-left: 3px;
  position: absolute;
  top: 0;
  right: 0;
  transform: translateX(100%);
}

.nav-menu {
  border: 2px solid lightgray;
  border-radius: 5px;

  width: fit-content;
  height: fit-content;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}

.nav-menu ul {
  height: fit-content;
  display: flex;
  flex-direction: row;
  align-items: center;
}

.nav-menu ul a {
  padding: 7px 20px;
  font-size: 16px;
  font-weight: 600;
  color: black;
  text-transform: uppercase;
  transition: var(--apple-animation);
}

.nav-button {
  border-left: 2px solid lightgray;
  padding: 7px;
  height: max-content;
  aspect-ratio: 1/1;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--apple-animation);
}

.nav-menu ul a:hover,
.nav-button:hover {
  background-color: lightgray;
  transition: var(--apple-animation);
}

.menu-wrapper {
  transform: translateX(100%);
  top: 0;
  right: 0;
  z-index: 9999;
  box-sizing: border-box;
  position: fixed;
  background-color: white;
  min-height: 100dvh;
  width: 100%;
  max-width: 360px;
  padding: 24px 50px;
  transition: var(--animation-default);
}

.menu-active {
  transform: translateX(0%);
  transition: var(--animation-default);
}

.menu-icon {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
  padding-left: 10px;
  cursor: default;
}

.menu-icon span {
  cursor: pointer;
  width: fit-content;
  font-size: 30px !important;
}

.menu ul {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.menu ul a {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  color: black;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -3%;
  line-height: 1;
}

.menu ul a span {
  padding-left: 10px;
  font-size: 30px !important;
  height: 100%;
  aspect-ratio: 1/1;
  border-left: 2px solid lightgray;
  transition: var(--apple-animation);
}

.menu ul a:hover span {
  transform: translateX(10%);
  transition: var(--apple-animation);
}

.footer-wrapper {
  box-sizing: border-box;
  padding: 30px 0 100px;
  width: 100vw;
}

.footer {
  width: 80%;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: start;
  flex-wrap: wrap;
  gap: 50px;
}

.footer span {
  width: 50%;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.footer div {
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 10px;
}

.footer span img {
  padding-bottom: 15px;
  object-position: left center;
  width: 300px;
  height: 50px;
  object-fit: contain;
}

.footer h1 {
  font-family: var(--Cormorant);
  font-size: var(--fontsize-header);
  font-weight: 700;
  letter-spacing: -4%;
  line-height: 0.8;
}

.footer-logo {
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 10px;
}

.footer-logo img {
  height: 45px;
}

.footer-social {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.footer-social a i {
  font-size: 24px;
  color: var(--dark) !important;
  transition: var(--apple-animation);
}

.footer-social a:hover i {
  color: black;
  transform: rotate(5deg) scale(1.05);
  transition: var(--apple-animation);
}

.overlay {
  visibility: hidden;
  background-color: black;
  z-index: 9997;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  opacity: 0.6;
}

.topBar-wrapper {
  box-sizing: border-box;
  margin: 30px auto 0;
  width: 90%;
  max-width: 500px;

  display: flex;
  align-items: center;
  gap: 5px;
}

.topBar-wrapper a {
  display: flex;
  justify-content: center;
  align-items: center;
}

.topBar-wrapper span {
  font-size: 30px;
  color: #000;
}

.topBar-wrapper h1 {
  font-size: var(--fontsize-20);
  color: #000;
}



#error {
  box-sizing: border-box;
  padding: 30px 50px;
  position: relative;
  overflow: hidden;
  width: 100vw;
  background: #004aad;
  color: white;
  min-height: 80svh;
  max-height: 100dvh;

  display: flex;
  flex-direction: column;
  justify-content: center;
}

#error img {
  position: absolute;
  top: 0;
  right: 0;
  width: 75%;
  height: 100%;
  object-position: left 35%;
  object-fit: cover;
  -webkit-mask-image: radial-gradient(circle at 85% 50%,
      black 20%,
      transparent 70%);
  mask-image: radial-gradient(circle at 85% 50%, black 20%, transparent 70%);
  -webkit-mask-size: cover;
  mask-size: cover;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.content-404 {
  user-select: none;
  width: 40%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: space-between;
}

.header-404 {
  font-family: var(--Cormorant);
  font-size: calc(var(--fontsize-header) + 20px);
  font-weight: 700;
  letter-spacing: -4%;
  line-height: 0.8;
}

.subheader-404 {
  font-size: var(--fontsize-20);
  font-weight: 500;
  letter-spacing: -2%;
}

.description-404 {
  margin: 20px 0;
  position: relative;
  width: 70%;
  font-size: var(--fontsize-16);
  font-weight: 400;
  letter-spacing: -1%;
  line-height: 1.5;
}

.description-404::before {
  opacity: 0.2;
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  background-image: url("../../assets/texture/quote.svg");
  background-size: contain;
  background-repeat: no-repeat;
  aspect-ratio: 1/1;
  width: calc(var(--fontsize-header) + 10px);
  transform: translate(-50%, -50%);
}

.description-404::after {
  opacity: 0.2;
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  background-image: url("../../assets/texture/quote.svg");
  background-size: contain;
  background-repeat: no-repeat;
  aspect-ratio: 1/1;
  width: calc(var(--fontsize-header) + 10px);
  transform: translate(-50%, 50%) rotate(180deg);
}

.author-404 {
  font-size: var(--fontsize-18);
  font-weight: 600;
  letter-spacing: -2%;
  align-self: end;
}

.link-404 {
  font-size: var(--fontsize-16);
}

.header {
  font-size: var(--fontsize-header);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -4%;
}

/* ################### */
/* Responsive */
/* ################### */
@media screen and (max-width: 568px) {
  :root {
    --fontsize-header: 32px;
    --fontsize-subheader: 24px;

    --fontsize-20: 17px;
    --fontsize-18: 16px;
    --fontsize-16: 14px;
    --fontsize-14: 12px;
  }

  .footer-wrapper {
    padding: 20px 0 30px;
  }

  .footer {
    width: 90%;
    gap: 80px;
    flex-direction: column;
  }

  .footer p {
    height: 40px;
    font-size: 12px;
    font-weight: 400;
  }

  .footer-social {
    margin: 0 auto;
  }

  .footer div {
    width: 100%;
    align-items: start;
  }

  .footer-logo {
    align-items: start;
  }
}

@media screen and (max-width: 768px) {
  .navBar {
    padding: 15px 0;
  }

  #icon {
    display: none;
  }

  #icon-mobile {
    display: block;
  }

  .nav-logo h1 {
    display: none;
  }

  .nav-menu ul {
    display: none;
  }

  .nav-button {
    border-left: 2px solid transparent;
  }

  .footer-logo img {
    height: 40px;
  }

  #error {
    display: flex;
    flex-direction: column;
    max-height: fit-content;
    padding: 0px;
  }

  #error img {
    position: static;
    top: 100%;
    width: 100%;
    height: 100%;
    min-height: 30vh;
    object-fit: cover;
    object-position: center;
    -webkit-mask-image: radial-gradient(circle at 50% 85%,
        black 30%,
        transparent 75%);
    mask-image: radial-gradient(circle at 50% 85%, black 30%, transparent 75%);
  }

  .content-404 {
    box-sizing: border-box;
    padding: 50px 20px 30px;
    width: 90%;
    max-width: 500px;
    margin: 0 auto;
  }

  .description-404 {
    transform: translateX(10px);
    width: 90%;
  }
}

/* ── iOS install banner ── */
#iosInstallBanner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 9998;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

#iosInstallBanner.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.ios-install-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.ios-install-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}

.ios-install-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.ios-install-text strong {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.ios-install-text span {
  font-size: 13px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.ios-share-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #032c93;
}

#iosInstallClose {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}

#iosInstallClose:hover {
  color: #4b5563;
}

.ios-install-btn {
  background: #032c93;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

.ios-install-btn:hover {
  background: #021f6b;
}

@media (min-width: 480px) {
  #iosInstallBanner {
    left: auto;
    right: 16px;
    bottom: 16px;
    width: 360px;
  }
}

/* Opt-in both the starting page and destination page to native transitions */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

/* ── Camera overlay (fullscreen) ── */
#cameraOverlay {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: #000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#cameraOverlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Camera header: back + title ── */
.cam-header {
  background: #032c93;
  color: white;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.cam-header h2 {
  font-size: var(--fontsize-18);
  font-weight: 600;
}

.cam-back-btn {
  background: none;
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  cursor: pointer;
}

.cam-back-btn span {
  font-size: 24px;
}

#reader-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#reader {
  position: relative;
  width: 100%;
  height: 100%;
}

#reader video {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  transition: transform 0.1s ease-out;
}

#reader__scan_region {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

#reader__scan_region img {
  display: none;
}

#reader__scan_region>div {
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.5) !important;
  border-radius: 12px;
  width: 260px !important;
  height: 260px !important;
  max-width: 260px !important;
  max-height: 260px !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}

#reader__dashboard {
  display: none;
}

/* Feedback pill */
#scanFeedback {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: var(--fontsize-14);
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
}

#scanFeedback.show {
  opacity: 1;
}

#scanFeedback.success {
  background: #16a34a;
  color: white;
}

#scanFeedback.error {
  background: #dc2626;
  color: white;
}

#scanFeedback.warn {
  background: #854d0e;
  color: white;
}

.cam-bottom {
  z-index: 1000;
  position: fixed;
  left: 50%;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  transform: translateX(-50%);
}

/* ── Gallery button (floating pill over camera) ── */
.gallery-btn {
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  padding: 10px 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  z-index: 5;
}

.gallery-btn span {
  font-size: 20px;
}

.gallery-btn p {
  font-size: var(--fontsize-14);
  font-weight: 500;
}

/* ── Zoom slider (vertical, right edge) ── */
.zoom-slider {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  height: 200px;
  background: rgba(0, 0, 0, 1);
  border-radius: 999px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
}

.zoom-slider span {
  color: white;
  font-size: 16px;
  opacity: 0.8;
}

.zoom-slider input[type="range"] {
  padding: 0 5px !important;
  flex: 1;
  writing-mode: vertical-lr;
  direction: rtl;
  width: 4px;
  accent-color: white;
  cursor: pointer;
}

/* ── Bottom camera tabbar (Scan / QR) ── */
.cam-tabbar {
  padding: 3px 6px;
  background: #004aad;
  display: flex;
  border-radius: 30px;
  overflow: hidden;
}

.cam-tabbar ul {
  width: 80svw;
  max-width: 300px;
  display: flex;
  flex-shrink: 0;
  gap: 10px;
}

.cam-tab {
  flex: 1;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border-radius: 28px;
}

.cam-tab span {
  font-size: 22px;
}

.cam-tab p {
  font-size: var(--fontsize-16);
  font-weight: 500;
}

.cam-tab.active {
  background-color: white;
  color: #004aad;
}

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: #1f2937;
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: var(--fontsize-14);
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s ease;
  pointer-events: none;
  max-width: 280px;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ── QR container inside camera overlay ── */
.qr-container {
  flex: 1;
  display: none;
  /* toggled to flex via .active */
  flex-direction: column;
  align-items: center;
  padding: 20px 24px 32px;
  box-sizing: border-box;
  background: #ffffff;
  overflow-y: auto;
}

.qr-container.active {
  display: flex;
}

.qr-container .qr-modal-logo {
  margin-top: 40px;
  height: 48px;
  width: auto;
}

.qr-container .qr-modal-caption {
  margin-top: 24px;
  font-size: var(--fontsize-18);
  font-weight: 600;
  color: #111827;
  text-align: center;
}

.qr-container .qr-modal-qr-wrap {
  margin-top: 32px;
  padding: 16px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: var(--boxshadow);
}

.qr-container .qr-modal-qr-wrap canvas {
  display: block;
  width: 220px;
  height: 220px;
}

.qr-container .btn-primary-wide {
  margin-top: auto;
  width: 100%;
  background: #004aad;
  color: white;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-size: var(--fontsize-16);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.qr-container .btn-primary-wide:disabled {
  opacity: 0.6;
  cursor: default;
}