/* ============================================================
   CSS RESET + GLOBAL TOKENS
   - Global → Initial Page → Queue Page → Error Page → Loading Page
   - Each view fills the screen (no scrolling)
============================================================ */
/* ========== CANVA SANS FONT FAMILY ========== */

@font-face {
  font-family: "CanvaSans";
  src: url("./assets/fonts/CanvaSans-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: "CanvaSans";
  src: url("./assets/fonts/CanvaSans-MediumItalic.otf") format("opentype");
  font-weight: 500;
  font-style: italic;
}

@font-face {
  font-family: "CanvaSans";
  src: url("./assets/fonts/CanvaSans-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "CanvaSans";
  src: url("./assets/fonts/CanvaSans-RegularItalic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
}

@font-face {
  font-family: "CanvaSans";
  src: url("./assets/fonts/CanvaSans-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: "CanvaSans";
  src: url("./assets/fonts/CanvaSans-BoldItalic.otf") format("opentype");
  font-weight: 700;
  font-style: italic;
}

/* ----- Reset ----- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-size: 16px;
}

body {
  margin: 0;
  padding: 0;
  height: 100%;
}

/* Remove default styles on common elements */
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  margin: 0;
  padding: 0;
}

img,
picture {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

/* Remove default button styles */
button {
  border: none;
  background: none;
}

/* Anchor reset (in case we add links later) */
a {
  color: inherit;
  text-decoration: none;
}

/* ----- Root Variables ----- */
:root {
  /* ========== Global ========== */
  --font-family-base: "CanvaSans", sans-serif;

  --layout-max-width: 1120px;
  --layout-padding-x: 24px;
  --layout-padding-y: 32px;
  --layout-gap-main: 0;

  --card-radius: 24px;
  --card-padding-x: 24px;
  --card-padding-y: 24px;
  --card-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);

  --color-text-main: white;
  --color-text-muted: white;
  --color-error: #fca5a5;

  --input-bg: #5a32fa;
  --input-border: rgba(255, 255, 255, 0.4);
  --input-border-focus: #38bdf8;
  --input-radius: 12px;
  --input-height: 85px;
  --input-padding-x: 38px;
  --input-font-size: 1.65rem;

  --glow-size-1: 22px;
  --glow-size-2: 22px;
  --glow-size-3: 22px;

  --btn-primary-bg: white;
  --btn-primary-text: #5a32fa;
  --btn-primary-radius: 12px;
  --btn-primary-shadow: 0 18px 40px rgba(56, 189, 248, 0.4);

  --btn-secondary-bg: transparent;
  --btn-secondary-border: rgba(148, 163, 184, 0.6);
  --btn-secondary-radius: 999px;
  --btn-secondary-text: #f9fafb;

  --hero-max-width: 420px;
  --hero-border-radius: 32px;

  --transition-fast: 150ms ease;

  --page-inner-bg: rgba(15, 23, 42, 0.92);
  --page-inner-border: rgba(148, 163, 184, 0.3);

  --field-label-size: 0.82rem;
  --field-label-weight: 600;
  --field-gap-y: 12px;
  --form-gap-y: 18px;

  --error-text-size: 0.8rem;

  /* ===== INITIAL PAGE TOKENS ===== */
  /* Full background gradient */
  --initial-bg: linear-gradient(323deg, #00c4cc 0%, #5a32fa 50%, #7d2ae8 100%);
  --initial-inner-bg: rgba(15, 23, 42, 0.95);
  --initial-inner-border: rgba(148, 163, 184, 0.4);
  --initial-form-width: 100%;

  --initial-input-header-gap: 10px;
  --initial-title-max-width: 260px;
  --initial-title-stack-gap: 6px;

  /* Merged title width */
  --initial-title-merge-width: 90%;

  --initial-badge-size: 12%;

  /* Badge position */
  --initial-badge-bottom: 22px;
  --initial-badge-right: -67px;

  --initial-hero-max-width: 420px;
  --initial-hero-offset-y: 0px;

  /* ===== QUEUE PAGE TOKENS ===== */
  --queue-bg: linear-gradient(323deg, #00c4cc 0%, #5a32fa 50%, #7d2ae8 100%);
  --queue-text-color: #e5e7eb;
  --queue-company-size: 3.25rem;
  --queue-company-weight: 600;
  --queue-number-size: 13.5rem;
  --queue-number-spacing: unset;
  --queue-gap-y: 20px;
  --queue-title-max-width: 19rem;
  --queue-subtitle-max-width: 130rem;

  --queue-title-top: 2vh;
  --queue-subtitle-top: 17vh;

  /* ===== ERROR PAGE TOKENS ===== */
  --error-bg: linear-gradient(323deg, #00c4cc 0%, #5a32fa 50%, #7d2ae8 100%);

  --error-inner-bg: rgba(15, 23, 42, 0.95);
  --error-inner-border: rgba(248, 113, 113, 0.5);
  --error-gap: 32px;

  --error-title-max-width: 260px;
  --error-text-img-max-width: 320px;
  --error-hero-max-width: 420px;

  /* ===== Breakpoints ===== */
  --bp-mobile: 768px;
}

/* ============================================================
   BODY + GLOBAL LAYOUT
   - Full-screen, no scroll
============================================================ */

html,
body,
button,
input,
select,
textarea,
.page-title-img,
.queue-company,
.queue-number,
.field-label,
.inline-error,
.legal-text,
.error-details {
  font-family: "CanvaSans", sans-serif !important;
  font-weight: 500;
}

/* Placeholder text */
::placeholder {
  font-family: "CanvaSans", sans-serif !important;
  font-weight: 500;
  color: var(--color-text-muted);
  opacity: 1;
}

body {
  font-family: var(--font-family-base);
  color: var(--color-text-main);
  background: var(--initial-bg);
  background-attachment: fixed;
  height: 100%;
  overflow: hidden; /* no scrolling */
}

/* Background changes by page class */
body.page-initial {
  background: var(--initial-bg);
  padding: 20px 50px;
  margin-left: 50px;
}

body.page-queue {
  background: var(--queue-bg);
}

body.page-error {
  background: var(--error-bg);
}

/* Main shell that fills the viewport */
.app-shell {
  width: 100%;
  height: 100vh; /* fill screen */
  display: flex;
  align-items: center; /* center card vertically */
  justify-content: center; /* center card horizontally */
}

/* A "page" is one of the states and fills the shell */
.page {
  flex: 1 1 auto;
  height: 100%;
  overflow: hidden;
  display: flex;
}

/* Inner layout wrapper fills the page */
.page-inner {
  display: flex;
  gap: var(--layout-gap-main);
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

/* Shared hero styles */
.hero-image {
  max-width: var(--hero-max-width);
  width: 100%;
  height: auto;
  border-radius: var(--hero-border-radius);
  object-fit: cover;
}

/* Title image wrapper */
.page-title-wrap {
  position: absolute;
  top: -3px;
    left: 0px;
  margin: 0 auto;
  /* border: 2px solid red; */
}

.page-title-img {
  max-width: 46%;
  height: auto;
  margin: 0 auto;
}

/* Buttons */
.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--btn-primary-radius);
  font-weight: 200;
  cursor: pointer;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast),
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

/* Primary */
.primary-btn {
  width: 22%;
  height: 100%;
  margin: 0 auto;
  margin-top: 34px;
    margin-bottom: -74px;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  box-shadow: var(--btn-primary-shadow);
  font-size: 2rem;
}

.primary-btn:hover {
  filter: brightness(1.05);
  transform: scale(1.1);
}

.primary-btn:active {
  transform: translateY(0);
  box-shadow: 0 12px 30px rgba(56, 189, 248, 0.3);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

/* Secondary */
.secondary-btn {
  background: var(--btn-secondary-bg);
  border: 1px solid var(--btn-secondary-border);
  color: var(--btn-secondary-text);
  margin-top: 18px;
  min-width: 180px;
}

.secondary-btn:hover {
  background: rgba(148, 163, 184, 0.12);
  border-color: #e5e7eb;
}

/* Hidden helper class (script.js uses this to switch views) */
.hidden {
  display: none !important;
}

/* ============================================================
   INITIAL PAGE (FORM)
============================================================ */

.page-initial .page-inner {
  /* initial inner styling if needed */
}

/* Layout: left form + right hero */
/* Layout: left form + right hero */
.initial-layout {
  display: flex;
  align-items: stretch;
}

/* Left column – make this take more space */
.initial-left {
  position: relative;
  flex: 0 0 60%;          /* <--- wider */
  max-width: 43%;         /* <--- match flex-basis */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Right column (big image) – smaller width */
.initial-right {
  flex: 0 0 40%;          /* <--- narrower */
  max-width: 51%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  margin-top: 52px;
}


.initial-hero-img {
  height: 100vh;
  width: auto;
  max-width: none;
  object-fit: contain;
}

/* HEADER WRAPPER */
.input-header {
  position: relative; /* enables absolute badge */
  display: flex;
  justify-content: center; /* center the title group */
  align-items: center;
  width: 100%;
  margin-bottom: 18px;
}

/* TITLE STACK (centered + controllable width) */
.input-header-left {
  position: relative;
  width: var(--initial-title-merge-width);
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* OVERLAY LOGIC: both images scale to the same width */
.input-title-img-top,
.input-title-img-bottom {
  width: 100%;
  max-width: 100%;
  height: auto;
}

/* Base layer */
.input-title-img-top {
  position: relative;
  z-index: 1;
  width: 83%;
  transform: translateX(-14%);
}

/* Overlay layer (centered) */
.input-title-img-bottom {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
  width: 90%;
}

/* EMOJI BADGE — absolute + controllable via vars */
.input-badge-img {
  position: absolute;
  bottom: var(--initial-badge-bottom);
  right: var(--initial-badge-right);
  width: var(--initial-badge-size);
  height: auto;
  object-fit: contain;
  z-index: 3;
  transform: rotateZ(-20deg);
}

/* Form */
.form-shell {
  display: flex;
  flex-direction: column;
  gap: var(--form-gap-y);
}

/* Fields */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field:first-child {
  margin-bottom: 20px;
}

/* Label */
.field-label {
  display: none;
  font-size: var(--field-label-size);
  font-weight: var(--field-label-weight);
  color: var(--color-text-muted);
}

/* Inputs wrapper */
.field-input-wrapper {
  width: 90%;
  margin: 0 auto;
  border-radius: var(--input-radius);
  padding: 2.5px; /* Border thickness */
  background: linear-gradient(to bottom, #ffffff, #5a32fa) border-box;
  background-clip: padding-box, border-box;
  background-origin: padding-box, border-box;
  box-shadow:
    0 0 var(--glow-size-1) 2px rgba(64, 64, 228, 0.55),
    0 0 var(--glow-size-2) 2px rgba(90, 50, 250, 0.3),
    0 0 var(--glow-size-3) 2px rgba(125, 42, 232, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.field-input-wrapper-ex {
  border-radius: var(--input-radius);
  box-shadow:
    0 0 var(--glow-size-1) 2px rgba(64, 64, 228, 0.55),
    0 0 var(--glow-size-2) 2px rgba(90, 50, 250, 0.3),
    0 0 var(--glow-size-3) 2px rgba(125, 42, 232, 0.25);
}

/* Actual input */
.field-input {
  width: 100%;
  height: calc(var(--input-height) - 8px);
  border-radius: var(--input-radius);
  border: none;
  padding: 0 var(--input-padding-x);
  background: var(--input-bg);
  color: var(--color-text-main);
  font-size: var(--input-font-size);
  outline: none;
  text-align: center;
  transition:
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.field-input::placeholder {
  color: white;
}

.field-input:focus {
  border-color: var(--input-border-focus);
  box-shadow:
    0 0 var(--glow-size-1) 2px rgba(0, 196, 204, 0.35),
    0 0 var(--glow-size-2) 2px rgba(90, 50, 250, 0.3),
    0 0 var(--glow-size-3) 2px rgba(125, 42, 232, 0.25);
}

/* Canva icon inside the link input */
.input-with-icon {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.input-icon-img {
  width: 2rem;
  height: auto;
  object-fit: contain;
}

/* Add left padding when icon present */
.field-input--with-icon {
  width: 100%;
  color: #5a32fa;
  padding-left: calc(var(--input-padding-x) + 22px);
  background-color: white;
  border-radius: 12px;
  height: var(--input-height);
}

.field-input--with-icon::placeholder {
  color: #5a32fa;
}

/* Inline error text under form */
.inline-error {
  min-height: 1em;
  margin-top: 4px;
  font-size: var(--error-text-size);
  color: var(--color-error);
}

/* Legal text block under inputs */
.legal-text {
  font-size: 1rem;
  color: var(--color-text-muted);
  width: 90%;
  text-align: left;
  margin-left: 38px;
  margin-top: 20px;
  font-style: italic;
  font-weight: 400;
}

.legal-text p:last-child {
  margin-top: 2rem;
}

/* ============================================================
   LOADING / PROCESSING PAGE
============================================================ */

.page-loading .page-inner {
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Layout wrapper for loading */
.loading-layout {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Top title image (absolute, centered horizontally) */
.loading-title-img {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 260px;
}

/* Center GIF (absolute center of page) */
.loading-gif-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 200px;
}

/* ============================================================
   QUEUE PAGE (SUCCESS)
============================================================ */

.page-queue .page-inner {
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Main wrapper */
.queue-layout {
  position: relative;
  min-height: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Background bottom image */
.queue-bg-bottom {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  pointer-events: none;
  z-index: 0;
}

/* Content center area */
.queue-content {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  color: var(--queue-text-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Company + number block (stays centered) */
.queue-info {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  margin-bottom: -75px;
  transform: rotateZ(-1deg);
}

.queue-company {
  color: #5a32fa;
  font-size: var(--queue-company-size);
  font-weight: var(--queue-company-weight);
}

.queue-number {
  color: black;
  font-size: var(--queue-number-size);
  letter-spacing: var(--queue-number-spacing);
  font-weight: 700;
  margin-top: -50px;
}

/* Title + subtitle now absolute at top-center */
.queue-title-img,
.queue-subtitle-img {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.queue-title-img {
  top: var(--queue-title-top);
  max-width: var(--queue-title-max-width);
}

.queue-subtitle-img {
  top: var(--queue-subtitle-top);
  max-width: var(--queue-subtitle-max-width);
}

/* ============================================================
   ERROR PAGE
============================================================ */

.page-error .page-inner {
  background: var(--error-inner-bg);
  border-color: var(--error-inner-border);
}

/* Layout: text on left + big image on right */
.error-layout {
  align-items: center;
  gap: var(--error-gap);
}

/* Left */
.error-left {
  flex: 1 1 auto;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Right */
.error-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-hero-img {
  max-width: var(--error-hero-max-width);
}

/* Error text image */
.error-text-img {
  max-width: var(--error-text-img-max-width);
  margin-top: 12px;
  margin-bottom: 12px;
}

/* Backend error details (optional text) */
.error-details {
  min-height: 1.2em;
  font-size: var(--error-text-size);
  color: var(--color-error);
  margin-top: 4px;
}

/* ===== FLOATING DECOR IMAGES (ON TOP OF EVERYTHING) ===== */
.floating-img {
  position: absolute;
  z-index: 999;      /* higher than any other element */
  pointer-events: none; /* don't block clicks */
}
/* Top-right image */
.float-pointer {
    width: 13vw;
    top: 546px;
    right: -22px;
}
.float-pointer-queue{
  width: 13vw;
    top: 779px;
    right: 483px;
}
.float-biggy {
  width: 53%;
    bottom: 0px;
    right: 50px;
    z-index: 22;
}
/* ============================================================
   RESPONSIVE BEHAVIOUR
============================================================ */

/* Hide placeholder only when input is focused */
.field-input:focus::placeholder,.field-input--with-icon:focus::placeholder  {
  color: transparent;
}


@media (max-width: 900px) {
  .initial-layout,
  .error-layout {
    flex-direction: column;
    align-items: center;
  }

  .initial-left,
  .error-left {
    max-width: 480px;
    width: 100%;
  }

  /* Hide big hero on the right */
  .initial-right,
  .error-right {
    display: none;
  }
}

@media (max-width: 600px) {
  .queue-number {
    font-size: 2.1rem;
  }

  .hero-image {
    border-radius: 24px;
  }

  .loading-title-img {
    max-width: 220px;
  }

  .loading-gif-img {
    max-width: 160px;
  }
}
