* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #334155;
    --background: #ffffff;
    --surface: #f8fafc;
    --border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.18);
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background:
        radial-gradient(1200px 500px at 10% -10%, rgba(255, 255, 255, 0.28), transparent 50%),
        linear-gradient(145deg, #4f46e5 0%, #2563eb 48%, #7c3aed 100%);
    color: var(--text-primary);
    line-height: 1.55;
    min-height: 100vh;
    padding: 40px 20px;
}

.container {
    background: var(--background);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    max-width: 1080px;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

header {
    padding: 32px 40px 4px;
}

.badge {
    display: inline-block;
    margin-bottom: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--text-primary);
}

.tagline {
    margin-top: 8px;
    max-width: 36rem;
    font-size: 1.02rem;
    color: var(--text-secondary);
}

main {
    padding: 28px 40px 12px;
}

.generator-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: stretch;
}

.input-section,
.output-section {
    background: var(--surface);
    padding: 24px;
    border-radius: 18px;
    border: 1px solid var(--border);
}

.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 22px;
    padding: 5px;
    background: #eef2ff;
    border-radius: 12px;
}

.tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 8px;
    font-size: 0.92rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 9px;
    transition: all 0.2s ease;
    font-weight: 600;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.86rem;
}

.input-field {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.98rem;
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.input-field:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.textarea {
    min-height: 100px;
    resize: vertical;
}

.color-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.color-row .form-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0;
}

.color-row label {
    margin-bottom: 0;
}

.color-input {
    width: 44px;
    height: 36px;
    padding: 3px;
    cursor: pointer;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    flex-shrink: 0;
}

.options-section {
    margin-top: 8px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.generate-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 650;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    margin-top: 8px;
}

.generate-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.generate-btn:active {
    transform: translateY(0);
}

.output-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.qr-display {
    background: white;
    padding: 28px;
    border-radius: 16px;
    border: 1px dashed #cbd5e1;
    margin-bottom: 16px;
    min-height: 320px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-display canvas,
.qr-display img {
    max-width: 100%;
    height: auto;
}

.placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.placeholder svg {
    margin-bottom: 12px;
}

.placeholder p {
    font-size: 0.92rem;
}

.action-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
}

.action-btn {
    flex: 1;
    padding: 12px;
    background: white;
    color: var(--secondary-color);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.94rem;
    font-weight: 650;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover:not(:disabled) {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.info-section {
    margin-top: 28px;
    padding: 8px 0 20px;
    border-top: 1px solid var(--border);
}

.section-kicker {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-top: 18px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding-top: 22px;
}

.step {
    padding: 4px 8px 0 0;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-bottom: 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: var(--primary-color);
    font-size: 0.82rem;
    font-weight: 700;
}

.step h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.step p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.site-footer {
    padding: 0 40px 28px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-bottom: 10px;
}

.footer-links a,
.doc-main a,
.back-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.footer-links a:hover,
.doc-main a:hover,
.back-link:hover {
    text-decoration: underline;
}

.seo-section {
    margin-top: 8px;
    padding: 8px 0 12px;
}

.seo-section h2 {
    font-size: 1.25rem;
    margin: 22px 0 10px;
}

.seo-section p,
.seo-section li,
.doc-main p,
.doc-main li {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.seo-section ul,
.doc-main ul {
    padding-left: 1.2rem;
    margin-bottom: 12px;
}

.seo-section strong,
.doc-main strong {
    color: var(--text-primary);
}

.faq {
    display: grid;
    gap: 8px;
}

.faq details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
}

.faq summary {
    cursor: pointer;
    font-weight: 650;
    list-style: none;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq details p {
    margin: 8px 0 2px;
}

.doc-container header.doc-header,
.doc-header {
    padding: 32px 40px 0;
}

.back-link {
    display: inline-block;
    margin-bottom: 16px;
    font-size: 0.88rem;
}

.doc-main {
    padding: 20px 40px 12px;
}

.doc-main h2 {
    font-size: 1.15rem;
    margin: 22px 0 8px;
}

.doc-main ol {
    padding-left: 1.2rem;
    margin: 0 0 12px;
}

.doc-main li {
    margin-bottom: 6px;
}

.doc-main code {
    font-size: 0.88em;
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 6px;
}

@media (max-width: 860px) {
    .generator-section,
    .steps {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    body {
        padding: 12px;
    }

    header,
    main,
    footer,
    .site-footer,
    .doc-header,
    .doc-main {
        padding-left: 18px;
        padding-right: 18px;
    }

    header {
        padding-top: 24px;
    }

    .logo {
        font-size: 1.7rem;
    }

    .generator-section,
    .steps,
    .color-row {
        grid-template-columns: 1fr;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .input-section,
    .output-section {
        padding: 18px;
    }
}
