/* ===============================
   BIN Checker — Light Modern UI (CSS FIXED)
   Keeps your existing classes/features, fixes layout crash + marquee + fit screen
   =============================== */

:root{
  --bg1:#f8fafc;
  --bg2:#eef2ff;
  --card:#ffffff;
  --glass:rgba(255,255,255,0.85);
  --text:#0f172a;
  --muted:#64748b;
  --primary:#2563eb;
  --secondary:#22c55e;
  --border:#e5e7eb;
  --radius:14px;
  --shadow:0 12px 30px rgba(15,23,42,0.08);
}

*{box-sizing:border-box}

html,body{
  margin:0;
  height:100%;
  font-family:"Poppins",system-ui,-apple-system,Segoe UI,Roboto,Arial;
  color:var(--text);
  background:
    linear-gradient(180deg,var(--bg1) 0%, var(--bg2) 70%),
    radial-gradient(800px 400px at 10% 10%, rgba(37,99,235,0.08), transparent 40%);
  overflow:hidden; /* desktop: one view */
}

a{color:var(--primary);text-decoration:none}

/* ===== APP GRID (navbar + marquee + main + footer) ===== */
.app{
  height:100vh;
  display:grid;
  grid-template-rows:60px 40px 1fr 40px;
  width:100%;
}

/* ===== NAVBAR ===== */
.navbar{
  grid-row:1;
  background:rgba(255,255,255,0.92);
  backdrop-filter:blur(10px);
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 120px 10px 20px; /* hamburger 100px left */
  box-shadow:0 4px 20px rgba(0,0,0,0.06);
  z-index:10;
}
.navbar h1{
  font-size:20px;
  margin:0;
  font-weight:700;
  color:var(--primary);
}

/* ===== HAMBURGER ===== */
.hamburger{
  width:36px;height:22px;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}
.hamburger div{
  height:3px;
  background:var(--text);
  border-radius:4px;
  transition:.3s;
}
.hamburger.active div:nth-child(1){transform:rotate(45deg) translateY(9px)}
.hamburger.active div:nth-child(2){opacity:0}
.hamburger.active div:nth-child(3){transform:rotate(-45deg) translateY(-9px)}

