:root {
  --white:   #ffffff;
  --black:   #111111;
  --yellow:  #f5c400;
  --blue:    #11559b;
  --blue-lt: #e8f0fb;
  --blue-md: #c4d8f5;
  --yellow-lt: #fff9e0;
  --gray-50:  #f8f9fc;
  --gray-100: #f0f2f7;
  --gray-200: #e2e6ef;
  --gray-400: #9ba3b8;
  --gray-600: #5a637a;
  --shadow-sm: 0 1px 4px rgba(17,85,155,0.07);
  --shadow-md: 0 4px 20px rgba(17,85,155,0.10);
  --shadow-lg: 0 16px 48px rgba(17,85,155,0.14);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
}
 

 
.qr-wrap {
 
  background: var(--gray-50);
  color: var(--black);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
 
/* TOP NAV */
.topbar {
  width: 100%;
  background: var(--white);
  border-bottom: 3px solid var(--yellow);
  padding: 0 40px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 16px rgba(17,85,155,0.08);
}
 
.topbar-logo img { height: 36px; display: block; }
 
.logo-fallback {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -0.02em;
}
.logo-fallback i { color: var(--yellow); }
 
.topbar-right { display: flex; align-items: center; gap: 12px; }
 
.tool-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: -0.01em;
}
 
.tool-badge {
  background: var(--blue);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  display: flex;
  align-items: center;
  gap: 5px;
}
 
/* PAGE */
.page {
  width: 100%;
  max-width: 1060px;
  padding: 36px 24px 60px;
}
 
/* HERO */
.hero {
    background: linear-gradient(108deg, var(--blue) 0%, #1764b8 100%);
    border-radius: var(--radius-lg);
    padding: 9px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    overflow: hidden;
    position: relative;
    margin-top: 40px;    padding-bottom: 31px;
}
.hero::before {
  content: '';
  position: absolute;
  right: -30px; top: -50px;
  width: 280px; height: 280px;
  background: rgba(245,196,0,0.10);
  border-radius: 50%;
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  right: 80px; bottom: -70px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  pointer-events: none;
}
.hero-text h1 {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 0;
}
.hero-text h1 em { font-style: normal; color: var(--yellow); }
.hero-text p { margin-top: 7px; font-size: 13.5px; color: rgba(255,255,255,0.68); }
.hero-chips { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.hero-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--white);
  font-size: 11.5px; font-weight: 500;
  padding: 5px 12px; border-radius: 100px;
}
.hero-chip i { font-size: 9px; color: var(--yellow); }
.hero-icon { position: relative; z-index: 1; flex-shrink: 0; }
.hero-icon i { font-size: 90px; color: rgba(255,255,255,0.12); }
 
/* MAIN CARD */
.main-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: grid;
    grid-template-columns: 730px 1fr;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    margin-bottom: 50px;
}
 
/* LEFT PANEL */
.panel-left { padding: 32px 30px; border-right: 1px solid var(--gray-200); }
 
.sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; }
.sec-icon {
  width: 28px; height: 28px;
  background: var(--blue-lt); color: var(--blue);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0;
}
.sec-label {
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--blue);
    /* font-family: 'JetBrains Mono', monospace; */
}
 
/* Type tabs */
.type-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.type-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 26px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-600);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.16s;
}
.type-tab i {
    font-size: 18px;
}
.type-tab:hover { border-color: var(--blue-md); background: var(--blue-lt); color: var(--blue); }
.type-tab.active { border-color: var(--blue); background: var(--blue); color: var(--white); }
 
/* Fields */
.field-wrap { margin-bottom: 13px; }
.field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16.5px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 6px;
}
.field-label i { font-size: 10px; color: var(--blue); }
.field-wrap input,
.field-wrap textarea,
.field-wrap select {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  
  font-size: 13.5px; color: var(--black);
  background: var(--white); outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
  -webkit-appearance: none;
}
.field-wrap textarea { resize: vertical; min-height: 78px; }
.field-wrap input:focus,
.field-wrap textarea:focus,
.field-wrap select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(17,85,155,0.09);
}
.field-wrap input::placeholder,
.field-wrap textarea::placeholder { color: var(--gray-400); }
 
