/* ========================================
   Quick QR — Main Styles
   ======================================== */

:root {
    color-scheme: dark;

    --bg: #0b0c12;
    --surface: #12141e;
    --surface-hover: #191c29;
    --surface-soft: #10121b;

    --border: #252837;
    --border-strong: #34384b;

    --text: #f2f3fa;
    --text-secondary: #a0a5ba;
    --text-muted: #737990;

    --accent: #9b8cff;
    --accent-hover: #b0a5ff;
    --accent-soft: rgba(155, 140, 255, 0.12);

    --cyan: #60e5e8;
    --success: #68e0ad;
    --danger: #ff7d91;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;

    --content-width: 1320px;
    --transition: 180ms ease;
}

html[data-theme="light"] {
    color-scheme: light;

    --bg: #f5f6fb;
    --surface: #ffffff;
    --surface-hover: #f0efff;
    --surface-soft: #f8f8fd;

    --border: #e3e5ef;
    --border-strong: #d1d4e4;

    --text: #202234;
    --text-secondary: #62677d;
    --text-muted: #81869a;

    --accent: #6852df;
    --accent-hover: #5842cc;
    --accent-soft: rgba(104, 82, 223, 0.09);

    --cyan: #087f8c;
    --success: #16885b;
    --danger: #c83c55;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    margin: 0;
    min-width: 320px;

    background: var(--bg);
    color: var(--text);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 14px;
    line-height: 1.6;

    transition:
        background-color var(--transition),
        color var(--transition);
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
a,
input,
textarea,
select,
summary {
    -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea,
select {
    color: var(--text);
}

button {
    cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

a {
    color: inherit;
    text-decoration: none;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.hidden {
    display: none !important;
}

/* Header */

.site-header {
    width: 100%;
    min-height: 76px;

    padding: 14px max(24px, calc((100% - var(--content-width)) / 2));

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
}

.brand-icon {
    width: 39px;
    height: 39px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(155, 140, 255, 0.42);
    border-radius: 12px;

    background: var(--accent-soft);
    color: var(--accent);

    font-size: 14px;
    font-weight: 800;
    letter-spacing: -1px;
}

.brand-name {
    font-size: 19px;
    font-weight: 750;
    letter-spacing: -0.7px;
}

.brand-name > span {
    color: var(--accent);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 23px;
}

.header-link {
    color: var(--text-secondary);
    transition: color var(--transition);
    font-size: 17px;
    font-weight: bold;
}

.header-link:hover {
    color: var(--text);
}

.theme-toggle {
    width: 40px;
    height: 40px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface);
    color: var(--text);

    font-size: 19px;

    transition:
        border-color var(--transition),
        background var(--transition);
}

.theme-toggle:hover {
    border-color: var(--accent);
    background: var(--surface-hover);
}

/* Main */

.main-container {
    width: min(calc(100% - 48px), var(--content-width));
    margin: 0 auto;
}

/* Hero */

.hero {
    padding: 70px 20px 48px;
    text-align: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    margin-bottom: 19px;

    color: var(--accent);

    font-size: 11px;
    font-weight: 750;
    letter-spacing: 1.8px;
}

.status-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;
    background: var(--success);
}

.hero h1 {
    margin: 0;

    font-size: clamp(34px, 4.2vw, 55px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -2.4px;
}

.hero h1 > span {
    color: var(--accent);
}

.hero-description {
    max-width: 590px;
    margin: 20px auto 0;

    color: var(--text-secondary);

    font-size: 15px;
    line-height: 1.8;
}

.trust-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 25px;

    margin-top: 25px;

    color: var(--cyan);
    font-size: 12px;
    font-weight: bold;   
}

/* Tool layout */

.tools-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
    align-items: start;
    gap: 24px;
}

.tool-card {
    min-width: 0;
    padding: 26px;

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    background: var(--surface);

    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.07);
}

.card-heading {
    display: flex;
    align-items: center;
    gap: 13px;

    margin-bottom: 28px;
}

.heading-icon {
    width: 46px;
    height: 46px;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;

    font-size: 23px;
}

