*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Georgia, 'Times New Roman', serif;
    background-color: #faf7f2;
    color: #2c2416;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 3rem 1rem;
}

.container {
    width: 100%;
    max-width: 680px;
}

h1 {
    font-size: 1.5rem;
    font-weight: normal;
    letter-spacing: 0.02em;
    color: #1a1008;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 0.95rem;
    color: #7a6a52;
    margin-bottom: 2.5rem;
}

/* Form */

#upload-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.file-area {
    border: 2px dashed #c9b89a;
    border-radius: 8px;
    background-color: #fff;
    transition: border-color 0.2s;
}

.file-area:focus-within {
    border-color: #8b5e2e;
}

.file-area.drag-over {
    border-color: #8b5e2e;
    border-style: solid;
    background-color: #f3ead9;
}

.file-area.drag-over .file-icon,
.file-area.drag-over #file-name-display {
    color: #6e4a22;
}

input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 2.5rem 1rem;
    cursor: pointer;
    text-align: center;
}

.file-icon {
    font-size: 2rem;
    color: #a07840;
}

#file-name-display {
    font-size: 0.9rem;
    color: #5a4a32;
}

.file-hint {
    font-size: 0.78rem;
    color: #9a8a72;
}

button[type="submit"] {
    padding: 0.75rem 2rem;
    background-color: #8b5e2e;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    align-self: flex-start;
    transition: background-color 0.2s;
}

button[type="submit"]:hover {
    background-color: #6e4a22;
}

button[type="submit"]:disabled {
    background-color: #b89a78;
    cursor: not-allowed;
}

/* Loading */

.hidden {
    display: none !important;
}

#loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
    color: #7a6a52;
    font-size: 0.95rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #c9b89a;
    border-top-color: #8b5e2e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

/* Results */

#results {
    margin-top: 2.5rem;
    border-top: 1px solid #ddd0bc;
    padding-top: 2rem;
}

#results h2 {
    font-size: 1.2rem;
    font-weight: normal;
    color: #1a1008;
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}

.analysis-text {
    font-size: 0.97rem;
    line-height: 1.75;
    color: #2c2416;
    white-space: pre-wrap;
}

#results h3 {
    font-size: 1.05rem;
    font-weight: normal;
    color: #1a1008;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
}

.analysis-section {
    margin-bottom: 1.25rem;
}

.analysis-section h4 {
    font-size: 0.9rem;
    font-weight: bold;
    color: #8b5e2e;
    margin-bottom: 0.3rem;
    letter-spacing: 0.01em;
}

.analysis-note {
    margin-top: 1.25rem;
    padding: 0.85rem 1.1rem;
    background-color: #f5efe2;
    border-left: 3px solid #c9a227;
    border-radius: 4px;
    font-size: 0.88rem;
    line-height: 1.6;
    color: #5a4a32;
    font-style: italic;
}

.file-tag {
    margin-top: 1rem;
    font-size: 0.82rem;
    color: #9a8a72;
}

.features-block {
    margin-top: 1.25rem;
    background-color: #fff;
    border: 1px solid #e0d4c0;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #4a3a22;
    overflow-x: auto;
    white-space: pre;
}

/* Error */

.error-box {
    margin-top: 1.5rem;
    padding: 0.9rem 1.1rem;
    background-color: #fdf0ee;
    border: 1px solid #e8b4ab;
    border-radius: 6px;
    color: #9b2c1a;
    font-size: 0.9rem;
}

/* Disclaimer */

.disclaimer {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e0d4c0;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #9a8a72;
    text-align: center;
}

.footer-links {
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

/* Understated small print for disclaimers and notices. */
.fine-print {
    margin: 0 auto 0.5rem;
    max-width: 34rem;
    font-size: 0.72rem;
    line-height: 1.55;
    color: #a89880;
}

.copyright {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: #8a7a62;
}

/* Links */

a {
    color: #9c6b1e;
    text-decoration: underline;
    text-underline-offset: 2px;
}

a:hover {
    color: #7a5216;
}

/* Terms agreement checkbox */

.terms-agree {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #5a4a32;
    cursor: pointer;
}

.terms-agree input[type="checkbox"] {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    margin-top: 0.15rem;
    accent-color: #9c6b1e;
    cursor: pointer;
}

/* Privacy & Terms pages */

.privacy-content h2,
.legal-content h2 {
    font-size: 1.05rem;
    font-weight: normal;
    color: #1a1008;
    margin: 1.75rem 0 0.5rem;
}

.privacy-content p,
.legal-content p {
    font-size: 0.92rem;
    line-height: 1.7;
    color: #4a3a22;
}

.privacy-content strong,
.legal-content strong {
    color: #2c2416;
}

.legal-list {
    margin: 0.5rem 0 0.5rem 1.25rem;
    font-size: 0.92rem;
    line-height: 1.7;
    color: #4a3a22;
}

.legal-list li {
    margin-bottom: 0.6rem;
}
