/* Public-facing styles shared by top page and appraisal screens */

:root {
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f8fafc;
    color: #1f2937;
}

header,
footer {
    background: #0f172a;
    color: #f8fafc;
    padding: 24px 20px;
}

header strong,
footer small {
    font-weight: 600;
    letter-spacing: 0.02em;
}

main {
    flex: 1;
    padding: 32px 20px;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    display: grid;
    gap: 16px;
    align-content: start;
    align-items: start;
}

/* General layout helpers */
.section {
    display: grid;
    gap: 16px;
}

.hero {
    display: grid;
    gap: 16px;
    padding: 24px 0;
}

.qr-code {
    width: 200px;
    height: 200px;
}

h1 {
    margin: 10px;
}

.hero h1,
.hero h2 {
    margin: 0;
    font-size: clamp(24px, 4vw, 32px);
    color: #0f172a;
}

.hero p {
    margin: 0;
    color: #475569;
    line-height: 1.6;
}

.hint {
    color: #64748b;
    font-size: 14px;
}

.status-refresh {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 16px 0 24px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.status-refresh span {
    color: #475569;
    font-size: 15px;
}

.status-refresh .reload-button {
    min-width: 180px;
}

/* Buttons */
.btn,
button,
input[type="submit"],
input[type="button"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn:focus,
button:focus,
input[type="submit"]:focus,
input[type="button"]:focus {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: 2px;
}

.btn:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.15);
}

.primary {
    background: #2563eb;
    color: #f8fafc;
}

.ghost {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #1f2937;
}

button.secondary,
.btn.secondary {
    background: #64748b;
    color: #f8fafc;
}

button.secondary:hover,
.btn.secondary:hover {
    background: #475569;
}

/* Forms */
form,
.signature-actions,
.signature-support,
.address-group,
.appraisal-summary,
.appraisal-items,
.appraisal-item,
.card,
.success-message {
    display: grid;
    gap: 16px;
}

label {
    font-weight: 600;
    color: #1f2937;
}

input[type="text"],
input[type="tel"],
input[type="number"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

.address-group {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: start;
}

.zip-input {
    width: min(12ch, 100%);
}

.address-fieldset {
    margin: 0;
    padding: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    display: grid;
    gap: 16px;
}

.address-fieldset legend {
    font-weight: 600;
    color: #0f172a;
    padding: 0 8px;
}

.address-field {
    display: grid;
    gap: 8px;
}

.msg {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
}

.msg.error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.msg.success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* Signature section */
.signature-section {
    padding: 20px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #eef2ff;
    gap: 20px;
}

.signature-root-placeholder {
    border: 2px dashed #94a3b8;
    border-radius: 12px;
    padding: 24px;
    min-height: 180px;
    display: grid;
    place-items: center;
    text-align: center;
    color: #475569;
    font-size: 15px;
    background: rgba(248, 250, 252, 0.8);
}

.signature-support {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
}

.signature-support strong {
    color: #1e293b;
}

.signature-actions {
    grid-auto-flow: column;
    justify-content: flex-start;
    gap: 12px;
}

.signature-actions button {
    width: fit-content;
    justify-self: start;
}

/* Appraisal summary */
.appraisal-summary {
    padding: 20px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
}

.appraisal-summary h2 {
    margin: 0;
    font-size: 20px;
    color: #0f172a;
}

.appraisal-items {
    list-style: none;
    padding: 0;
}

.appraisal-item {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
}

.appraisal-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.appraisal-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.appraisal-item-name {
    font-weight: 600;
    color: #1f2937;
}

.appraisal-item-amount {
    font-weight: 700;
    color: #1e3a8a;
}

.appraisal-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 14px;
    color: #475569;
}

.appraisal-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-weight: 700;
    color: #0f172a;
}

.appraisal-total span:last-child {
    font-size: 20px;
}

.appraisal-empty {
    font-size: 14px;
    color: #475569;
}

.card {
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
}

.success-message {
    padding: 18px;
    border-radius: 10px;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #047857;
}

/* Utilities */
a {
    color: #2563eb;
}

a:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {

    header,
    footer {
        padding: 20px 16px;
    }

    main {
        padding: 24px 16px;
        gap: 24px;
    }

    .signature-actions {
        grid-auto-flow: row;
    }
}
