/* ==============================
   SKRBLR Landing Page (Refined)
   ============================== */

/* global custom property for the middle-column offset */
:root {
  --mid-shift: 40px; /* brings middle 40px closer to left, adds 40px to right */
  /* gap between the header's banner bubble and the page content */
  --bubble-gap: 32px;
}

/* Background with overlay */
html, body.landing {
  margin: 0;
  padding: 0;
  height: 100%;
  min-height: 100vh;
  background: url('/assets/img/index_bg_1.jpg') no-repeat center center fixed;
  background-size: cover;
  display: flex;
  flex-direction: column;
  overflow-y: hidden; /* prevent scrollbars on landing/front */
}
.bg-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(255, 255, 255, 0.5);
  z-index: 0;
}

/* Flip container */
.flip-container {
  flex: 1 0 auto;
  perspective: 1200px;
  position: relative;
  overflow: hidden;
}
.flipper {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}
.flip-container.flipped .flipper { transform: rotateY(180deg); }
.front, .back {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  backface-visibility: hidden;
}

/* FRONT (login) — centered */
.front {
  z-index: 2;
  transform: rotateY(0deg);
  overflow: hidden;
  display: flex;
  align-items: center;     /* vertical centering */
  justify-content: center; /* horizontal centering */
}

/* BACK (learn more) */
.back  {
  transform: rotateY(180deg);
  background: rgba(255,255,255,0.95);

  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;

  padding: 2rem 0;           /* gutters handled by inner sections */
  text-align: center;
  overflow-y: auto;
}

/* Front center wrapper */
.landing-wrapper {
  height: auto;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 2rem; z-index: 1;
}