/* ===== SIDE MENU (overlay) ===== */
.side-menu{
  position:fixed;
  top:0;right:-260px;
  width:260px;height:100%;
  background:var(--card);
  padding-top:70px;
  transition:.35s;
  box-shadow:-6px 0 30px rgba(0,0,0,0.08);
  z-index:999;
}
.side-menu.active{right:0}
.side-menu a{
  display:block;
  padding:16px 24px;
  color:var(--text);
  border-bottom:1px solid var(--border);
  font-weight:500;
}
.side-menu a:hover{background:#f1f5f9}

/* ===== MARQUEE (smooth infinite) ===== */
.marquee-wrap{
  grid-row:2;
  overflow:hidden;
  background:linear-gradient(90deg,#e0e7ff,#ecfeff);
  display:flex;
  align-items:center;
}
.marquee-track{
  display:inline-flex;
  align-items:center;
  gap:60px;
  white-space:nowrap;
  will-change:transform;
  animation:marquee-scroll 28s linear infinite;
  padding-left:12px;
}
.marquee-item{
  font-size:14px;
  font-weight:600;
  color:#1e3a8a;
}
@keyframes marquee-scroll{
  from{transform:translateX(0)}
  to{transform:translateX(-50%)}
}

/* ===== MAIN AREA (fit screen) ===== */
.main-area{
  grid-row:3;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;

  padding:14px 12px 8px;
  gap:10px;
}

/* Titles under the tool */
.container h1{margin:6px 0 0;font-size:28px}
.container .small{margin:6px 0 10px;color:var(--muted);font-size:14px}

/* ===== Tool container ===== */
.container{
  width:100%;
  max-width:640px;
  text-align:center;
}

/* ===== FLIP CARD ===== */
.scene{perspective:1200px; width:100%; display:flex; justify-content:center;}

.card {
  width: 100%;
  max-width: 520px;
  min-height: 530px;   /* ⬅️ CRITICAL */
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s ease;
}

.card.flipped{transform:rotateY(180deg)}
.card.flipped .front{
  visibility:hidden;
  pointer-events:none;
}

.face{
  position:absolute;
  inset:0;
  backface-visibility:hidden;
  border-radius:var(--radius);
  padding:20px;
  background:var(--glass);
  box-shadow:var(--shadow);
}
.front{display:flex;flex-direction:column;justify-content:center;gap:10px}
.back {
  transform: rotateY(180deg);
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;

  /* IMPORTANT FIXES */
  overflow: visible;      /* allow content */
  height: auto;
  max-height: none;
}


/* ===== INPUT & BUTTON ===== */
input{
  width:100%;
  padding:14px;
  border-radius:12px;
  border:1px solid var(--border);
  font-size:17px;
  text-align:center;
  background:#fff;
}
input:focus{
  outline:none;
  border-color:var(--primary);
  box-shadow:0 0 0 3px rgba(37,99,235,0.15);
}
button{
  padding:13px 18px;
  border:none;
  border-radius:12px;
  font-size:17px;
  font-weight:700;
  color:#fff;
background: linear-gradient(135deg,#0a3697,#39463e), radial-gradient(400px 200px at 10% 10%, rgba(255,255,255,0.25), transparent 40%);
  cursor:pointer;
  box-shadow:0 10px 20px rgba(37,99,235,0.18);
  margin-top: 10px;
  margin-bottom: 10px;
}
button:hover{transform:translateY(-1px)}
button:active{transform:scale(.98)}

/* BIN hint */
.bin-hint{
  font-size:13px;
  color:var(--muted);
  line-height:1.4;
}

/* ===== Result content tweaks to fit ===== */
.flag{font-size:46px; line-height:1}
.scheme-logo{width:72px;height:auto;margin:0 auto}
.bank-name{font-size:20px;font-weight:800;margin:0}
.small{color:#ef4444;font-size:14px;margin:0}

.grid{
  width:100%;
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:10px;
}
.card-info{
  background:#f8fafc;
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px;
  font-size:14px;
}

/* Dummy card */
.card-preview{
  width:100%;
  max-width:300px;
  height:165px;
  padding:16px;
  border-radius:18px;
background: linear-gradient(135deg,#0a3697,#39463e), radial-gradient(400px 200px at 10% 10%, rgba(255,255,255,0.25), transparent 40%);
  color:#fff;
  font-family:"Courier New",monospace;
  box-shadow:0 18px 40px rgba(0,0,0,.18);
  position:relative;
}
.card-chip{
  width:42px;height:32px;
  background:linear-gradient(135deg,#fef3c7,#fde68a);
  border-radius:6px;
  margin-bottom:12px;
}
.card-number{font-size:18px;letter-spacing:1.6px;margin-bottom:10px}
.card-bank{font-size:13px;opacity:.95}
.scheme-badge{width:60px;position:absolute;bottom:12px;right:14px}

/* ===== Description (limited height for one-view) ===== */
.description{
  width:100%;
  max-width:820px;
  background:var(--card);
  border-radius:16px;
  box-shadow:var(--shadow);
  padding:12px 14px;
  font-size:14px;
  line-height:1.45;
 
  overflow:hidden;
}
.description h2{margin:0 0 6px;color:#1340a4;font-size:18px}
.description p{margin:0}

/* ===== Pages (inside main-area; hidden by JS) ===== */
.page{
  display:none;
  width:100%;
  max-width:820px;
  background:var(--card);
  border-radius:16px;
  box-shadow:var(--shadow);
  padding:14px 16px;
  line-height:1.55;
  overflow:auto;
  max-height:100%;
}
.page h3{margin:0 0 8px;color:var(--primary)}

/* ===== FOOTER ===== */
.site-footer{
  grid-row:4;
  background:#fff;
  border-top:1px solid var(--border);
  color:var(--muted);
  text-align:center;
  padding:8px 0;
  font-size:13px;
}

/* ===== Mobile fallback: allow scroll ===== */
@media(max-width:768px){
  html,body{overflow:auto}
  .app{min-height:100vh;height:auto}
  .main-area{overflow:visible}
  .description{max-height:none}
  .back{overflow:auto}
  .grid{grid-template-columns:1fr}
}
/* ========= FIX RESULT NOT SHOWING ========= */

/* Let main area show the flip-card fully */
.main-area{
  overflow: visible !important; /* IMPORTANT: remove clipping */
}

/* Make the flip card tall enough for result */

/* Ensure faces fill the card perfectly */
.face{
  width: 100% !important;
  height: 100% !important;
}

/* Back face should scroll INSIDE if content is too big (best UX) */
.back{
  overflow-y: auto !important;
  overflow-x: hidden !important;

  /* Fit inside the screen area (navbar+marquee+footer) */
  max-height: calc(100vh - 60px - 40px - 40px - 40px) !important;
  /*          screen - nav  - marquee - footer - extra padding */
}/* ===== FINAL BACK FACE BEHAVIOR ===== */

/* DESKTOP / LARGE HEIGHT: show everything, no scroll */
@media (min-height: 850px) {
  .back {
    overflow: visible !important;
    max-height: none !important;
  }
}

/* LAPTOPS / SMALL HEIGHT: allow internal scroll */
@media (max-height: 849px) {
  .back {
    overflow-y: 700px !important;

    /* viewport - navbar - marquee - footer - padding */
  }
}

/* ===== BIN CARD PREVIEW (Front) ===== */
.bin-card-preview{
  width:100%;
  max-width:340px;
  height:190px;
  margin:0 auto 18px;
  padding:18px;
  border-radius:20px;
  position:relative;

background: linear-gradient(135deg,#0a3697,#39463e), radial-gradient(400px 200px at 10% 10%, rgba(255,255,255,0.25), transparent 40%);

  color:#fff;
  font-family:"Courier New",monospace;

  box-shadow:
    0 20px 45px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.35);

  overflow:hidden;
}

/* glossy light streak */
.bin-card-preview::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(
    120deg,
    rgba(255,255,255,.35),
    transparent 35%,
    transparent 65%,
    rgba(255,255,255,.15)
  );
  pointer-events:none;
}

.bin-card-chip{
  width:46px;
  height:34px;
  background:linear-gradient(135deg,#fde68a,#facc15);
  border-radius:6px;
  margin-bottom:18px;
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.35);
}

/* BIN number styling */
.bin-number{
  font-size:18px;
  letter-spacing:2px;
  margin-bottom:12px;
}

.bin-highlight{
  background:rgba(255,255,255,.25);
  padding:4px 6px;
  border-radius:6px;
  font-weight:700;
}

.bin-muted{
  opacity:.9;
}

/* labels */
.bin-card-label{
  font-size:12px;
  opacity:.9;
  line-height:1.4;
}

.bin-card-brand{
  position:absolute;
  bottom:14px;
  right:18px;
  font-size:14px;
  font-weight:700;
  letter-spacing:1px;
  opacity:.85;
}
/* ===== BIN CARD ADVANCED EFFECTS ===== */

/* Base card (default neutral) */
.bin-card-preview{
  transition:
    transform .25s ease,
    box-shadow .25s ease,
    background .4s ease;
  transform-style:preserve-3d;
}

/* Hover tilt (desktop only) */
@media (hover:hover){
  .bin-card-preview:hover{
    transform:rotateX(6deg) rotateY(-6deg);
    box-shadow:0 28px 60px rgba(0,0,0,.45);
  }
}

/* Glow when BIN complete */
.bin-card-preview.glow{
  box-shadow:
    0 0 0 2px rgba(255,255,255,.25),
    0 0 25px rgba(34,197,94,.7),
    0 20px 45px rgba(0,0,0,.35);
    background: linear-gradient(135deg,#0a3697,#39463e), radial-gradient(400px 200px at 10% 10%, rgba(255,255,255,0.25), transparent 40%);
}



/* Card logos */
.bin-card-logo{
  position:absolute;
  bottom:16px;
  right:18px;
  width:64px;
  height:auto;
  opacity:.9;
  display:none;
}
/* ===== Navbar Logo ===== */
.logo-wrap{
  display:flex;
  align-items:center;
}

.logo{
  height:46px;          /* adjust if needed */
  width:auto;
  object-fit:contain;
}

.editorial-content{max-width:900px;margin:32px auto;padding:24px;line-height:1.75;background:rgba(255,255,255,.06);border-radius:16px}.editorial-content h2{margin:25px 0 10px}.editorial-content h3{margin:18px 0 8px}.editorial-content p{margin:0 0 15px}
