﻿/* HTML WebP to JPEG Converter - standalone styles. No frameworks, no external fonts. */

* { box-sizing: border-box; }

body {
    margin: 0;
    background: #f4f5f8;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* Working screens use the width of the display, with a floor so a laptop does not end up
   narrower than a marketing page. Prose inside keeps its own reading measure. */
.app-surface {
    width: min(100%, max(1100px, 88%));
    max-width: none;
    margin-inline: auto;
    padding: 0 20px;
}

.site-header {
    background: #1a1a2e;
    color: #fff;
    padding: 22px 0;
}

.site-title { margin: 0; font-size: 22px; font-weight: 600; }
.site-subtitle { margin: 4px 0 0 0; font-size: 13px; color: #a9b0c4; }

.panel {
    background: #fff;
    border: 1px solid #e3e5ea;
    border-radius: 8px;
    padding: 26px 28px;
    margin: 24px 0;
}

.panel h2 { margin: 0 0 12px 0; font-size: 18px; color: #1a1a2e; }

p.lead, p.hint { max-width: 68ch; }
p.lead { margin: 0 0 22px 0; color: #666; }
p.hint { margin: 6px 0 0 0; color: #8b8f99; font-size: 13px; }
p.hint.indent { margin-left: 24px; }
.muted { color: #8b8f99; font-weight: 400; }

.field { margin-bottom: 22px; }
.field > label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.text-input {
    display: block;
    width: 100%;
    max-width: 620px;
    padding: 10px 12px;
    border: 1px solid #d5d8e0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}
.text-input:focus { outline: none; border-color: #1a3668; box-shadow: 0 0 0 3px rgba(26,54,104,0.12); }

.file-input { display: block; font-size: 14px; }

.base-url {
    margin: 0;
    padding: 10px 12px;
    background: #f0f3f8;
    border: 1px solid #dde2ec;
    border-radius: 6px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    color: #1a3668;
    word-break: break-all;
    max-width: 620px;
}

.fixes { border-top: 1px solid #eceef2; padding-top: 20px; }
.check { margin-top: 12px; }
.check input[type="checkbox"] { vertical-align: middle; margin-right: 2px; }
.check label { font-weight: 600; color: #444; }

code {
    background: #f0f3f8;
    border-radius: 3px;
    padding: 1px 5px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    color: #1a3668;
}

.btn-primary {
    background: #1a3668;
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 13px 28px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
.btn-primary:hover { background: #24467f; }
.btn-primary:disabled { background: #9aa3b5; cursor: not-allowed; }

.status-message {
    margin-top: 18px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
}
.status-info    { background: #eef3fb; color: #1a3668; border: 1px solid #cfdcf1; }
.status-success { background: #eef8f0; color: #1d6b33; border: 1px solid #cbe7d3; }
.status-error   { background: #fdeeee; color: #a32020; border: 1px solid #f2cccc; }

.summary { display: block; font-size: 15px; }
.summary code { font-size: 12px; }

.actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; }

.btn-download {
    display: inline-block;
    background: #1a3668;
    color: #fff;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}
.btn-download:hover { background: #24467f; }
.btn-download.secondary { background: #5a627a; }
.btn-download.secondary:hover { background: #6b7490; }

/* Copy HTML is a <button>, not an <a>, so it needs the bits a link gets for free. */
button.btn-download {
    border: 0;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: normal;
    cursor: pointer;
}
button.btn-download:disabled { cursor: progress; }
button.btn-download.busy { background: #5a627a; }
button.btn-download.done { background: #1d6b33; }

.copy-status { margin: 10px 0 0; font-size: 13px; min-height: 18px; }
.copy-status.ok  { color: #1d6b33; }
.copy-status.bad { color: #a32020; }

.results .status-message { margin-top: 20px; }

/* Wide content scrolls inside its own box - the page itself never scrolls sideways. */
.table-scroll { overflow-x: auto; }

.image-table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
.image-table th {
    background: #f4f5f8;
    color: #555;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 10px 8px;
    border-bottom: 2px solid #e3e5ea;
    white-space: nowrap;
}
.image-table td { padding: 10px 8px; border-bottom: 1px solid #eceef2; vertical-align: top; color: #444; }
.image-table tr:hover td { background: #fafbfc; }
.row-failed td { background: #fff6f6; }

.thumb { display: block; max-width: 120px; max-height: 90px; border: 1px solid #e3e5ea; border-radius: 4px; background: #fff; }
.file-name { margin-top: 5px; font-size: 11px; color: #777; word-break: break-all; max-width: 140px; }
.image-table td.url { font-size: 11px; color: #777; word-break: break-all; max-width: 280px; }
.image-table td.note { font-size: 12px; color: #666; min-width: 220px; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-error { background: #fdeeee; color: #a32020; }

.site-footer { padding: 26px 0 40px; color: #8b8f99; font-size: 13px; }
.site-footer p { margin: 0; }

/* Loading overlay - shown the instant the button is clicked, cleared by the postback. */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 22, 34, 0.55);
    z-index: 999;
    align-items: center;
    justify-content: center;
}
.overlay.active { display: flex; }

.overlay-box {
    background: #fff;
    border-radius: 10px;
    padding: 32px 44px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.overlay-title { margin: 16px 0 0 0; font-weight: 600; color: #333; }
.overlay-note { margin: 5px 0 0 0; font-size: 13px; color: #999; }

.spinner {
    width: 42px;
    height: 42px;
    margin: 0 auto;
    border: 4px solid #e3e5ea;
    border-top-color: #1a3668;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .spinner { animation-duration: 3s; }
}

@media (max-width: 700px) {
    .panel { padding: 20px 18px; }
    .site-title { font-size: 19px; }
}

/* ---------- tabs across the two tools ---------- */
.site-nav { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.nav-tab {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 6px 6px 0 0;
    background: rgba(255,255,255,0.14);
    color: #dbe3f2;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.nav-tab:hover { background: rgba(255,255,255,0.22); color: #fff; }
.nav-tab.active { background: #f4f6fa; color: #1a3668; }

/* ---------- create-a-mailer form ---------- */
/* Two fields share a row on a wide screen and stack on a narrow one, without a media query. */
.field-row { display: flex; flex-wrap: wrap; gap: 20px; }
.field-row > .field { flex: 1 1 260px; }

.dropzone {
    border: 2px dashed #c3cbdb;
    border-radius: 8px;
    background: #fafbfd;
    padding: 26px 18px;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.dropzone:hover { border-color: #1a3668; background: #f4f7fd; }
.dropzone.over { border-color: #1a3668; background: #e9f0fc; }
.dropzone-title { margin: 0 0 4px; font-size: 16px; font-weight: 600; color: #1a3668; }
.dropzone-note { margin: 0 0 14px; font-size: 13px; color: #6b7280; }
.dropzone .file-input { margin: 0 auto; }

.colour-input {
    width: 70px;
    height: 42px;
    padding: 2px;
    border: 1px solid #ccd2e0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
    .dropzone { transition: none; }
}
