/* ============================================================
   منصة الأعمال — أدوات مجانية (Free Tools)
   تصميم مستقل يكمّل css/style.css
   ============================================================ */

/* ---------- Tools hub (index) ---------- */
.tools-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff; text-align: center; padding: 70px 0 60px;
}
.tools-hero .badge {
    display: inline-block; background: rgba(255,255,255,.15); color: #fff;
    padding: 6px 18px; border-radius: 30px; font-size: .9rem; font-weight: 700; margin-bottom: 18px;
    backdrop-filter: blur(4px);
}
.tools-hero h1 { font-size: 2.6rem; font-weight: 900; margin-bottom: 14px; }
.tools-hero p { font-size: 1.15rem; opacity: .92; max-width: 680px; margin: 0 auto; }

.tools-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px; margin-top: 10px;
}
.tool-tile {
    background: var(--bg-white); border-radius: 16px; padding: 28px 24px;
    box-shadow: var(--shadow); transition: var(--transition);
    border: 1px solid #edf2f7; position: relative; display: block; text-align: center;
}
.tool-tile:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--secondary); }
.tool-tile .ico {
    width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center; font-size: 1.8rem; color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}
.tool-tile.soon .ico { background: linear-gradient(135deg, #a0aec0, #718096); }
.tool-tile h3 { font-size: 1.25rem; margin-bottom: 8px; color: var(--text-dark); }
.tool-tile p { color: var(--text-light); font-size: .95rem; }
.tool-tile .soon-tag {
    position: absolute; top: 14px; left: 14px; background: #edf2f7; color: var(--text-light);
    font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 20px;
}
.tool-tile.live .soon-tag { background: #e6fffa; color: var(--primary-dark); }

/* ---------- QR generator layout ---------- */
.qr-hero { text-align: center; padding: 48px 0 24px; }
.qr-hero .kicker { color: var(--secondary); font-weight: 800; letter-spacing: .5px; }
.qr-hero h1 { font-size: 2.2rem; font-weight: 900; margin: 8px 0 10px; }
.qr-hero h1 span { color: var(--primary); }
.qr-hero p { color: var(--text-light); max-width: 640px; margin: 0 auto; font-size: 1.05rem; }
.qr-trust { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.qr-trust span { color: var(--text-light); font-size: .9rem; font-weight: 600; }
.qr-trust i { color: var(--primary); margin-left: 6px; }

.qr-app {
    display: grid; grid-template-columns: 1.15fr .85fr; gap: 30px;
    align-items: start; margin: 20px auto 10px;
}
.qr-panel {
    background: var(--bg-white); border-radius: 18px; box-shadow: var(--shadow);
    padding: 26px; border: 1px solid #edf2f7;
}
.qr-panel h2 { font-size: 1.15rem; margin-bottom: 16px; color: var(--text-dark); display: flex; align-items: center; gap: 8px; }
.qr-panel h2 i { color: var(--primary); }

/* type tabs */
.qr-types { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.qr-type {
    border: 1.5px solid #e2e8f0; background: #fff; border-radius: 10px; padding: 9px 13px;
    cursor: pointer; font-weight: 700; font-size: .85rem; color: var(--text-dark);
    display: flex; align-items: center; gap: 6px; transition: var(--transition); position: relative;
}
.qr-type i { font-size: .95rem; }
.qr-type:hover { border-color: var(--primary); }
.qr-type.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.qr-type .lock { font-size: .72rem; color: var(--secondary); }
.qr-type.active .lock { color: #ffe; }

/* fields */
.qr-fields .fld { margin-bottom: 14px; }
.qr-fields label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: 6px; color: var(--text-dark); }
.qr-fields input[type=text], .qr-fields input[type=tel], .qr-fields input[type=email],
.qr-fields input[type=url], .qr-fields input[type=number], .qr-fields textarea, .qr-fields select {
    width: 100%; padding: 11px 14px; border: 1.5px solid #e2e8f0; border-radius: 10px;
    font-family: inherit; font-size: .95rem; color: var(--text-dark); background: #fff; transition: var(--transition);
}
.qr-fields input:focus, .qr-fields textarea:focus, .qr-fields select:focus { outline: none; border-color: var(--primary); }
.qr-fields textarea { min-height: 80px; resize: vertical; }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* design controls */
.qr-section-title {
    font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .5px;
    color: var(--text-light); margin: 22px 0 12px; display: flex; align-items: center; gap: 8px;
}
.qr-section-title::after { content: ''; flex: 1; height: 1px; background: #edf2f7; }

.ctrl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ctrl { display: flex; flex-direction: column; gap: 6px; }
.ctrl > span { font-weight: 700; font-size: .82rem; color: var(--text-dark); }
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type=color] {
    width: 46px; height: 38px; border: 1.5px solid #e2e8f0; border-radius: 8px; padding: 2px; cursor: pointer; background: #fff;
}
.color-row .hex { font-family: 'Inter', monospace; font-size: .85rem; color: var(--text-light); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; font-size: .85rem; }
.switch input { display: none; }
.switch .track { width: 42px; height: 24px; background: #cbd5e0; border-radius: 20px; position: relative; transition: var(--transition); }
.switch .track::before { content: ''; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: var(--transition); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::before { right: 21px; }

/* preset themes */
.presets { display: flex; gap: 10px; flex-wrap: wrap; }
.preset { width: 38px; height: 38px; border-radius: 10px; cursor: pointer; border: 2px solid transparent; box-shadow: var(--shadow); }
.preset:hover, .preset.active { border-color: var(--text-dark); transform: scale(1.06); }

/* logo upload */
.logo-drop {
    border: 2px dashed #cbd5e0; border-radius: 12px; padding: 16px; text-align: center;
    cursor: pointer; color: var(--text-light); transition: var(--transition); font-size: .9rem;
}
.logo-drop:hover { border-color: var(--primary); color: var(--primary); }
.logo-drop i { font-size: 1.4rem; display: block; margin-bottom: 6px; }
.logo-preview { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.logo-preview img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; border: 1px solid #edf2f7; }
.logo-preview button { background: none; border: none; color: #e53e3e; cursor: pointer; font-weight: 700; font-size: .85rem; }

/* ---------- preview side ---------- */
.qr-preview-wrap { position: sticky; top: 100px; }
.qr-stage {
    background:
        linear-gradient(45deg, #eef2f6 25%, transparent 25%),
        linear-gradient(-45deg, #eef2f6 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #eef2f6 75%),
        linear-gradient(-45deg, transparent 75%, #eef2f6 75%);
    background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0;
    background-color: #fff;
    border-radius: 16px; padding: 24px; display: flex; align-items: center; justify-content: center;
    min-height: 280px; border: 1px solid #e2e8f0;
}
#qrPreview canvas, #qrPreview svg { max-width: 100%; height: auto !important; border-radius: 6px; }

.qr-export { margin-top: 18px; }
.export-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.btn-dl {
    display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px;
    border-radius: 10px; font-weight: 800; cursor: pointer; border: none; font-family: inherit; font-size: .95rem;
    transition: var(--transition);
}
.btn-dl.png { background: var(--primary); color: #fff; }
.btn-dl.png:hover { background: var(--primary-dark); }
.btn-dl.svg { background: #edf2f7; color: var(--text-dark); }
.btn-dl.svg:hover { background: #e2e8f0; }

.size-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.size-row label { font-weight: 700; font-size: .85rem; white-space: nowrap; }
.size-row select { flex: 1; padding: 9px 12px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-family: inherit; }

/* WhatsApp print bridge CTA */
.print-bridge {
    margin-top: 16px; background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    border-radius: 14px; padding: 18px; color: #fff; text-align: center;
}
.print-bridge h4 { font-size: 1.05rem; margin-bottom: 6px; }
.print-bridge p { font-size: .85rem; opacity: .92; margin-bottom: 12px; }
.print-bridge a {
    display: inline-flex; align-items: center; gap: 8px; background: #fff; color: #128c7e;
    padding: 11px 22px; border-radius: 30px; font-weight: 800; font-size: .9rem;
}

/* register notice */
.reg-notice {
    margin-top: 16px; background: #fffaf2; border: 1.5px solid #ffe1bf; border-radius: 14px;
    padding: 16px 18px; text-align: center;
}
.reg-notice i.crown { color: var(--secondary); font-size: 1.4rem; }
.reg-notice p { font-size: .9rem; color: var(--text-dark); margin: 8px 0 12px; line-height: 1.7; }
.reg-notice .reg-btn {
    background: var(--secondary); color: #fff; border: none; padding: 11px 26px; border-radius: 30px;
    font-weight: 800; cursor: pointer; font-family: inherit; font-size: .92rem; transition: var(--transition);
}
.reg-notice .reg-btn:hover { background: var(--secondary-dark); transform: translateY(-2px); }
.reg-notice.hidden { display: none; }

.quota-pill {
    display: inline-flex; align-items: center; gap: 6px; background: #edf2f7; color: var(--text-light);
    padding: 5px 12px; border-radius: 20px; font-size: .8rem; font-weight: 700; margin-top: 6px;
}

/* locked state */
.lockwrap { position: relative; }
.lockwrap.is-locked { opacity: .55; pointer-events: none; filter: grayscale(.4); }
.lockwrap .lock-overlay {
    display: none; position: absolute; inset: 0; align-items: center; justify-content: center;
    background: rgba(255,255,255,.4); border-radius: 10px; pointer-events: auto; cursor: pointer; z-index: 2;
}
.lockwrap.is-locked .lock-overlay { display: flex; }
.lockwrap .lock-overlay span {
    background: var(--text-dark); color: #fff; padding: 6px 14px; border-radius: 20px;
    font-size: .8rem; font-weight: 800;
}

/* cross-sell strip */
.qr-cross {
    margin: 50px auto; background: var(--bg-dark); border-radius: 20px; padding: 44px 30px;
    color: #fff; text-align: center; position: relative; overflow: hidden;
}
.qr-cross::before {
    content: ''; position: absolute; top: -40%; left: -10%; width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(0,150,166,.4), transparent 70%); filter: blur(20px);
}
.qr-cross h2 { font-size: 1.8rem; font-weight: 900; margin-bottom: 12px; position: relative; }
.qr-cross h2 span { color: var(--secondary); }
.qr-cross p { opacity: .85; max-width: 620px; margin: 0 auto 26px; position: relative; }
.cross-items { display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; position: relative; }
.cross-item { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cross-item .ci-ico { width: 60px; height: 60px; border-radius: 16px; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--secondary); }
.cross-item strong { font-size: .95rem; }
.cross-item small { color: #cbd5e0; }

/* mini FAQ */
.qr-faq { max-width: 820px; margin: 0 auto 60px; }
.qr-faq h2 { text-align: center; font-size: 1.8rem; color: var(--primary); margin-bottom: 28px; font-weight: 800; }
.qr-faq details {
    background: var(--bg-white); border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 12px;
    padding: 16px 20px; border: 1px solid #edf2f7;
}
.qr-faq summary { font-weight: 800; cursor: pointer; color: var(--text-dark); list-style: none; }
.qr-faq summary::-webkit-details-marker { display: none; }
.qr-faq summary::before { content: '\002B'; color: var(--primary); font-weight: 900; margin-left: 10px; }
.qr-faq details[open] summary::before { content: '\2212'; }
.qr-faq p { color: var(--text-light); margin-top: 12px; line-height: 1.8; }

/* account link in header */
.acct-link {
    background: none; border: 1px solid var(--primary); color: var(--primary); cursor: pointer;
    padding: 6px 14px; border-radius: 20px; font-weight: 700; font-family: inherit; font-size: .9rem;
    display: inline-flex; align-items: center; gap: 6px; transition: var(--transition);
}
.acct-link:hover { background: var(--primary); color: #fff; }

/* ---------- auth modal (injected by /store/auth.js) ---------- */
.auth-modal { position: fixed; inset: 0; background: rgba(26,32,44,.6); z-index: 3000; align-items: center; justify-content: center; padding: 20px; }
.auth-card { background: #fff; border-radius: 18px; padding: 30px; width: 100%; max-width: 380px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.auth-x { position: absolute; top: 14px; left: 18px; background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--text-light); line-height: 1; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.atab { flex: 1; padding: 10px; border: none; background: #edf2f7; border-radius: 10px; font-weight: 800; cursor: pointer; font-family: inherit; color: var(--text-light); transition: var(--transition); }
.atab.active { background: var(--primary); color: #fff; }
.auth-form label { display: block; font-weight: 700; font-size: .85rem; margin: 12px 0 5px; }
.auth-form input { width: 100%; padding: 11px 14px; border: 1.5px solid #e2e8f0; border-radius: 10px; font-family: inherit; font-size: .95rem; }
.auth-form input:focus { outline: none; border-color: var(--primary); }
.auth-btn { width: 100%; margin-top: 18px; padding: 13px; background: var(--secondary); color: #fff; border: none; border-radius: 10px; font-weight: 800; font-size: 1rem; cursor: pointer; font-family: inherit; transition: var(--transition); }
.auth-btn:hover { background: var(--secondary-dark); }
.auth-msg { font-size: .85rem; margin-top: 12px; text-align: center; color: var(--text-light); min-height: 18px; }
.auth-msg.err { color: #e53e3e; }
.auth-msg.ok { color: #25855a; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .qr-app { grid-template-columns: 1fr; }
    .qr-preview-wrap { position: static; order: -1; }
    .tools-hero h1 { font-size: 2rem; }
    .qr-hero h1 { font-size: 1.7rem; }
}
@media (max-width: 480px) {
    .ctrl-grid, .fld-row, .export-row { grid-template-columns: 1fr; }
    .qr-panel { padding: 18px; }
}
