* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior:smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    color: #1e293b;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.container {
    width: min(1120px, calc(100% - 40px));
    margin-inline: auto;
}

/* Header */

.site-header {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid #e2e8f0;
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-inner {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.brand-mark {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #eff6ff;
    color: #2563eb;
}

.brand-mark svg {
    width: 22px;
    height: 22px;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    color: #0f172a;
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.15;
}

.brand small {
    margin-top: 3px;
    color: #64748b;
    font-size: 0.72rem;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 180ms ease;
}

.nav-link:hover {
    color: #2563eb;
}

/* Main */

.main-content {
    flex: 1;
    padding-top: 64px;
    padding-bottom: 72px;
}

.eyebrow {
    margin: 0 0 8px;
    color: #2563eb;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 10px;
    color: #0f172a;
    font-size: clamp(1.8rem, 4vw, 2.65rem);
    line-height: 1.15;
    letter-spacing: -0.035em;
}

h2 {
    margin-bottom: 0;
    color: #0f172a;
    font-size: 1.35rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* State cards */

.state-card {
    width: min(620px, 100%);
    margin: 50px auto;
    padding: 52px 40px;
    text-align: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.10);
    animation: fade-up 350ms ease both;
}

.state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    display: grid;
    place-items: center;
    border-radius: 18px;
}

.state-icon svg {
    width: 31px;
    height: 31px;
}

.state-icon-blue {
    background: #eff6ff;
    color: #2563eb;
}

.state-icon-red {
    background: #fef2f2;
    color: #ef4444;
}

.state-description {
    max-width: 480px;
    margin: 0 auto 28px;
    color: #475569;
    font-size: 0.98rem;
}

.error-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Buttons */

.button {
    min-height: 44px;
    padding: 10px 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease,
        color 180ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button:active {
    transform: translateY(0);
}

.button:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.25);
    outline-offset: 2px;
}

.button-primary {
    background: #2563eb;
    color: #ffffff;
  
    /* box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2); */
}

.button-primary:hover {
    background: #1d4ed8;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

.button-secondary {
    background: #ffffff;
    color: #334155;
    border-color: #e2e8f0;
}

.button-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}


/* .button-small {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 0.8rem;
    background: #2563eb;
    color: #ffffff;
} */

.button-small svg {
    width: 16px;
    height: 16px;
}

.button-wide {
    width: 100%;
}

/* Document viewer */

.document-section {
    animation: fade-up 350ms ease both;
}