.generator-icon {
    background: rgba(155, 140, 255, 0.13);
    color: var(--accent);
}

.scanner-icon {
    background: rgba(96, 229, 232, 0.11);
    color: var(--cyan);
}

.card-heading h2 {
    margin: 0;

    font-size: 19px;
    font-weight: 750;
    letter-spacing: -0.4px;
}

.card-heading p {
    margin: 3px 0 0;

    color: var(--text-muted);
    font-size: 12px;
}

.card-number {
    margin-left: auto;

    color: var(--text-muted);
    font-size: 12px;
    font-weight: 650;
}

/* Labels */

.section-label {
    color: var(--text-muted);

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.25px;
}

.type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;

    margin-top: 13px;
}

.type-button {
    min-height: 76px;
    padding: 10px 5px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;

    border: 1px solid var(--border);
    border-radius: var(--radius-sm);

    background: var(--surface-soft);
    color: var(--text-secondary);

    font-size: 11px;
    font-weight: 650;

    transition:
        border-color var(--transition),
        background var(--transition),
        color var(--transition);
}

.type-button:hover {
    border-color: var(--border-strong);
    background: var(--surface-hover);
}

.type-button.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.type-icon {
    font-size: 21px;
    line-height: 1;
}

.type-description {
    min-height: 24px;
    margin: 13px 0 20px;

    color: var(--text-secondary);
    font-size: 12px;
}

/* Forms */

.form-section {
    display: flex;
    flex-direction: column;
    gap: 17px;
}

.field-group {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-group > label {
    color: var(--text);
    font-size: 12px;
    font-weight: 650;
}

.field-group > input:not([type="color"]):not([type="range"]),
.field-group > textarea,
.field-group > select,
.filename-options > input {
    width: 100%;
    min-height: 45px;
    padding: 11px 13px;

    border: 1px solid var(--border);
    border-radius: var(--radius-sm);

    background: var(--surface-soft);
    color: var(--text);

    font-size: 13px;

    transition:
        border-color var(--transition),
        background var(--transition);
}

.field-group > textarea {
    min-height: 100px;
    resize: vertical;
}

.field-group > input::placeholder,
.field-group > textarea::placeholder,
.filename-options > input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.field-group > input:focus,
.field-group > textarea:focus,
.field-group > select:focus,
.filename-options > input:focus {
    border-color: var(--accent);
    outline: none;
}

.field-hint {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.7;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
    cursor: pointer;
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

input[type="color"] {
    width: 37px;
    height: 34px;
    padding: 3px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--surface-soft);
    cursor: pointer;
}

/* Customization */

.customization,
.history-section {
    margin-top: 22px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--surface-soft);
}

.customization > summary,
.history-section > summary {
    min-height: 51px;
    padding: 14px 15px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    color: var(--text);
    font-size: 12px;
    font-weight: 650;

    cursor: pointer;
    list-style: none;
}

.customization > summary::-webkit-details-marker,
.history-section > summary::-webkit-details-marker,
.filename-options > summary::-webkit-details-marker {
    display: none;
}

.details-arrow {
    color: var(--text-muted);
    font-size: 17px;
    transition: transform var(--transition);
}

.customization[open] .details-arrow {
    transform: rotate(180deg);
}

.customization-content {
    padding: 5px 15px 17px;

    display: flex;
    flex-direction: column;
    gap: 17px;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.color-input {
    min-height: 42px;

    display: flex;
    align-items: center;
    gap: 9px;
}

.color-input > span {
    color: var(--text-secondary);
    font-size: 11px;
    font-family: monospace;
}

.field-group > label:has(+ input[type="range"]) {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

/* Preview */

.preview-section {
    margin-top: 27px;
}

.preview-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 12px;
}

.preview-status {
    color: var(--text-muted);
    font-size: 10px;
}

.qr-preview {
    min-height: 280px;
    padding: 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);

    background:
        radial-gradient(
            ellipse at center,
            var(--accent-soft),
            transparent 75%
        ),
        var(--surface-soft);
}

