/* ============================================
   Abundera QR — Free QR Code Generator
   ============================================ */

/* --- Fonts (self-hosted Inter) --- */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter Fallback';
    src: local('BlinkMacSystemFont'), local('Segoe UI'), local('Arial');
    size-adjust: 100%;
    ascent-override: 90%;
    descent-override: 22%;
    line-gap-override: 0%;
}

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

:root {
    --bg: #08090a;
    --surface-1: #0f1012;
    --surface-2: #161719;
    --surface-3: #1e1f22;
    --text: #f5f5f5;
    --text-secondary: #d4d4d4;
    --text-muted: #888;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --blue: #60a5fa;
    --purple: #a78bfa;
    --green: #34d399;
    --pink: #fb7185;
    --radius: 12px;
    --radius-lg: 16px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* --- Skip Link --- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    padding: 8px 16px;
    background: var(--blue);
    color: var(--bg);
    border-radius: 0 0 8px 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    z-index: 100;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* --- Focus styles --- */
:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

/* --- Background Orbs --- */
.bg-orbs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.12;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--blue);
    top: -200px;
    right: -100px;
    animation: float1 25s ease-in-out infinite;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--purple);
    bottom: -150px;
    left: -100px;
    animation: float2 30s ease-in-out infinite;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: var(--green);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float3 20s ease-in-out infinite;
}

@keyframes float1 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-80px, 60px); } }
@keyframes float2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(60px, -80px); } }
@keyframes float3 { 0%, 100% { transform: translate(-50%, -50%); } 50% { transform: translate(-40%, -60%); } }

/* --- Layout --- */
main, .site-header, .site-footer {
    position: relative;
    z-index: 1;
}

main {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Header --- */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    max-width: 960px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 500;
}

.logo strong { font-weight: 700; }

.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 6px 12px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
    color: var(--text);
    background: var(--surface-2);
}

.sign-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--blue);
}

.sign-link:hover {
    color: var(--text);
    background: rgba(96, 165, 250, 0.1);
}

/* --- Hero --- */
.hero {
    text-align: center;
    padding: 60px 0 40px;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text), var(--blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.125rem;
    margin-top: 12px;
}

/* --- Generator --- */
.generator {
    padding-bottom: 60px;
}

.generator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

/* --- Controls Panel --- */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.type-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.type-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-1);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.type-btn:hover {
    border-color: var(--border-hover);
    color: var(--text);
    background: var(--surface-2);
}

.type-btn.active {
    border-color: var(--blue);
    color: var(--blue);
    background: rgba(96, 165, 250, 0.08);
}

/* --- Input Fields --- */
.field-group {
    display: none;
    flex-direction: column;
    gap: 12px;
}

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

.field-group label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.field-group input:not([type="checkbox"]):not([type="file"]):not([type="color"]),
.field-group textarea,
.field-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-1);
    color: var(--text);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

.field-group input::placeholder,
.field-group textarea::placeholder {
    color: var(--text-muted);
}

.field-group textarea {
    resize: vertical;
    min-height: 80px;
}

.field-group input[type="datetime-local"] {
    color-scheme: dark;
}

.field-group input[type="number"] {
    -moz-appearance: textfield;
}

.field-group input[type="number"]::-webkit-inner-spin-button {
    opacity: 0.5;
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--blue);
}

.char-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

.field-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.transparent-toggle {
    margin-left: 4px;
    font-size: 0.75rem !important;
    white-space: nowrap;
}

.transparent-toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
}

.frame-text-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.8125rem;
    font-family: inherit;
    outline: none;
    width: 140px;
    transition: border-color 0.2s;
}

.frame-text-input:focus {
    border-color: var(--blue);
}

.frame-text-input::placeholder {
    color: var(--text-muted);
}

/* --- Customize Section --- */
.customize-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-1);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.customize-toggle:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.customize-toggle .chevron {
    margin-left: auto;
    transition: transform 0.2s;
}

.customize-toggle.open .chevron {
    transform: rotate(180deg);
}

.customize-options {
    display: none;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-1);
    margin-top: -4px;
}

.customize-options.open {
    display: flex;
}

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

.color-row label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

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

.color-input-wrap input[type="color"] {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: none;
    cursor: pointer;
    padding: 2px;
}

.color-input-wrap input[type="color"]:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.color-hex {
    font-size: 0.75rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: var(--text-muted);
    min-width: 60px;
}

.color-row select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.8125rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