.divider { height: 1px; background: var(--gray-200); margin: 18px 0; }
 
/* Color pickers */
.color-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.clr-field-lbl {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.clr-field-lbl i { font-size: 9px; color: var(--blue); }
.clr-wrap {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.16s, box-shadow 0.16s;
  background: var(--white); position: relative;
}
.clr-wrap:hover { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(17,85,155,0.08); }
.clr-swatch { width: 24px; height: 24px; border-radius: 6px; border: 1.5px solid var(--gray-200); flex-shrink: 0; }
.clr-hex { font-size: 12px; font-family: 'JetBrains Mono', monospace; font-weight: 500; color: var(--black); }
.clr-wrap input[type="color"] { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }
 
/* Presets */
.presets-grid { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 18px; }
.preset {
  width: 30px; height: 30px; border-radius: 8px;
  border: 2px solid transparent; cursor: pointer;
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
  box-shadow: var(--shadow-sm); flex-shrink: 0;
}
.preset:hover { transform: scale(1.18); box-shadow: var(--shadow-md); }
.preset.active { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(17,85,155,0.18); }
 
/* Slider */
.slider-row {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.slider-lbl { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--gray-600); }
.slider-lbl i { font-size: 10px; color: var(--blue); }
.slider-val-badge {
  font-size: 11px; font-family: 'JetBrains Mono', monospace; font-weight: 600;
  color: var(--blue); background: var(--blue-lt); padding: 3px 10px; border-radius: 6px;
}
input[type="range"] {
  -webkit-appearance: none; width: 100%; height: 5px;
  background: var(--gray-200); border-radius: 4px; outline: none; margin-bottom: 16px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px;
  background: var(--blue); border: 3px solid var(--white); border-radius: 50%;
  cursor: pointer; box-shadow: 0 2px 8px rgba(17,85,155,0.30);
}
 
/* EC tabs */
.ec-tabs { display: flex; gap: 6px; margin-bottom: 22px; }
.ec-tab {
  flex: 1; padding: 8px 4px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  background: var(--white); color: var(--gray-600);
  font-size: 12px; font-weight: 700; cursor: pointer;
  text-align: center; font-family: 'JetBrains Mono', monospace; transition: all 0.16s;
}
.ec-tab:hover { border-color: var(--blue-md); background: var(--blue-lt); color: var(--blue); }
.ec-tab.active { border-color: var(--yellow); background: var(--yellow); color: var(--black); }
 
/* Generate button */
.gen-btn {
  width: 100%; padding: 15px;
  background: var(--blue); color: var(--white);
  border: none; border-radius: var(--radius-md);
  
  font-size: 15px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: background 0.18s, transform 0.1s, box-shadow 0.18s;
  box-shadow: 0 5px 20px rgba(17,85,155,0.26); letter-spacing: 0.01em;
}
.gen-btn i { font-size: 15px; }
.gen-btn:hover { background: #0d4485; box-shadow: 0 8px 28px rgba(17,85,155,0.36); }
.gen-btn:active { transform: scale(0.98); }
 
/* RIGHT PANEL */
.panel-right {
  background: var(--gray-50); padding: 36px 28px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
}
 
/* QR Stage */
.qr-stage {
  width: 100%; max-width: 270px; aspect-ratio: 1;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 2px solid var(--gray-200);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
  transition: box-shadow 0.3s, border-color 0.3s;
}
.qr-stage.ready {
  border-color: var(--yellow);
  box-shadow: 0 0 0 5px rgba(245,196,0,0.16), var(--shadow-lg);
}
.corner { position: absolute; width: 22px; height: 22px; opacity: 0; transition: opacity 0.3s; }
.corner-tl { top: 10px; left: 10px; border-top: 3px solid var(--blue); border-left: 3px solid var(--blue); border-radius: 5px 0 0 0; }
.corner-tr { top: 10px; right: 10px; border-top: 3px solid var(--blue); border-right: 3px solid var(--blue); border-radius: 0 5px 0 0; }
.corner-bl { bottom: 10px; left: 10px; border-bottom: 3px solid var(--blue); border-left: 3px solid var(--blue); border-radius: 0 0 0 5px; }
.corner-br { bottom: 10px; right: 10px; border-bottom: 3px solid var(--blue); border-right: 3px solid var(--blue); border-radius: 0 0 5px 0; }
.qr-stage.ready .corner { opacity: 1; }
 
.qr-placeholder { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px; }
.qr-placeholder i { font-size: 68px; color: var(--gray-200); }
.qr-placeholder p { font-size: 12px; color: var(--gray-400); text-align: center; font-weight: 500; line-height: 1.5; }
 
/* Canvas wrapper — hidden until QR generated */
#qrOutput { display: none; align-items: center; justify-content: center; width: 100%; height: 100%; }
 
/* Stats */
.stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  width: 100%; max-width: 270px; margin-top: 18px;
  opacity: 0; transform: translateY(6px); transition: opacity 0.3s, transform 0.3s;
}
.stats-grid.visible { opacity: 1; transform: translateY(0); }
.stat-card { background: var(--white); border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); padding: 12px 14px; text-align: center; }
.stat-val { font-size: 17px; font-weight: 800; font-family: 'JetBrains Mono', monospace; color: var(--blue); }
.stat-lbl { font-size: 9.5px; font-weight: 700; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.07em; margin-top: 3px; }
 
