:root {
    --red: #e53935;
    --red-dark: #b71c1c;
    --yellow: #ffd43b;
    --yellow-soft: #fff4bf;
    --ink: #252525;
    --muted: #737373;
    --cream: #fffdf7;
    --border: #eee6d2;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
}

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

.topbar {
    height: 76px;
    padding: 0 7%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -1px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--red);
    color: white;
    font-size: 22px;
}

nav {
    display: flex;
    gap: 28px;
    color: #555;
    font-size: 14px;
    font-weight: 600;
}

nav a:hover {
    color: var(--red);
}

.container {
    width: min(1100px, 90%);
    margin: 0 auto;
}

.hero {
    min-height: 480px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 60px;
    padding: 70px 0;
}

.eyebrow {
    color: var(--red);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 18px;
}

h1 {
    font-size: clamp(42px, 6vw, 72px);
    line-height: 0.98;
    letter-spacing: -4px;
    margin: 0 0 24px;
}

h1 span {
    color: var(--red);
}

h2 {
    margin-top: 0;
    font-size: 24px;
}

h3 {
    margin-bottom: 8px;
}

p {
    color: #5e5e5e;
    line-height: 1.7;
}

.hero p {
    max-width: 460px;
    font-size: 17px;
}

.button {
    display: inline-block;
    border: 0;
    border-radius: 12px;
    background: var(--red);
    color: white;
    padding: 15px 22px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s;
}

.button:hover {
    background: var(--red-dark);
    transform: translateY(-2px);
}

.hero-card {
    min-height: 330px;
    border-radius: 30px;
    background: var(--yellow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.barcode-lines {
    width: 210px;
    height: 120px;
    background: repeating-linear-gradient(
        90deg,
        #111 0px,
        #111 4px,
        transparent 4px,
        transparent 9px,
        #111 9px,
        #111 11px,
        transparent 11px,
        transparent 17px
    );
    border: 15px solid white;
    box-shadow: 0 12px 0 rgba(0,0,0,0.08);
}

.scan-label {
    margin-top: 24px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 3px;
}

.scan-circle {
    position: absolute;
    right: -30px;
    bottom: -50px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    display: grid;
    place-items: center;
    font-size: 60px;
    color: var(--red);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    padding: 30px 0 80px;
}

.feature {
    padding: 28px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
}

.feature-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--yellow-soft);
    color: var(--red);
    font-size: 22px;
    font-weight: 900;
}

.page-heading {
    padding: 60px 0 35px;
}

.page-heading h1 {
    font-size: clamp(38px, 5vw, 56px);
    letter-spacing: -2px;
}

.page-heading p {
    margin-bottom: 0;
}

.scan-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    padding-bottom: 70px;
}

.panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 24px;
}