/* --- Logo Upload --- */
.logo-upload {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.logo-upload > label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.logo-upload-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

/* --- Preview Panel --- */
.preview-panel {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.qr-preview {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 340px;
    transition: border-color 0.3s;
}

.qr-preview.has-qr {
    border-color: var(--border-hover);
}

.qr-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.875rem;
}

.qr-canvas-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    animation: qrFadeIn 0.3s ease;
}

@keyframes qrFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

#qr-canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Action Buttons --- */
.actions {
    display: none;
    gap: 8px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    flex: 1;
    justify-content: center;
    background: var(--blue);
    color: #08090a;
}

.btn-primary:hover {
    background: #7db8fb;
    transform: translateY(-1px);
}

.btn-secondary {
    flex: 1;
    justify-content: center;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-3);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    color: var(--text);
    border-color: var(--border-hover);
    background: var(--surface-1);
}

.btn-gradient {
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: #fff;
    font-weight: 600;
}

.btn-gradient:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(96, 165, 250, 0.3);
}

/* --- Sign CTA --- */
.sign-cta {
    padding: 48px 0;
}

.sign-cta-inner {
    padding: 32px;
    border: 1px solid rgba(96, 165, 250, 0.15);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.05), rgba(167, 139, 250, 0.05));
    overflow: hidden;
    position: relative;
}

.sign-cta-badge {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 20px;
}

.sign-cta-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.sign-cta-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.sign-cta h2 {
    font-size: clamp(1.25rem, 3vw, 1.625rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.sign-cta p {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
    max-width: 440px;
}

.sign-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 4px 0;
}

.sign-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.sign-features svg {
    flex-shrink: 0;
}

.sign-cta .btn-gradient {
    align-self: flex-start;
    margin-top: 4px;
}

.sign-cta-visual {
    flex-shrink: 0;
}

.sign-doc-mock {
    width: 160px;
    padding: 20px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sign-doc-line {
    height: 6px;
    background: var(--surface-3);
    border-radius: 3px;
    width: 100%;
}

.sign-doc-line-title {
    height: 8px;
    width: 60%;
    background: rgba(96, 165, 250, 0.2);
}

.sign-doc-line-short {
    width: 70%;
}

.sign-doc-spacer {
    height: 8px;
}

.sign-doc-sig {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-hover);
    display: flex;
    justify-content: center;
}

/* --- How It Works --- */
.how-it-works {
    padding: 40px 0;
    text-align: center;
}

.how-it-works h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 32px;
    letter-spacing: -0.02em;
}

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

.step {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-1);
    transition: border-color 0.2s;
}

.step:hover {
    border-color: var(--border-hover);
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(96, 165, 250, 0.1);
    color: var(--blue);
    font-weight: 700;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

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

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

/* --- FAQ --- */
.faq {
    padding: 40px 0 80px;
}

.faq h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
    text-align: center;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-1);
    transition: border-color 0.2s;
}

.faq-item[open] {
    border-color: var(--border-hover);
}

.faq-item summary {
    padding: 16px 20px;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.faq-item[open] summary::after {
    content: '\2212';
}

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

.faq-item p {
    padding: 0 20px 16px;
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.7;
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 24px;
}

.footer-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.2s;
}

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

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

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-3);
    color: var(--text);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.875rem;
    border: 1px solid var(--border-hover);
    z-index: 1000;
    animation: toastIn 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .generator-layout {
        grid-template-columns: 1fr;
    }

    .preview-panel {
        position: static;
    }

    .hero { padding: 40px 0 24px; }

    .steps {
        grid-template-columns: 1fr;
    }

    .sign-cta-body {
        flex-direction: column;
        text-align: center;
    }

    .sign-cta-badge { text-align: center; }
    .sign-cta-content { align-items: center; }
    .sign-cta p { max-width: none; }
    .sign-cta .btn-gradient { align-self: center; }
    .sign-features { align-items: center; }

    .sign-cta-visual { display: none; }

    .footer-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .footer-links { flex-wrap: wrap; justify-content: center; }

    .type-selector {
        gap: 4px;
    }

    .type-btn {
        padding: 6px 10px;
        font-size: 0.8125rem;
    }

    .actions {
        flex-direction: column;
    }

    .btn-outline {
        justify-content: center;
    }

    .header-nav .nav-link:not(.sign-link) {
        display: none;
    }
}

@media (max-width: 480px) {
    main { padding: 0 16px; }
    .site-header { padding: 12px 16px; }

    .hero h1 { font-size: 1.75rem; }
    .hero-subtitle { font-size: 1rem; }

    .qr-preview { padding: 24px; min-height: 280px; }
}