.document-heading {
    margin-bottom: 28px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.document-subtitle {
    margin-bottom: 0;
    color: #64748b;
    font-size: 0.9rem;
}

.document-meta {
    flex: 0 0 auto;
}

.status-badge {
    min-height: 34px;
    padding: 7px 11px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    background: #f0fdf4;
    color: #15803d;
    font-size: 0.78rem;
    font-weight: 700;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.document-info-grid {
    margin-bottom: 18px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.info-card {
    padding: 15px 17px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.info-label {
    display: block;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.info-card strong {
    color: #1e293b;
    font-size: 0.92rem;
}

.text-success {
    color: #15803d !important;
}

/* image view main area */
/* .viewer-card {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.10);
} */

/* .viewer-toolbar {
     min-height: 70px; 
    padding: 13px 16px 13px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #ffffff;
} */

.viewer-title {
    display: block;
    color: #1e293b;
    font-size: 0.86rem;
    font-weight: 700;
    display: none;
}

.viewer-file-name {
    display: block;
    margin-top: 2px;
    color: #ffffff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.72rem;
}

.viewer-actions {
    display: flex;
    gap: 8px;
}

.image-viewer {
    min-height: 560px;

    padding: 32px;
    display: grid;
    place-items: center;
    overflow: auto;
    /* background:
        linear-gradient(45deg, #f1f5f9 25%, transparent 25%),
        linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f1f5f9 75%),
        linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
    background-size: 28px 28px;
    background-position: 0 0, 0 14px, 14px -14px, -14px 0; */
}

/* image or doc  area */
.document-image {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 78vh;
    display: block;
    background: #ffffff;
    animation: document-in 350ms ease both;
}

.image-loading {
    display: grid;
    place-items: center;
}

.image-viewer.is-fullscreen {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    padding: 40px;
    background: #111827;
}

.image-viewer.is-fullscreen .document-image {
    max-height: calc(100vh - 80px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* Generator */

.generator-layout {
    max-width: 1000px;
    margin: 28px auto 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
    gap: 64px;
    align-items: start;
}

.generator-intro {
    padding-top: 26px;
}

.generator-intro > p:not(.eyebrow) {
    max-width: 500px;
    margin-bottom: 36px;
    color: #475569;
    font-size: 1rem;
}

.how-it-works {
    display: grid;
    gap: 13px;
}

.step {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 13px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.step > span {
    width: 35px;
    height: 35px;
    flex: 0 0 35px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 0.68rem;
    font-weight: 800;
}

.step strong,
.step small {
    display: block;
}

.step strong {
    color: #1e293b;
    font-size: 0.85rem;
}

.step small {
    margin-top: 2px;
    color: #64748b;
    font-size: 0.75rem;
}

.generator-card {
    padding: 26px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.10);
}

.card-heading {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.qr-mini-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #eff6ff;
    color: #2563eb;
}

.qr-mini-icon svg {
    width: 25px;
    height: 25px;
}

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

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 700;
}

.form-group input {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    transition:
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.form-group input::placeholder {
    color: #94a3b8;
}

.form-group input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.form-group input.input-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

.input-help {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 0.72rem;
}

.form-error {
    margin: 6px 0 0;
    color: #b91c1c;
    font-size: 0.75rem;
    font-weight: 600;
}

.qr-result {
    margin-top: 27px;
    animation: fade-up 300ms ease both;
}

.result-divider {
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.result-divider::before,
.result-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: #e2e8f0;
}

.qr-preview {
    min-height: 280px;
    padding: 20px;
    display: grid;
    place-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

#qrcode {
    width: 240px;
    height: 240px;
    padding: 0;
    display: grid;
    place-items: center;
    background: #ffffff;
}

#qrcode img,
#qrcode canvas {
    /* display: block !important; */
    width: 240px !important;
    height: 240px !important;
    image-rendering: auto;
}

.destination {
    margin-top: 15px;
    padding: 13px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.destination code {
    display: block;
    overflow-wrap: anywhere;
    color: #334155;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.73rem;
    line-height: 1.5;
}

.generator-actions {
    margin-top: 15px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 9px;
}

/* Loading */

.spinner {
    width: 42px;
    height: 42px;
    margin: 0 auto 22px;
    border: 3px solid #dbeafe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 750ms linear infinite;
}

.spinner-small {
    width: 30px;
    height: 30px;
    margin: 0;
}

/* Footer */

.site-footer {
    border-top: 1px solid #e2e8f0;
        background: #ffffff;
        
    
}

.footer-inner {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    color: #64748b;
    font-size: 0.74rem;
}

/* Animations */

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes document-in {
    from {
        opacity: 0;
        transform: scale(0.985);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */

@media (max-width: 850px) {
    .generator-layout {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .generator-intro {
        padding-top: 0;
    }

    .generator-intro > p:not(.eyebrow) {
        margin-bottom: 25px;
    }

    .how-it-works {
        grid-template-columns: repeat(3, 1fr);
    }

    .step {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 680px) {
    .container {
        width: min(100% - 28px, 1120px);
    }

    .main-content {
        padding-top: 38px;
        padding-bottom: 48px;
    }

    .header-inner {
        min-height: 66px;
    }

    .brand small {
        display: none;
    }

    .nav-link {
        font-size: 0.8rem;
    }

    .state-card {
        margin: 25px auto;
        padding: 40px 23px;
    }

    .document-heading {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 20px;
    }

    .document-info-grid {
        grid-template-columns: 1fr;
    }

    .viewer-toolbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 15px;
    }

    .viewer-actions {
        width: 100%;
    }

    .viewer-actions .button {
        flex: 1;
    }

    .image-viewer {
        min-height: 420px;
        padding: 16px;
    }

    .generator-card {
        padding: 21px;
    }

    .how-it-works {
        grid-template-columns: 1fr;
    }

    .step {
        flex-direction: row;
        align-items: center;
    }

    .footer-inner {
        min-height: 70px;
        align-items: flex-start;
        justify-content: center;
        flex-direction: column;
        gap: 2px;
        padding-block: 15px;
    }
}

@media (max-width: 420px) {
    .brand strong {
        font-size: 0.84rem;
    }

    .state-card h1 {
        font-size: 1.75rem;
    }

    .generator-actions {
        grid-template-columns: 1fr;
    }

    .qr-preview {
        min-height: 260px;
    }
}