/* ============================================================
   QR Generátor – Főstílus v2.1 (javított)
   ============================================================ */
:root {
  --blue:   #2563eb;
  --sky:    #0ea5e9;
  --green:  #22c55e;
  --red:    #ef4444;
  --orange: #f59e0b;
  --bg:     #f0f4f8;
  --surf:   #ffffff;
  --bdr:    #e2e8f0;
  --txt:    #1e293b;
  --muted:  #64748b;
  --r:      12px;
  --sh:     0 2px 16px rgba(0,0,0,.08);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--txt);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== HEADER ===== */
.site-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #0284c7 100%);
  color: #fff;
  padding: 14px 0;
  box-shadow: 0 3px 12px rgba(0,0,0,.25);
  flex-shrink: 0;
}
.hdr-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.hdr-brand { display: flex; align-items: center; gap: 14px; }
.hdr-brand > i { font-size: 2rem; }
.hdr-title { font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.hdr-sub   { font-size: .75rem; opacity: .75; }
.btn-admin {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  color: #fff !important;
  padding: 8px 18px; border-radius: 8px;
  font-size: .88rem;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none !important;
  transition: background .2s;
}
.btn-admin:hover { background: rgba(255,255,255,.3); }

/* ===== MAIN WRAP ===== */
.main-wrap {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 24px;
}

/* ===== LAYOUT – 3 oszlop ===== */
.layout {
  display: grid;
  grid-template-columns: 1fr 340px 300px;
  gap: 20px;
  align-items: start;
}

/* ===== PANEL ===== */
.panel {
  background: var(--surf);
  border-radius: var(--r);
  box-shadow: var(--sh);
  padding: 24px;
}
.panel-right {
  position: sticky;
  top: 20px;
}

/* ===== SECTION TITLE ===== */
.section-title {
  font-size: .8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); margin-bottom: 12px;
  display: flex; align-items: center; gap: 7px;
}
.section-title i { color: var(--blue); }
.mt16 { margin-top: 16px; }
.mt12 { margin-top: 12px; }
.mt20 { margin-top: 20px; }

/* ===== TYPE GRID ===== */
.type-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.type-btn {
  background: var(--bg);
  border: 2px solid var(--bdr);
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  transition: all .18s;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 64px;
  font-size: .72rem;
  color: var(--muted);
}
.type-btn i { font-size: 1.2rem; }
.type-btn:hover { border-color: var(--blue); color: var(--blue); background: #eff6ff; }
.type-btn.active { border-color: var(--blue); color: var(--blue); background: #dbeafe; font-weight: 700; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: .82rem; font-weight: 600;
  color: var(--muted); margin-bottom: 5px;
}
.form-control {
  width: 100%; padding: 9px 13px;
  border: 1.5px solid var(--bdr); border-radius: 8px;
  font-size: .92rem; color: var(--txt);
  background: var(--surf);
  transition: border-color .2s;
  font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--blue); }
textarea.form-control { resize: vertical; min-height: 75px; }
select.form-control { cursor: pointer; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; min-width: 0; }
.req { color: var(--red); }
.info-tip {
  font-size: .8rem; color: #0369a1;
  background: #e0f2fe; border-radius: 7px;
  padding: 8px 12px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.check-label {
  display: flex; align-items: center; gap: 7px;
  font-size: .88rem; color: var(--muted);
  cursor: pointer; margin-bottom: 8px;
}
.check-label input { cursor: pointer; accent-color: var(--blue); }

/* ===== TYPE FIELDS ===== */
.type-fields {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--bdr);
}
.type-fields.show { display: block; }

