/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-primary-light: #dbeafe;
    --color-text: #1e293b;
    --color-text-light: #64748b;
    --color-bg: #ffffff;
    --color-bg-alt: #f8fafc;
    --color-border: #e2e8f0;
    --color-success: #16a34a;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,.1);
    --max-width: 1140px;
    --transition: .2s ease;
}

html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; color: var(--color-text); line-height: 1.6; background: var(--color-bg); }
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-primary-dark); }
img { max-width: 100%; height: auto; }
ul, ol { list-style: none; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }
.text-center { text-align: center; }

/* === Header & Nav === */
.header { background: var(--color-bg); border-bottom: 1px solid var(--color-border); position: sticky; top: 0; z-index: 100; }
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: .5rem; font-size: 1.35rem; font-weight: 700; color: var(--color-text); }
.logo:hover { color: var(--color-primary); }
.logo svg { color: var(--color-primary); }

.nav-menu { display: flex; align-items: center; gap: .25rem; }
.nav-link { display: flex; align-items: center; gap: .25rem; padding: .5rem .75rem; border-radius: var(--radius); color: var(--color-text); font-size: .925rem; font-weight: 500; transition: background var(--transition); }
.nav-link:hover { background: var(--color-bg-alt); color: var(--color-primary); }

.nav-dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 220px; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .5rem 0; z-index: 50; }
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a { display: block; padding: .5rem 1rem; color: var(--color-text); font-size: .9rem; transition: background var(--transition); }
.dropdown-menu a:hover { background: var(--color-primary-light); color: var(--color-primary); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: .5rem; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--color-text); margin: 5px 0; transition: var(--transition); border-radius: 2px; }

/* === Hero === */
.hero { background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%); color: #fff; padding: 4rem 0; text-align: center; }
.hero h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 1rem; line-height: 1.2; }
.hero-subtitle { font-size: 1.15rem; opacity: .9; max-width: 640px; margin: 0 auto; }
.hero-sm { padding: 2.5rem 0; }
.hero-sm h1 { font-size: 2rem; }

/* === Sections === */
.section { padding: 4rem 0; }
.section-alt { background: var(--color-bg-alt); }
.section-title { font-size: 1.75rem; font-weight: 700; text-align: center; margin-bottom: 2.5rem; }

/* === Generator Grid (Homepage) === */
.generator-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.5rem; }
.generator-card { display: block; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.75rem; transition: transform var(--transition), box-shadow var(--transition); color: var(--color-text); }
.generator-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: var(--color-text); }
.card-icon { font-size: 2rem; margin-bottom: .75rem; }
.generator-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: .5rem; }
.generator-card p { font-size: .9rem; color: var(--color-text-light); }

/* === Features Grid === */
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2rem; }
.feature { text-align: center; padding: 1.5rem; }
.feature h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: .5rem; }
.feature p { font-size: .9rem; color: var(--color-text-light); }

/* === Steps === */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; text-align: center; }
.step-number { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; background: var(--color-primary); color: #fff; border-radius: 50%; font-size: 1.25rem; font-weight: 700; margin-bottom: 1rem; }
.step h3 { margin-bottom: .5rem; }
.step p { font-size: .9rem; color: var(--color-text-light); }

/* === Generator Layout === */
.generator-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.generator-form { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 2rem; }
.generator-preview { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 2rem; text-align: center; min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: sticky; top: 80px; }
.preview-placeholder { color: var(--color-text-light); font-size: .95rem; }
.generator-preview svg { max-width: 100%; height: auto; width: 100%; }
.qr-result { width: 100%; max-width: 300px; }
.download-buttons { display: flex; gap: .75rem; margin-top: 1.25rem; flex-wrap: wrap; justify-content: center; }

/* === Forms === */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: .4rem; }
.form-control { width: 100%; padding: .65rem .85rem; border: 1px solid var(--color-border); border-radius: var(--radius); font-size: .95rem; transition: border-color var(--transition); background: var(--color-bg); color: var(--color-text); font-family: inherit; }
.form-control:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
textarea.form-control { resize: vertical; }
select.form-control { cursor: pointer; }
.form-hint { display: block; font-size: .8rem; color: var(--color-text-light); margin-top: .3rem; }
.form-check { display: flex; align-items: center; }
.form-check label { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-weight: 400; }
.form-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--color-primary); cursor: pointer; }

