/* qrkode.no — monokrom, tool-first design */

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

:root {
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --bg: #FAFAFA;
    --surface: #FFFFFF;
    --btn-primary: #111827;
    --btn-primary-hover: #374151;
    --focus: #2563EB;
    --error: #DC2626;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* Header */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
}

.header-inner {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.header-sub {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Hero */
.hero {
    text-align: center;
    padding: 48px 24px 32px;
}

h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.hero-sub {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.usp-pill {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 14px;
}

/* Generator card */
.generator-card {
    max-width: 900px;
    margin: 0 auto 48px;
    padding: 0 24px;
}

.generator-grid {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: 560px;
    margin: 0 auto;
}

/* Type tabs */
.type-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    margin-bottom: 24px;
    scrollbar-width: none;
}

.type-tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    background: #F3F4F6;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    min-height: 44px;
}

.tab:hover {
    background: #E5E7EB;
}

.tab.active {
    background: var(--text-primary);
    color: var(--surface);
}

.tab:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* Input fields */
.field-group {
    display: none;
}

.field-group.active {
    display: block;
}

.field-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    margin-top: 16px;
}

.field-group label:first-child {
    margin-top: 0;
}

.field-group input[type="text"],
.field-group input[type="url"],
.field-group input[type="email"],
.field-group input[type="tel"],
.field-group textarea,
.field-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--surface);
    transition: border-color 0.15s;
}

.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus {
    outline: none;
    border-color: var(--text-primary);
}

.field-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* Customization */
.customize-section {
    margin-top: 24px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.customize-section summary {
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
}

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

.customize-section summary::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    transition: transform 0.2s;
}

.customize-section[open] summary::after {
    transform: rotate(180deg);
}

.customize-fields {
    padding-top: 16px;
}

.color-row {
    display: flex;
    gap: 16px;
}

.color-field {
    flex: 1;
}

.color-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.color-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="color"] {
    width: 44px;
    height: 44px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    padding: 4px;
    background: none;
}

.hex-input {
    width: 90px;
    padding: 8px 10px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.8125rem;
    font-family: monospace;
    color: var(--text-primary);
}

.hex-input:focus {
    outline: none;
    border-color: var(--text-primary);
}

.size-field {
    margin-top: 16px;
}

.size-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
    border: none;
}

/* Preview */
.generator-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.preview-box {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.preview-box.has-qr {
    border-style: solid;
    border-color: var(--border);
}

.preview-box canvas,
.preview-box img {
    max-width: 100%;
    max-height: 100%;
}

.preview-placeholder {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
    padding: 20px;
}

.download-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
}

.btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    text-align: center;
    min-height: 44px;
}

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

.btn:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--btn-primary);
    color: var(--surface);
    border: none;
}

.btn-primary:hover:not(:disabled) {
    background: var(--btn-primary-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1.5px solid var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: #F3F4F6;
}

/* USP section */
.usp-section {
    max-width: 900px;
    margin: 0 auto 64px;
    padding: 0 24px;
}

.usp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.usp-card {
    padding: 24px;
    background: var(--surface);
    border-radius: 12px;
    text-align: center;
}

.usp-icon {
    margin-bottom: 12px;
}

.usp-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.usp-card p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* SEO content */
.seo-content {
    max-width: 680px;
    margin: 0 auto 64px;
    padding: 0 24px;
}

.seo-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 48px;
    margin-bottom: 16px;
}

.seo-content h2:first-child {
    margin-top: 0;
}

.seo-content p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.seo-content ul,
.seo-content ol {
    color: var(--text-secondary);
    padding-left: 20px;
    margin-bottom: 16px;
}

.seo-content li {
    margin-bottom: 8px;
}

/* How-to steps */
.how-to-steps {
    list-style: none;
    padding-left: 0;
    counter-reset: step;
}

.how-to-steps li {
    counter-increment: step;
    padding-left: 48px;
    position: relative;
    margin-bottom: 20px;
}

.how-to-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--text-primary);
    color: var(--surface);
    font-weight: 700;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.how-to-steps li strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.how-to-steps li p {
    margin-bottom: 0;
}

/* FAQ */
.faq-list {
    margin-top: 16px;
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-item summary {
    padding: 16px 0;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
}

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

.faq-item summary::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-left: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
    transform: rotate(180deg);
}

.faq-item p {
    padding-bottom: 16px;
    color: var(--text-secondary);
}

/* Footer */
footer {
    background: #F3F4F6;
    padding: 48px 24px;
}

.footer-inner {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}

.footer-heading {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-bottom: 24px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
}

.footer-links a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-copy a {
    color: var(--text-muted);
    text-decoration: underline;
}

/* Mobile */
@media (max-width: 768px) {
    header {
        height: 56px;
    }

    .header-sub {
        display: none;
    }

    h1 {
        font-size: 1.5rem;
    }

    .hero {
        padding: 32px 16px 24px;
    }

    .generator-card {
        padding: 0 16px;
    }

    .generator-grid {
        padding: 20px;
        box-shadow: none;
        border: 1px solid var(--border);
    }

    .preview-box {
        width: 100%;
        max-width: 280px;
    }

    .download-buttons {
        max-width: 100%;
        flex-direction: column;
    }

    .usp-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .seo-content h2 {
        font-size: 1.25rem;
        margin-top: 36px;
    }
}

@media (min-width: 769px) {
    header {
        height: 64px;
    }
}
