:root {
    color-scheme: light;
    --ink: #14231d;
    --muted: #66736d;
    --paper: #f5f3ed;
    --card: #fffefa;
    --line: #dcded7;
    --green: #176c4d;
    --green-dark: #0e5038;
    --green-soft: #e5f2ec;
    --red: #a43737;
    --shadow: 0 22px 60px rgba(24, 42, 34, .10);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 15%, rgba(73, 132, 105, .10), transparent 28rem),
        radial-gradient(circle at 88% 84%, rgba(182, 133, 70, .08), transparent 25rem),
        var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .34;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
}

.shell { width: min(960px, calc(100% - 32px)); margin: 0 auto; padding: 70px 0 34px; }
.hero { max-width: 760px; margin: 0 auto 36px; text-align: center; }
.brand-mark { display: inline-flex; align-items: flex-end; gap: 4px; height: 28px; margin-bottom: 16px; transform: rotate(-12deg); }
.brand-mark span { display: block; width: 5px; border-radius: 5px; background: var(--green); }
.brand-mark span:nth-child(1) { height: 14px; }
.brand-mark span:nth-child(2) { height: 27px; background: #bc4f4f; }
.brand-mark span:nth-child(3) { height: 20px; background: #4569a1; }
.eyebrow, .step-label { margin: 0 0 9px; color: var(--green); font-size: .76rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.35rem, 6vw, 4.5rem); font-weight: 500; line-height: .98; letter-spacing: -.045em; }
.intro { max-width: 650px; margin: 22px auto 0; color: var(--muted); font-size: 1.05rem; line-height: 1.65; }

.card { position: relative; padding: clamp(24px, 5vw, 48px); border: 1px solid rgba(20, 35, 29, .10); border-radius: 24px; background: rgba(255, 254, 250, .94); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.card-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 34px; }
h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 2rem; font-weight: 500; }
.privacy-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px; color: var(--green-dark); background: var(--green-soft); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.privacy-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #2a9a6e; box-shadow: 0 0 0 4px rgba(42,154,110,.12); }

form { display: grid; gap: 28px; }
.field { display: grid; gap: 8px; }
.field-title { font-size: .93rem; font-weight: 750; }
.field-help { color: var(--muted); font-size: .84rem; line-height: 1.4; }
.input-wrap { position: relative; display: block; }
input[type="text"], select { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font: inherit; outline: none; transition: border-color .18s, box-shadow .18s; }
input[type="text"] { height: 54px; padding: 0 80px 0 16px; }
select { min-height: 54px; padding: 10px 42px 10px 14px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, #627069 50%), linear-gradient(135deg, #627069 50%, transparent 50%); background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="text"]:focus, select:focus { border-color: #3b8a6b; box-shadow: 0 0 0 4px rgba(23,108,77,.10); }
#character-count { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: #869089; font-size: .76rem; font-variant-numeric: tabular-nums; }
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.drop-zone { display: grid; justify-items: center; padding: 32px 20px; border: 1.5px dashed #aebbb4; border-radius: 16px; background: #fafbf8; text-align: center; cursor: pointer; transition: border-color .18s, background .18s, transform .18s; }
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.is-dragging { border-color: var(--green); background: #f2f8f4; transform: translateY(-1px); outline: none; }
.upload-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 12px; border-radius: 50%; color: var(--green); background: var(--green-soft); }
.drop-zone > span { margin-top: 4px; color: var(--muted); font-size: .9rem; }
.drop-zone .browse { color: var(--green); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.drop-zone small { max-width: 480px; margin-top: 14px; color: #7e8882; line-height: 1.5; }
.file-list { display: grid; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.file-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #e2e5df; border-radius: 10px; background: #fff; font-size: .86rem; }
.file-item::before { content: "PDF"; display: grid; place-items: center; width: 35px; height: 28px; border-radius: 6px; color: var(--red); background: #f8eaea; font-size: .58rem; font-weight: 900; }
.file-item.image::before { content: "IMG"; color: #2f638f; background: #e8f0f7; }
.file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { margin-left: auto; color: var(--muted); white-space: nowrap; }
.file-remove { border: 0; background: transparent; color: #87908b; cursor: pointer; font-size: 1.2rem; line-height: 1; }

.primary-button, .secondary-button, .download-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 12px; font: inherit; font-weight: 750; cursor: pointer; text-decoration: none; transition: transform .18s, background .18s, opacity .18s; }
.primary-button { width: 100%; min-height: 56px; color: white; background: var(--green); box-shadow: 0 10px 24px rgba(23,108,77,.18); }
.primary-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: wait; transform: none; }
.message { padding: 12px 14px; border-radius: 10px; font-size: .9rem; line-height: 1.45; }
.error { border: 1px solid #e8caca; color: #8e2929; background: #fff2f2; }

.progress-panel, .results-panel { border-top: 1px solid var(--line); padding-top: 30px; }
.progress-copy { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 18px; }
.progress-copy h3, .results-panel h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; font-weight: 500; }
#overall-label { color: var(--muted); font-size: .84rem; }
.progress-track { position: relative; height: 9px; overflow: hidden; border-radius: 99px; background: #e7ebe7; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), #3a9b75); transition: width .2s ease; }
.progress-track.overall { height: 5px; }
.progress-track.overall span { background: #9fb9ac; }
.overall-row { display: flex; justify-content: space-between; margin: 15px 0 7px; color: var(--muted); font-size: .75rem; }

.results-panel { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; }
.success-icon { grid-row: 1 / span 2; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; color: white; background: var(--green); font-weight: 900; }
.results-panel p:not(.step-label) { margin: 7px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.download-list { grid-column: 1 / -1; display: grid; gap: 10px; margin-top: 16px; }
.download-button { justify-content: space-between; padding: 14px 16px; color: var(--ink); border: 1px solid var(--line); background: white; }
.download-button:hover { border-color: #8eaa9c; transform: translateY(-1px); }
.download-button.used { opacity: .5; pointer-events: none; }
.secondary-button { grid-column: 1 / -1; justify-self: start; margin-top: 12px; padding: 11px 16px; color: var(--green-dark); background: var(--green-soft); }

footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 20px; padding: 0 8px; color: #758079; font-size: .76rem; }
footer span { display: inline-flex; align-items: center; gap: 8px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #479475; }
[hidden] { display: none !important; }

@media (max-width: 700px) {
    .shell { padding-top: 42px; }
    .options-grid { grid-template-columns: 1fr; }
    .card-heading, .progress-copy, footer { align-items: flex-start; flex-direction: column; }
    .privacy-pill { align-self: flex-start; }
    .card { border-radius: 18px; }
    footer { gap: 9px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