.preview-placeholder {
    max-width: 100%;
    text-align: center;
}

.placeholder-symbol {
    margin-bottom: 13px;

    color: var(--accent);
    font-size: 52px;
    line-height: 1.2;
}

.preview-placeholder p,
.scanner-placeholder p {
    margin: 0;

    color: var(--text);
    font-size: 13px;
    font-weight: 650;
}

.preview-placeholder > span,
.scanner-placeholder > span {
    display: block;
    margin-top: 7px;

    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.7;
}

.qr-preview canvas,
.qr-preview svg,
.qr-preview img {
    display: block;

    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 420px;

    object-fit: contain;
    border-radius: 10px;
}

.preview-message {
    min-height: 20px;
    margin: 10px 0 0;

    color: var(--text-muted);
    font-size: 11px;
    text-align: center;
}

/* Downloads */

.download-section {
    margin-top: 21px;
}

.history-option {
    display: flex;
    align-items: center;
    gap: 9px;

    color: var(--text-secondary);
    font-size: 12px;

    cursor: pointer;
}

.filename-options {
    margin-top: 15px;
}

.filename-options > summary {
    display: inline-block;

    color: var(--text-muted);
    font-size: 11px;

    cursor: pointer;
}

.filename-options > input {
    display: block;
    margin-top: 10px;
}

.download-buttons {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;

    margin-top: 17px;
}

.button {
    min-height: 45px;
    padding: 11px 15px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    border: 1px solid transparent;
    border-radius: var(--radius-sm);

    font-size: 12px;
    font-weight: 700;
    text-align: center;

    transition:
        transform var(--transition),
        border-color var(--transition),
        background var(--transition);
}

.button:not(:disabled):active {
    transform: scale(0.98);
}

.button-primary {
    background: var(--accent);
    color: #11101b;
}

.button-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.button-secondary {
    border-color: var(--border-strong);
    background: var(--surface);
    color: var(--text);
}

.button-secondary:hover:not(:disabled) {
    border-color: var(--accent);
    background: var(--surface-hover);
}

.download-all-button {
    width: 100%;
    margin-top: 10px;
}

.download-note {
    margin: 12px 0 0;

    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.7;
}

/* History */

.history-count {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
}

.history-content {
    padding: 0 15px 12px;
}

.history-empty {
    color: var(--text-muted);
    font-size: 11px;
}

.text-button {
    padding: 5px 0;

    border: none;
    background: transparent;
    color: var(--accent);

    font-size: 11px;
    font-weight: 650;
}

.text-button:hover {
    color: var(--accent-hover);
}

.history-section > .text-button {
    margin: 0 15px 14px;
}

/* Scanner */

.scanner-description {
    margin: -9px 0 22px;

    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.8;
}

.scanner-preview {
    position: relative;

    min-height: 310px;
    padding: 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);

    background: var(--surface-soft);
}

.scanner-placeholder {
    max-width: 280px;
    text-align: center;
}

.scanner-frame {
    position: relative;

    width: 135px;
    height: 135px;

    margin: 0 auto 25px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-frame > span {
    position: absolute;

    width: 33px;
    height: 33px;

    border-color: var(--cyan);
    border-style: solid;
}

.scanner-frame > span:nth-child(1) {
    top: 0;
    left: 0;

    border-width: 3px 0 0 3px;
    border-radius: 6px 0 0 0;
}

.scanner-frame > span:nth-child(2) {
    top: 0;
    right: 0;

    border-width: 3px 3px 0 0;
    border-radius: 0 6px 0 0;
}

.scanner-frame > span:nth-child(3) {
    bottom: 0;
    left: 0;

    border-width: 0 0 3px 3px;
    border-radius: 0 0 0 6px;
}

.scanner-frame > span:nth-child(4) {
    right: 0;
    bottom: 0;

    border-width: 0 3px 3px 0;
    border-radius: 0 0 6px 0;
}

.scanner-center {
    color: var(--cyan);
    font-size: 48px;
    line-height: 1;
}

#scannerVideo {
    width: 100%;
    max-height: 440px;

    border-radius: 12px;
    object-fit: contain;
    background: #000;
}