/* Download row */
.dl-row {
  display: flex; gap: 8px; width: 100%; max-width: 270px; margin-top: 14px;
  opacity: 0; transition: opacity 0.3s 0.15s;
}
.dl-row.visible { opacity: 1; }
.dl-btn {
  flex: 1; padding: 10px 8px; border-radius: var(--radius-sm);
   font-size: 12px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.16s; border: 1.5px solid transparent;
}
.dl-btn i { font-size: 11px; }
.dl-btn.dl-yellow { background: var(--yellow); color: var(--black); border-color: var(--yellow); }
.dl-btn.dl-yellow:hover { background: #e0b200; box-shadow: 0 4px 14px rgba(245,196,0,0.40); }
.dl-btn.dl-blue { background: var(--white); color: var(--blue); border-color: var(--blue); }
.dl-btn.dl-blue:hover { background: var(--blue-lt); }
.dl-btn.dl-gray { background: var(--white); color: var(--gray-600); border-color: var(--gray-200); }
.dl-btn.dl-gray:hover { border-color: var(--blue-md); color: var(--blue); background: var(--blue-lt); }
 
/* Toast */
.toast {
  position: fixed; bottom: 28px; right: 28px;
  background: var(--blue); color: var(--white);
  padding: 12px 18px; border-radius: 12px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  opacity: 0; transform: translateY(10px); transition: all 0.25s;
  z-index: 200; box-shadow: 0 8px 24px rgba(17,85,155,0.28); pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast i { color: var(--yellow); }
 
@media (max-width: 780px) {
    /* Mobile Color Picker Fix */
.clr-wrap {
  position: relative;
  cursor: pointer;
}
.clr-wrap input[type="color"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
  /* Make it tappable on mobile */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  z-index: 2;
}
  .main-card { grid-template-columns: 1fr; }
  .panel-left { border-right: none; border-bottom: 1px solid var(--gray-200); }
  .hero { flex-direction: column; align-items: flex-start; gap: 14px; padding: 26px 22px; }
  .hero-icon { display: none; }
  .topbar { padding: 0 20px; }
  .page { padding: 22px 16px 48px; }
}