.panel h2 {
    margin-bottom: 8px;
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

label {
    display: block;
    margin: 22px 0 8px;
    font-size: 13px;
    font-weight: 800;
}

input[type="text"],
input[type="file"] {
    width: 100%;
    border: 1px solid #ddd5c3;
    border-radius: 10px;
    padding: 13px;
    background: #fffdf8;
    font-size: 14px;
}

input[type="file"] {
    padding: 10px;
}

form .button {
    margin-top: 24px;
}

.tip {
    margin-top: 28px;
    padding: 16px;
    border-radius: 10px;
    background: var(--yellow-soft);
    font-size: 13px;
    color: #665b25;
}

.result-card {
    max-width: 720px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 24px;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 800;
    color: #5e5e5e;
    margin-bottom: 30px;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #3dbb72;
}

.barcode-display {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border-radius: 12px;
    background: #f8f6ef;
    margin-bottom: 28px;
}

code {
    font-family: "Courier New", monospace;
    font-size: 13px;
    word-break: break-all;
}

.barcode-display code {
    font-size: 17px;
    font-weight: 700;
}

.product-result {
    display: flex;
    gap: 24px;
    align-items: center;
}

.product-placeholder {
    width: 110px;
    height: 110px;
    display: grid;
    place-items: center;
    background: var(--yellow);
    border-radius: 16px;
    font-size: 45px;
}

.product-result h2 {
    margin-bottom: 4px;
}

.product-stats {
    display: flex;
    gap: 50px;
    margin-top: 18px;
}

.product-stats div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.product-stats strong {
    font-size: 22px;
}

.empty-result {
    text-align: center;
    padding: 25px;
}

.empty-icon {
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #f8f6ef;
    font-size: 30px;
    color: var(--red);
    font-weight: 800;
}

.special-result {
    border: 2px dashed var(--red);
    border-radius: 16px;
    padding: 25px;
    background: #fff9e2;
}

.special-icon {
    font-size: 30px;
    color: var(--red);
}

.flag-box {
    margin-top: 24px;
    padding: 20px;
    border-radius: 12px;
    background: #272727;
    color: white;
}

.flag-label {
    display: block;
    color: var(--yellow);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.flag-box code {
    color: white;
}

.text-link {
    color: var(--red);
    font-size: 14px;
    font-weight: 800;
}

.warning-banner {
    background: var(--yellow-soft);
    border: 1px solid #f2db75;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 24px;
    font-size: 14px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    text-align: left;
    color: #777;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

th, td {
    padding: 15px 10px;
    border-bottom: 1px solid #eee;
}

.section-heading {
    margin-top: 40px;
}

.flash {
    padding: 15px;
    margin-top: 25px;
    border-radius: 10px;
    font-size: 14px;
}

.flash.error {
    background: #ffe3e3;
    color: #a52626;
}

.error-page {
    text-align: center;
    padding: 120px 0;
}

.error-icon {
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    margin: 0 auto 25px;
    border-radius: 50%;
    background: var(--yellow);
    color: var(--red);
    font-size: 30px;
    font-weight: 900;
}

.error-page h1 {
    font-size: 48px;
    letter-spacing: -2px;
}

footer {
    text-align: center;
    padding: 30px;
    color: #aaa;
    font-size: 12px;
}

@media (max-width: 750px) {
    .topbar {
        padding: 0 5%;
    }

    nav {
        gap: 12px;
    }

    .hero {
        grid-template-columns: 1fr;
        padding: 45px 0;
    }

    .hero-card {
        min-height: 250px;
    }

    .feature-grid,
    .scan-layout {
        grid-template-columns: 1fr;
    }

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

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

textarea {
    width: 100%;
    border: 1px solid #ddd5c3;
    border-radius: 10px;
    padding: 13px;
    background: #fffdf8;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.form-panel {
    max-width: 720px;
}

.upload-hint {
    font-size: 12px;
    color: #888;
    margin-top: 8px;
}

.generated-barcode {
    margin-top: 35px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.barcode-image {
    display: block;
    width: 100%;
    max-width: 1000px;
    height: auto;
    margin: 20px 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
}

.page-actions {
    margin-bottom: 25px;
}

.product-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-results > h2 {
    margin-bottom: 0;
}

.product-results .product-result {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.product-results .product-result:last-child {
    border-bottom: 0;
}

.result-panel {
    margin-top: 2rem;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #dbe4ec;
}

.result-panel h2 {
    margin-top: 0;
    color: #03294d;
}

.result-panel p {
    margin-bottom: 0;
    color: #687585;
}

.result-error {
    background: #fff0f0;
    border-color: #e7b6b6;
}

.result-not-found {
    background: #fff8df;
    border-color: #ead28a;
}

.result-special {
    background: #edf5fc;
    border-color: #b8d4ec;
}

.result-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: #0756a0;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 800;
}

.result-error .result-icon {
    background: #b72828;
}

.result-not-found .result-icon {
    background: #c18b00;
}

.result-special .result-icon {
    background: #0756a0;
}