.scanner-buttons {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;

    margin-top: 18px;
}

#stopCamera {
    width: 100%;
    margin-top: 10px;
}

.scan-result {
    margin-top: 22px;
    padding: 15px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--surface-soft);
}

.result-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 12px;

    font-size: 12px;
    font-weight: 700;
}

#scanResultText {
    max-height: 220px;
    margin: 0;
    padding: 12px;

    overflow: auto;
    overflow-wrap: anywhere;
    white-space: pre-wrap;

    border: 1px solid var(--border);
    border-radius: var(--radius-sm);

    background: var(--surface);
    color: var(--text-secondary);

    font-family: inherit;
    font-size: 12px;
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    margin-top: 12px;
}

.result-actions > .button {
    flex: 1;
}

.privacy-note {
    margin-top: 24px;
    padding: 15px;

    display: flex;
    align-items: flex-start;
    gap: 12px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--surface-soft);
}

.privacy-icon {
    color: var(--success);
    font-size: 20px;
}

.privacy-note p {
    margin: 0;

    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.8;
}

.privacy-note strong {
    color: var(--text);
}

/* Additional information */

.info-section {
    padding: 100px 0 85px;
}

.info-heading {
    max-width: 650px;
    margin: 0 auto 38px;

    text-align: center;
}

.info-heading h2 {
    margin: 14px 0 10px;

    font-size: clamp(25px, 3vw, 34px);
    line-height: 1.3;
    letter-spacing: -1px;
}

.info-heading > p {
    margin: 0;

    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.8;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.feature-card {
    padding: 25px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--surface);
}

.feature-icon {
    width: 42px;
    height: 42px;
    margin-bottom: 19px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: var(--accent-soft);
    color: var(--accent);

    font-size: 23px;
}

.feature-card h3 {
    margin: 0 0 9px;

    font-size: 15px;
    font-weight: 700;
}

.feature-card p {
    margin: 0;

    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.9;
}

/* Footer */

.site-footer {
    padding: 28px 24px 24px;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 23px;

    border-top: 1px solid var(--border);
    background: var(--surface);
}

.footer-brand {
    font-size: 14px;
    font-weight: 750;
}

.footer-brand .brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 12px;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 24px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 11px;

    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-copyright {
    margin: 0;

    color: var(--text-muted);
    font-size: 10px;
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}



/* ========================================
   Quick QR — Batch Generator in Main Preview
   ======================================== */

/* Batch URL input */
#batchField #batchInput {
    display: block;
    width: 100%;
    margin-top: 9px;
    padding: 13px;
    resize: vertical;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    color: var(--text);
    font: inherit;
}

#batchField #batchInput:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Generate button inside the Batch URL field */
#batchField #generateBatch {
    width: 100%;
    margin-top: 12px;
}

/* Main preview when displaying multiple QR codes */
#qrPreview.batch-preview {
    display: block;
    width: 100%;
    height: auto;
    min-height: 220px;
    max-height: none;
    padding: 16px;
    overflow: visible;
}

/* Grid containing all generated QR codes */
#qrPreview.batch-preview .batch-results {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(min(100%, 150px), 1fr)
    );
    gap: 16px;
    width: 100%;
    margin: 0;
}

/* Individual QR card */
#qrPreview.batch-preview .batch-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    text-align: center;
}

/* QR image */
#qrPreview.batch-preview .batch-item canvas {
    display: block;
    width: 100%;
    max-width: 200px;
    height: auto;
    margin: 0;
    background: #ffffff;
    border-radius: 8px;
}

/* URL below each QR code */
#qrPreview.batch-preview .batch-item p {
    width: 100%;
    margin: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    color: var(--text-secondary);
    font-size: 11px;
}

/* Individual PNG download button */
#qrPreview.batch-preview .batch-item button {
    width: 100%;
}

/* Download all generated QR codes */
#downloadAll {
    width: 100%;
}

/* Global desktop scaling for all QuickQR pages */
@media (min-width: 769px) {
    html {
        zoom: 90%;
    }
}