/* Front logo + tagline */
.logo img { max-width: 280px; height: auto; }
.logo .tagline { margin-top: 0.5rem; color: #000; font-size: 1rem; }

/* Login Card */
.login-card {
  background: #fff; border-radius: 12px; border: 2px solid #ff8c42;
  padding: 2rem; width: 340px; margin-top: 1.5rem; margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4); text-align: center;
}
.login-card form input {
  width: 100%; box-sizing: border-box; padding: 0.8rem; margin-bottom: 1rem;
  border: 1px solid #ccc; border-radius: 6px; font-size: 0.95rem; background: #fff; color: #000;
}
.btn-login {
  width: 100%; box-sizing: border-box; padding: 0.9rem; background: #ff8c42;
  border: none; border-radius: 6px; font-weight: bold; font-size: 1rem; color: #fff; cursor: pointer;
}
.btn-login:hover { background: #ff9d5c; }
.signup-link { margin-top: 0.5rem; margin-bottom: 0; font-size: 0.9rem; color: #333; }
.signup-link a { color: #ff8c42; font-weight: bold; }

/* Signup explanatory blurb above the fields */
.right-card .signup-blurb {
  margin: 0 0 0.8rem 0;
  font-size: 0.95rem;
  line-height: 1.3;
  color: #333;
  text-align: left;
}

/* Footer */
.landing-footer {
  flex-shrink: 0; margin-top: auto; background: #000; color: #ff8c42;
  text-align: center; height: 40px; line-height: 40px; font-size: 0.85rem; z-index: 5; position: relative;
}

/* Learn More Button */
.learn-more {
  position: fixed; bottom: 60px; right: 20px; width: 80px; height: 80px;
  border-radius: 50%; border: 2px solid #e6732f;
  background: linear-gradient(to bottom, #ffb273, #ff8c42);
  color: #000; font-weight: bold; font-size: 0.9rem; cursor: pointer;
  box-shadow: 0 6px 10px rgba(0,0,0,0.4);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  z-index: 1000;
  will-change: transform; display: flex; align-items: center; justify-content: center; text-align: center;
}
.learn-more:hover { background: linear-gradient(to bottom, #ffc28c, #ff9d5c); }
.learn-more:active { transform: scale(0.95) translateY(2px); box-shadow: 0 3px 6px rgba(0,0,0,0.4); }

/* Button animations */
@keyframes wiggle { 0%,100%{transform:rotate(0);}20%{transform:rotate(-6deg);}40%{transform:rotate(6deg);}60%{transform:rotate(-3deg);}80%{transform:rotate(3deg);} }
@keyframes bounce { 0%,100%{transform:translateY(0) scale(1);}20%{transform:translateY(0) scaleY(0.85) scaleX(1.15);}40%{transform:translateY(-20px) scale(1);}60%{transform:translateY(0) scale(1);}80%{transform:translateY(-8px) scale(1);} }
@keyframes pop { 0%{transform:scale(1);}20%{transform:scale(0.95);}40%{transform:scale(1.15);}70%{transform:scale(0.97);}100%{transform:scale(1);} }
.learn-more.wiggle { animation: wiggle 0.8s ease-in-out; }
.learn-more.bounce { animation: bounce 1s cubic-bezier(.28,.84,.42,1); }
.learn-more.pop    { animation: pop 0.8s cubic-bezier(.68,-0.55,.27,1.55); }

/* ----------------------
   Back Page Styling
   ---------------------- */

/* Wrapper fills height — grid so .info-body can be vertically centered */
.info-wrapper {
  width: 100%;
  margin: 0;
  color: #222;
  position: relative;
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  row-gap: var(--bubble-gap_);
}

/* Header */
.info-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0;
}

/* Pin logo */
.back .info-logo {
  position: fixed; top: 16px; left: 56px;
  max-width: 120px; height: auto; z-index: 3;
}

/* Speech bubble */
.speech-bubble {
  background: #ff8c42; color: #fff;
  padding: 0;
  border-radius: 40px 40px 40px 0;
  position: relative;
  width: 1000px;
  min-height: 50px;
  height: auto;
  display: flex;
  align-items: center;
  margin-left: 160px;
  overflow: hidden;
}
.speech-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 40px;
  align-items: center;
  width: 100%;
}
.sb-left { padding-left: 40px; text-align: left; display: flex; align-items: center; min-height: 50px; }
.sb-heading { font-size: 1.05rem; font-weight: 700; line-height: 1.2; opacity: 0.95; white-space: nowrap; margin: 0; }
.sb-right { padding-right: 40px; text-align: left; display: flex; align-items: center; min-height: 50px; }
.sb-quote {
  font-size: 0.95rem; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: clip; text-align: left;
  opacity: 0; transform: translateY(6px);
  transition: opacity .5s ease, transform .5s ease;
  margin: 0;
}
.sb-quote.show { opacity: 1; transform: translateY(0); }

/* ===== Three-column body ===== */
.info-body {
  padding-left: clamp(12px, 2vw, 24px);
  padding-right: clamp(56px, 6vw, 96px);
  display: grid;
  grid-template-columns: minmax(320px, 720px) 1fr 1fr;
  row-gap: clamp(24px, 4vw, 64px);
  column-gap: clamp(24px, 4vw, 64px);
  width: 100%;
  align-items: stretch;
  grid-auto-rows: min-content;
  text-align: left;
  justify-self: stretch;
  align-self: center;
}

/* CENTER column */
.info-body > :nth-child(2) {
  margin-left: calc(var(--mid-shift) * -1);
  margin-right: var(--mid-shift);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* LEFT/RIGHT cells */
.info-body > :nth-child(1) { margin-left: 10px; }
.info-body > :nth-child(3) { margin-right: 60px; }

/* Shared type */
.info-body .section-title {
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 800;
  line-height: 1.05;
  margin: 0 0 0.5em;
}

/* Left card */
.left-card {
  background: #ff8c42; color: #fff; padding: 1.5rem; border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  max-width: 68ch; align-self: stretch;
}
.left-card p { margin: 0 0 1rem; font-size: clamp(15px, 1.15vw, 18px); line-height: 1.25; }
.left-card p + .section-title { margin-top: 40px; }

/* Middle spacing */
.middle-top p { margin: 0; }
.middle-top p + p { margin-top: 20px; }
.middle-top {
  background: transparent; border: none; box-shadow: none; border-radius: 0;
  padding: 20px 0 0 0; margin: 0 0 40px 0; color: #222;
}

/* Privacy card */
.middle-bottom {
  background: #fff; border: 2px solid red; padding: 1.5rem; border-radius: 12px;
  color: #222; margin-top: auto;
}
.middle-bottom h2 { color: #d11a2a; }
.middle-bottom p { font-size: clamp(13px, 1vw, 16px); line-height: 1.25; margin: 0; }
.middle-top h2, .middle-bottom h2 { font-size: clamp(18px, 2.2vw, 24px); font-weight: 800; margin: 0 0 0.5rem; }

/* Right card */
.right-card {
  background: #fff; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 1rem 1rem 0.5rem 1rem; display: flex; flex-direction: column; align-items: stretch; color: #222;
  border: 2px solid #ff8c42;
  min-height: 540px;
}

/* -------- TABS: equal-height panes (no jumps) -------- */
.right-card .right-content {
  flex: 1;
  display: grid;
  position: relative;
  min-height: 400px;
}

/* When Sign Up tab isn't active, don't let the mini SKRBLR affect height */
#tab-signup:not(.is-active) .signup-human { display: none; }


/* stack all panes in the same grid cell */
.right-card .right-content > .tab-pane {
  grid-area: 1 / 1 / 2 / 2;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  align-self: start;
}

/* active pane is visible and interactive */
.right-card .right-content > .tab-pane.is-active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* neutralize global .hidden for tab panes only */
.right-card .right-content > .tab-pane.hidden { display: block; }

/* empty state block shares the same grid cell; hide when .hidden is added */
.right-card .right-content > .empty-state-block { 
  grid-area: 1 / 1 / 2 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-left: 30px;
  padding-right: 30px;
  box-sizing: border-box;
}
.right-card .right-content > .empty-state-block.hidden { display: none; }

/* Add padding to the paragraph inside empty-state-block as well */
.right-card .right-content > .empty-state-block p {
  margin: 0;
  padding: 0;
}

/* Toggle buttons */
.right-card .toggle-buttons { display: flex; justify-content: space-between; margin-bottom: 2rem; }
.right-card .toggle-buttons button {
  flex: 1; padding: 0.8rem; margin: 0 0.3rem; border-radius: 8px; border: none;
  font-weight: bold; cursor: pointer; transition: background 0.2s; background: #eee; color: #333;
}
.right-card .toggle-buttons button.active { background: #ff8c42; color: #fff; }

/* Step 1 row: align circle with input */
.right-card .demo-step { display: block; }
.right-card .step1 .step-row { display: flex; align-items: center; gap: 0.8rem; width: 100%; margin-right: -0.5rem; }
.right-card .step1 .step-circle { margin: 0; flex-shrink: 0; }
.right-card .step1 input[type="text"] {
  flex: 1; min-width: 0; box-sizing: border-box; padding: 0.8rem; margin: 0;
  border: 1px solid #ccc; border-radius: 6px; font-size: 0.95rem; background: #fff; color: #000;
}

.right-card .step1 .try-form { flex: 1 1 auto; min-width: 0; }
right-card .step1 .try-form input[type="text"] { width: 100%; }

.right-card .step1 #trySubmitBtn { margin-top: 0.6rem; margin-left: calc(36px + 0.8rem); width: calc(100% - 36px - 0.8rem); }

/* ===== Signup tab (clean styles) ===== */
.right-card .signup-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;                 /* spacing between fields */
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}
.right-card .signup-form input {
  width: 100%;
  max-width: 100%;             /* prevent spill over the card edge */
  min-width: 0;
  box-sizing: border-box;
  padding: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  background-color: #fff;      /* kill black fills */
  color: #000;
  appearance: none;
}
.right-card .signup-form input:focus {
  outline: 2px solid #ff8c42;
  outline-offset: 0;
}
.right-card .signup-form .btn-login {
  width: 100%;
  box-sizing: border-box;
}

.right-card .signup-form .hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* autofill normalization without !important */
.right-card .signup-form input:-webkit-autofill,
.right-card .signup-form input:-webkit-autofill:hover,
.right-card .signup-form input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  -webkit-text-fill-color: #000;
  caret-color: #000;
  transition: background-color 9999s ease-in-out 0s;
}

/* optional tiny confirmation line */
.right-card .signup-confirm {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: #333;
  text-align: center;
}

/* Generic demo styles */
.demo-step, .step { display: flex; align-items: flex-start; margin-bottom: 1rem; }
.step-circle, .circle {
  width: 36px; height: 36px; border-radius: 50%; background: #ff8c42; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: bold; margin-right: 0.8rem;
  flex-shrink: 0;
}
.demo-placeholder { border: 2px dashed #ccc; border-radius: 8px; padding: 2rem; text-align: center; font-style: italic; color: #999; margin-top: 0.5rem; }
.step-content { border: none; padding: 0; margin-top: 0; flex: 1; }

/* Step 2 specific: align circle with top of canvas */
#tryStep2 { align-items: flex-start; }
#tryStep2 .step-content { display: flex; justify-content: center; margin-top: -30px; }

/* Step # specific: align circle with top of text */
#tryStep3 { align-items: flex-start; }
#tryStep3 .step-content { display: flex; flex-direction: column; justify-content: center; margin-top: -30px; }

/* Force hidden steps to be invisible and not take space */
.demo-step.hidden { 
  display: none !important; 
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.hidden { display: none; }

/* SKRBLR Demo Canvas — EXACT MATCH to testlab.php */
.demo-skrblr {
  background: #fff;
  border: 2px solid #ff8c42;
  border-radius: 12px;
  padding: 10px;
  width: 270px;
  box-sizing: border-box;
}

.demo-skrblr-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.demo-mini-logo img { width: 46px; height: auto; }

.demo-clock { display: flex; gap: 8px; align-items: center; font-weight: 800; margin-right: 5px; }
.demo-clock-ico { opacity: 0.7; }

.demo-canvas-wrap { display: flex; flex-direction: column; gap: 10px; }

.demo-canvas {
  position: relative;
  width: 245px;
  height: 120px;
  background: #f7f7f7;
  border: 2px dashed #cfcfcf;
  border-radius: 10px;
  overflow: hidden;
  box-sizing: border-box;
}

/* drawing layer (canvas element) */
.demo-draw {
  position: absolute;
  inset: 0;
  width: 245px;
  height: 120px;
  touch-action: none;
  display: block;
  transition: opacity .16s ease;
}
.demo-draw.ghosted { opacity: 0.20; } /* was 0.25 */

/* instruction message (centre) */
.demo-message {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; pointer-events: none; text-align: center; line-height: 1.25; color: #333; font-size: 14px; z-index: 2;
  transition: opacity .16s ease;
}
.demo-message.faded { opacity: 0.20; } /* was 0.25 */

/* success/fail banner */
.demo-result {
  position: absolute; inset: 0;
  display: none; align-items: center; justify-content: center;
  font-weight: 900; font-size: 22px; pointer-events: none; z-index: 4;
}
.demo-result.show { display: flex; }
.demo-result.is-success { color: #1db954; } /* green */
.demo-result.is-fail    { color: #b00020; } /* red */

/* pencil button */
.demo-pencil {
  position: absolute; width: 25px; height: 25px; border: 0; padding: 0; background: transparent; cursor: pointer; z-index: 3;
  display: none;
}
.demo-pencil.show { display: block; }
.demo-pencil .ring {
  position: absolute; inset: 0; border-radius: 999px; background: #fff; box-sizing: border-box; border: 3px solid #ff8c42;
}
.demo-pencil .icon {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); pointer-events: none;
  width: 16px; height: 16px;
}

/* cursor changes to pencil while drawing mode */
.demo-canvas.cursor-pencil,
.demo-canvas.cursor-pencil *{
  cursor: url('/assets/img/pencil_pointer_16x16.png') 0 0, crosshair;
}

/* BEGIN / DONE / RESET DEMO */
.demo-cta { display: flex; justify-content: center; padding-top: 10px; }
.demo-cta .btn-login {
  width: 245px; background: #ff8c42; color: #fff; border: none; padding: 0.6rem; border-radius: 6px;
  font-weight: bold; font-size: 1rem; cursor: pointer; margin-left: -2px;
}
.demo-cta .btn-login:hover { background: #ff9d5c; }

/* Pencil Slot Positions (no inline left/top) — stage is 245 x 120 */
.demo-pencil.slot-0 { left:  8px;  top:  8px; }   /* TL */
.demo-pencil.slot-1 { left: 60px;  top:  8px; }   /* T near-left */
.demo-pencil.slot-2 { left:112px;  top:  6px; }   /* T centre */
.demo-pencil.slot-3 { left:170px;  top:  8px; }   /* T near-right */
.demo-pencil.slot-4 { left:210px;  top:  8px; }   /* TR */
.demo-pencil.slot-5 { left:  8px;  top: 48px; }   /* L mid */
.demo-pencil.slot-6 { left:212px;  top: 48px; }   /* R mid */
.demo-pencil.slot-7 { left:  8px;  top: 86px; }   /* BL */
.demo-pencil.slot-8 { left: 60px;  top: 88px; }   /* B near-left */
.demo-pencil.slot-9 { left:210px;  top: 88px; }   /* BR */

/* Responsive */
@media (max-width: 960px) {
  .back { padding: 1.25rem 0; }
  .info-body {
    grid-template-columns: 1fr; row-gap: 16px; column-gap: 16px;
    padding-left: 16px; padding-right: 16px; margin-top: 0.5rem; margin-bottom: 1rem;
    align-items: stretch;
    justify-self: stretch;
    align-self: center;
  }
  .info-body > :nth-child(1) { margin-left: 0; }
  .info-body > :nth-child(2), .info-body > :nth-child(3) { margin-left: 0; margin-right: 0; }
  .info-body > :nth-child(2) { display: block; min-height: auto; }
  .left-card { max-width: 100%; }
}

/* Step 3 text styles */
#tryStep3 .step3-main {
  margin: 0 0 20px 3rem;
  font-size: 1.1rem;
  font-weight: 600;
  white-space: nowrap;
}

#tryStep3 .step3-sub {
  margin: 0;
  white-space: nowrap;
}

#tryStep3 .step3-link {
  color: #ff8c42;
  font-weight: bold;
  text-decoration: underline;
  cursor: pointer;
}

/* Privacy Policy Modal */
.privacy-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: 60px;
}

.privacy-modal-overlay.show {
  display: flex;
}

.privacy-modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 0;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  position: relative;
}

.privacy-modal-header {
  background: #ff8c42;
  color: #fff;
  padding: 24px 32px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.privacy-modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.privacy-modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.privacy-modal-close:hover {
  opacity: 0.8;
}

.privacy-modal-body {
  padding: 32px;
  overflow-y: auto;
  color: #222;
  line-height: 1.6;
  --sb-nudge: -10px;
  margin-right: calc(-1 * var(--sb-nudge));
  padding-right: calc(32px + var(--sb-nudge));
}

.privacy-modal-body h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 24px 0 12px 0;
  color: #ff8c42;
}

.privacy-modal-body h3:first-child {
  margin-top: 0;
}

.privacy-modal-body p {
  margin: 0 0 16px 0;
  font-size: 15px;
}

.privacy-modal-body ul {
  margin: 0 0 16px 0;
  padding-left: 24px;
}

.privacy-modal-body li {
  margin-bottom: 8px;
  font-size: 15px;
}

.privacy-modal-body strong {
  font-weight: 600;
  color: #000;
}

.privacy-modal-body .effective-date {
  font-style: italic;
  color: #666;
  margin-bottom: 24px;
}

.privacy-link {
  color: #ff8c42;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}

.privacy-link:hover {
  color: #e67a2e;
}

@media (max-width: 768px) {
  .privacy-modal-content {
    max-width: 100%;
    margin: 10px;
  }

  .privacy-modal-header {
    padding: 20px;
  }

  .privacy-modal-body {
    padding: 20px;
  }
}