/* ===== STYLE GRID ===== */
.style-grid { display: flex; gap: 7px; flex-wrap: wrap; }
.style-opt {
  cursor: pointer;
  border: 2px solid var(--bdr);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: .72rem; color: var(--muted);
  transition: all .18s;
  flex: 1; min-width: 54px;
}
.style-opt input[type="radio"] { display: none; }
.style-opt:hover { border-color: var(--blue); }
.style-opt.active { border-color: var(--blue); background: #dbeafe; color: var(--blue); }

.style-preview {
  width: 40px; height: 40px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 3px; padding: 4px;
}
.style-preview div { background: currentColor; }
.style-square   .style-preview div { border-radius: 1px; }
.style-rounded  .style-preview div { border-radius: 4px; }
.style-circle   .style-preview div { border-radius: 50%; }
.style-gapped   .style-preview div { border-radius: 2px; transform: scale(.75); }
.style-bars     .style-preview div { border-radius: 2px; width: 55%; margin: 0 auto; }

/* ===== COLORS ===== */
.color-row { display: flex; align-items: center; gap: 8px; }
input[type="color"] {
  width: 42px; height: 38px;
  border: 2px solid var(--bdr); border-radius: 7px;
  cursor: pointer; padding: 2px; flex-shrink: 0;
}
.color-text { width: 90px !important; font-family: monospace; font-size: .88rem !important; }

/* ===== ICONS ===== */
.subsect-label { font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.icon-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-opt {
  cursor: pointer;
  border: 2px solid var(--bdr); border-radius: 9px;
  padding: 6px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: .67rem; color: var(--muted);
  transition: all .18s;
  min-width: 56px; text-align: center;
}
.icon-opt input[type="radio"] { display: none; }
.icon-opt img { width: 30px; height: 30px; object-fit: contain; border-radius: 5px; }
.icon-opt:hover { border-color: var(--blue); }
.icon-opt.active { border-color: var(--blue); background: #dbeafe; color: var(--blue); }
.icon-none-box {
  width: 30px; height: 30px; background: var(--bg); border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: .95rem;
}

/* ===== UPLOAD ===== */
.upload-area {
  border: 2px dashed var(--bdr); border-radius: 10px;
  padding: 16px; text-align: center;
  position: relative; cursor: pointer;
  transition: border-color .2s; overflow: hidden;
}
.upload-area:hover { border-color: var(--blue); }
.upload-area input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
}
.upload-inner i { font-size: 1.6rem; color: var(--muted); display: block; margin-bottom: 6px; }
.upload-inner p { font-size: .85rem; color: var(--muted); margin: 0 0 3px; }
.upload-inner small { color: #94a3b8; font-size: .75rem; }
.upload-preview { margin-top: 8px; }
.upload-preview img { max-height: 70px; max-width: 100%; object-fit: contain; border-radius: 6px; }

.slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px;
  background: var(--bdr); border-radius: 3px;
  outline: none; cursor: pointer; margin-top: 6px; display: block;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--blue); cursor: pointer;
}

/* ===== PREVIEW ===== */
.preview-area {
  min-height: 260px; margin-bottom: 16px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.placeholder-state { text-align: center; color: var(--muted); }
.placeholder-qr { width: 130px; height: 130px; margin: 0 auto 14px; opacity: .2; }
.placeholder-qr svg { width: 100%; height: 100%; }
.placeholder-state p { font-size: .88rem; line-height: 1.6; }
.result-label { font-size: .95rem; font-weight: 700; margin-bottom: 12px; text-align: center; word-break: break-word; width: 100%; }
.qr-img-box { text-align: center; margin-bottom: 12px; width: 100%; }
.qr-img-box img { max-width: 100%; border-radius: 10px; box-shadow: 0 2px 14px rgba(0,0,0,.12); }
.result-actions { display: flex; gap: 8px; margin-bottom: 12px; width: 100%; }
.btn-action {
  flex: 1; padding: 9px; border-radius: 8px;
  font-size: .82rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  border: none; text-decoration: none !important;
  transition: opacity .2s; white-space: nowrap;
}
.btn-dl   { background: var(--blue); color: #fff !important; }
.btn-copy { background: var(--bg); color: var(--txt); border: 1.5px solid var(--bdr) !important; }
.btn-action:hover { opacity: .85; }
.result-meta {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-bottom: 10px; justify-content: center; width: 100%;
}
.result-meta span {
  background: var(--bg); border-radius: 5px;
  padding: 3px 8px; font-size: .72rem; color: var(--muted);
  display: flex; align-items: center; gap: 4px;
}
.result-meta strong { color: var(--txt); }
.result-content {
  background: var(--bg); border-radius: 7px;
  padding: 8px 10px; font-size: .75rem;
  word-break: break-all; text-align: center; width: 100%;
}
.result-content code { color: var(--blue); }
.gen-error { text-align: center; color: var(--red); font-size: .88rem; padding: 20px; }

/* ===== GENERATE BUTTON ===== */
.btn-generate {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--blue), var(--sky));
  color: #fff; border: none; border-radius: 10px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: opacity .2s, transform .1s;
}
.btn-generate:hover { opacity: .92; }
.btn-generate:active { transform: scale(.98); }

/* ===== ALERTS ===== */
.alert {
  padding: 11px 14px; border-radius: 8px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 9px; font-size: .88rem;
}
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #22c55e; color: #fff;
  padding: 11px 24px; border-radius: 30px;
  font-size: .88rem; font-weight: 600;
  z-index: 9999; box-shadow: 0 4px 20px rgba(0,0,0,.2);
  opacity: 0; transition: all .3s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== FOOTER ===== */
.site-footer {
  background: #1e293b; color: #94a3b8;
  padding: 16px 0; flex-shrink: 0;
}
.footer-inner {
  max-width: 1400px; margin: 0 auto;
  padding: 0 24px; text-align: center; font-size: .82rem;
}
.muted { color: var(--muted); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr 300px 280px; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .panel-right { position: static; }
}
@media (max-width: 600px) {
  .main-wrap { padding: 12px; }
  .panel { padding: 16px; }
  .type-btn { min-width: 54px; padding: 7px 8px; font-size: .68rem; }
  .hdr-title { font-size: 1.05rem; }
  .hdr-sub { display: none; }
}
