/*
 * BIPP2 public desktop layout — visual presentation only.
 * Does NOT modify the approved mobile HTML under /app/ or any JS/Supabase wiring.
 * The original approved blue and image/text content are preserved.
 *
 * Desktop: full-screen website / wide content.
 * Small screens: responsive full-width WEB view, not a framed phone mockup.
 */
@media (min-width: 701px) {
  html, body { width: 100%; min-height: 100%; }
  body { display: block; margin: 0; padding: 0; background: #00a9e8; }

  /* Welcome: full-bleed hero instead of a 410px app mockup. */
  .phone {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    min-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
    background: #00a9e8;
    overflow: visible;
  }
  .top { width: 100%; padding: 26px clamp(30px, 5vw, 92px) 0; font-size: 13px; }
  .tag { padding: 9px 16px; }
  .main {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 28px clamp(28px, 4vw, 70px) 52px;
    justify-content: center;
  }
  .main .logo { width: min(70vw, 760px); max-width: none; height: auto; }
  .strap { font-size: clamp(13px, 1.15vw, 17px); letter-spacing: 2.6px; margin: 2px 0 26px; }
  .intro { font-size: clamp(34px, 3.55vw, 58px); line-height: 1.15; margin: 0 0 17px; }
  .desc { font-size: clamp(16px, 1.3vw, 21px); line-height: 1.65; margin: 0 0 31px; }
  .buttons { width: 100%; max-width: 700px; gap: 15px; }
  .btn { font-size: clamp(17px, 1.25vw, 20px); padding: 20px 22px; border-radius: 15px; }
  .small { font-size: clamp(13px, 1vw, 15px); margin-top: 25px; }
  .foot { font-size: 13px; padding: 14px; }

  /* Auth, profile, filtering: spacious WEB screens with the same element IDs,
   * copy, actions and backend, not a different application. */
  .panel {
    position: fixed;
    inset: 0;
    z-index: 20;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 42px clamp(30px, 5.5vw, 100px) 72px;
    border-radius: 0;
    background: #f7fcff;
    box-shadow: none;
  }
  .panel > .bipp-page-brand,
  .panel > .back,
  .panel > .chip,
  .panel > h2,
  .panel > p,
  .panel > form,
  .panel > .demo-grid,
  .panel > .inner-screen,
  .panel > .msg,
  .panel > .note {
    max-width: 1050px;
    margin-left: auto;
    margin-right: auto;
  }
  .panel .bipp-page-brand { min-height: 100px; margin-bottom: 20px; }
  .panel .bipp-page-brand img { width: 195px; max-width: 100%; height: 90px; }
  .panel h2 { font-size: clamp(30px, 2.5vw, 41px); line-height: 1.2; }
  .panel p { font-size: 15px; line-height: 1.65; }
  .panel > form { max-width: 820px; }
  .panel > .back { display: block; width: 100%; text-align: left; margin-bottom: 18px; }
  .panel > .chip { display: table; margin-left: max(0px, calc((100% - 1050px) / 2)); }
  .panel .field { font-size: 15px; }
  .panel .input { font-size: 16px; padding: 16px 15px; }
  .panel .btn { padding: 16px 22px; }
  .panel .demo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .panel .demo-grid button { min-height: 85px; font-size: 16px; }
  .panel .inner-screen {
    width: 100%;
    max-width: 1050px;
    padding: clamp(24px, 3.5vw, 44px);
    margin-top: 22px;
    border-radius: 22px;
    box-shadow: 0 10px 36px #0a5e8114;
  }
  .inner-screen .bipp-page-brand { min-height: 58px; margin-bottom: 10px; }
  .inner-screen .bipp-page-brand img { width: 146px; height: 65px; }
  .panel .photo-layout, .panel .profile-show { max-width: 760px; gap: 20px; }
  .panel .photo-card { padding: 16px; }
  .panel .photo-card img, .panel .profile-show img, .panel .photo-placeholder { height: 250px; }
  .panel .discovery-preview { padding: 22px; }
  .panel .discovery-preview img { width: 104px; height: 126px; }
}
@media (min-width: 701px) and (max-height: 800px) {
  .main { padding: 4px 28px 16px; }
  .main .logo { width: min(58vw, 550px); }
  .strap { font-size: 13px; margin: 0 0 12px; }
  .intro { font-size: clamp(30px, 2.9vw, 45px); margin-bottom: 10px; }
  .desc { font-size: 16px; margin-bottom: 15px; }
  .buttons { gap: 11px; }
  .btn { font-size: 17px; padding: 13px 18px; }
  .small { font-size: 12px; margin-top: 12px; }
}
@media (min-width: 701px) and (max-width: 1020px) {
  .panel .demo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel { padding: 32px 32px 56px; }
}

/* BIPP2 mobile web adaptation. This file is linked ONLY by the public website
   index.html. The independently approved /app/ HTML remains untouched. */
@media (max-width: 700px) {
  html {
    width: 100%;
    min-height: 100%;
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  body {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
    margin: 0;
    background: #00a9e8;
    overflow-x: clip;
  }
  .phone {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    background: #00a9e8;
  }
  .top {
    padding: max(18px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
    gap: 12px;
    font-size: 11px;
  }
  .top .tag {
    flex-shrink: 0;
    padding: 7px 10px;
    font-size: 10px;
    letter-spacing: 0.3px;
  }
  .main {
    width: 100%;
    max-width: 510px;
    margin: 0 auto;
    padding: clamp(16px, 3vh, 30px) 22px 30px;
    justify-content: center;
    min-width: 0;
  }
  .main .logo {
    width: min(78vw, 340px);
    max-width: 100%;
    height: auto;
  }
  .strap {
    font-size: clamp(9px, 2.5vw, 12px);
    letter-spacing: 1.4px;
    line-height: 1.5;
    margin: 5px 0 22px;
  }
  .intro {
    font-size: clamp(25px, 6.6vw, 34px);
    line-height: 1.2;
    margin-bottom: 12px;
  }
  .desc {
    font-size: clamp(13px, 3.65vw, 16px);
    line-height: 1.6;
    margin-bottom: 24px;
  }
  .buttons {
    width: 100%;
    max-width: 470px;
    gap: 12px;
  }
  .btn {
    min-height: 48px;
    padding: 15px 14px;
    font-size: 15px;
    line-height: 1.3;
  }
  .small {
    max-width: 390px;
    font-size: 11px;
    line-height: 1.6;
    margin-top: 20px;
  }
  .foot {
    width: 100%;
    padding: 12px max(18px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
  }

  /* Login, registration, onboarding and logged-in pages use the whole screen.
     Existing form names, event handlers and account operations are unchanged. */
  .panel {
    position: fixed;
    inset: 0;
    z-index: 20;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 100vh;
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding: calc(18px + env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) calc(34px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
    background: #f7fcff;
    border-radius: 0;
    box-shadow: none;
  }
  .panel > * {
    max-width: 100%;
  }
  .panel .bipp-page-brand {
    min-height: 62px;
    margin: 0 auto 12px;
  }
  .panel .bipp-page-brand img {
    width: 132px;
    max-width: 60%;
    height: 60px;
    object-fit: contain;
  }
  .panel h2 {
    font-size: clamp(24px, 6.2vw, 31px);
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  .panel p {
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: break-word;
  }
  .panel .back {
    display: block;
    min-height: 44px;
    padding: 8px 0 14px;
  }
  .panel form,
  .panel .inner-screen,
  .panel .demo-grid {
    width: 100%;
    min-width: 0;
  }
  .panel .field {
    font-size: 14px;
  }
  .panel .input {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    font-size: 16px; /* Prevent iOS Safari automatic focus zoom */
  }
  .panel .checks {
    max-width: 100%;
    align-items: flex-start;
    overflow-wrap: anywhere;
  }
  .panel .checks input {
    flex: 0 0 auto;
    margin-top: 2px;
  }
  .panel .btn,
  .panel button[type="submit"],
  .panel .photo-upload {
    min-height: 44px;
    touch-action: manipulation;
  }
  .panel .inner-screen {
    padding: clamp(14px, 3.5vw, 22px);
    margin-top: 14px;
    border-radius: 16px;
    overflow-wrap: anywhere;
  }
  .panel .demo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0;
  }
  .panel .demo-grid button {
    min-width: 0;
    min-height: 70px;
    padding: 14px 8px;
    font-size: 13px;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .panel .photo-layout,
  .panel .profile-show {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-width: 100%;
  }
  .panel .photo-card,
  .panel .profile-show > * {
    min-width: 0;
  }
  .panel .photo-card img,
  .panel .profile-show img,
  .panel .photo-placeholder {
    width: 100%;
    height: clamp(125px, 38vw, 185px);
  }
  .panel .photo-upload {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 6px;
    overflow-wrap: anywhere;
  }
  .panel .discovery-preview {
    padding: 12px;
    overflow-wrap: anywhere;
  }
  .panel .discovery-preview img {
    max-width: 38%;
    height: 100px;
  }
  .panel .inner-screen button {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 350px) {
  .top { padding-left: 14px; padding-right: 14px; }
  .main { padding-left: 15px; padding-right: 15px; }
  .strap { font-size: 9px; letter-spacing: 0.8px; }
  .panel {
    padding-left: 14px;
    padding-right: 14px;
  }
  .panel .demo-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .panel .photo-layout,
  .panel .profile-show {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) and (orientation: landscape) and (max-height: 500px) {
  .main {
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .main .logo {
    width: min(40vw, 190px);
  }
  .strap { margin: 0 0 9px; font-size: 10px; }
  .intro { font-size: 23px; margin-bottom: 7px; }
  .desc { font-size: 13px; margin-bottom: 13px; }
  .btn { min-height: 44px; padding: 9px 12px; }
  .small { margin-top: 10px; }
}