/* === Buttons === */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: .7rem 1.5rem; border-radius: var(--radius); font-size: .95rem; font-weight: 600; cursor: pointer; border: none; transition: background var(--transition), transform var(--transition); font-family: inherit; text-decoration: none; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); color: #fff; }
.btn-secondary { background: var(--color-bg-alt); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-secondary:hover { background: var(--color-border); color: var(--color-text); }
.btn-block { width: 100%; }
.btn:active { transform: scale(.98); }
.btn-sm { padding: .45rem 1rem; font-size: .85rem; }

/* === Content Text (SEO Pages) === */
.content-text { max-width: 800px; margin: 0 auto; }
.content-text h2 { font-size: 1.5rem; font-weight: 700; margin: 2.5rem 0 1rem; padding-top: 1rem; }
.content-text h2:first-child { margin-top: 0; }
.content-text h3 { font-size: 1.2rem; font-weight: 600; margin: 1.5rem 0 .75rem; }
.content-text p { margin-bottom: 1rem; color: var(--color-text); }
.content-text ul, .content-text ol { margin: 1rem 0; padding-left: 1.5rem; }
.content-text ul { list-style: disc; }
.content-text ol { list-style: decimal; }
.content-text li { margin-bottom: .5rem; line-height: 1.6; }

/* === TOC === */
.toc { background: var(--color-bg-alt); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.5rem 2rem; margin-bottom: 2rem; }
.toc h3 { font-size: 1rem; font-weight: 600; margin-bottom: .75rem; }
.toc ol { padding-left: 1.25rem; list-style: decimal; }
.toc li { margin-bottom: .35rem; }
.toc a { font-size: .9rem; }

/* === CTA Box === */
.cta-box { background: linear-gradient(135deg, #1e3a8a, #2563eb); color: #fff; border-radius: var(--radius-lg); padding: 2.5rem; text-align: center; margin-top: 3rem; }
.cta-box h3 { font-size: 1.3rem; margin-bottom: .5rem; }
.cta-box p { opacity: .9; margin-bottom: 1.25rem; }
.cta-box .btn-primary { background: #fff; color: var(--color-primary); }
.cta-box .btn-primary:hover { background: var(--color-primary-light); }

/* === Footer === */
.footer { background: #0f172a; color: #cbd5e1; padding: 3rem 0 1.5rem; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-col h4 { color: #fff; font-size: 1rem; font-weight: 600; margin-bottom: .75rem; }
.footer-col p { font-size: .9rem; line-height: 1.6; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: .4rem; }
.footer-col a { color: #94a3b8; font-size: .9rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1e293b; padding-top: 1.5rem; text-align: center; font-size: .85rem; }

/* === Loading Spinner === */
.spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid var(--color-border); border-top-color: var(--color-primary); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === Error Message === */
.error-msg { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: 1rem; font-size: .9rem; }

/* === Responsive === */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.75rem; }
    .hero-sm h1 { font-size: 1.5rem; }
    .hero { padding: 2.5rem 0; }
    .section { padding: 2.5rem 0; }

    .generator-layout { grid-template-columns: 1fr; gap: 1.5rem; }
    .generator-preview { position: static; min-height: 200px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }

    .nav-toggle { display: block; }
    .nav-menu { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--color-bg); border-bottom: 1px solid var(--color-border); flex-direction: column; padding: 1rem; box-shadow: var(--shadow-lg); }
    .nav-menu.active { display: flex; }
    .nav-dropdown:hover .dropdown-menu { display: none; }
    .nav-dropdown.active .dropdown-menu { display: block; position: static; box-shadow: none; border: none; padding-left: 1rem; }
    .dropdown-menu a { padding: .4rem 1rem; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.4rem; }
    .footer-grid { grid-template-columns: 1fr; }
    .generator-grid { grid-template-columns: 1fr; }
}
