/*
 * Copyright (c) 2026 Milton Quinaluisa
 * Licensed under the MIT License.
 */

:root {
    color-scheme: light;
    --bg: #eef3f5;
    --panel: #ffffff;
    --text: #1f2a2e;
    --muted: #66777f;
    --line: #cfd9dd;
    --primary: #1687c8;
    --primary-dark: #0c6ca3;
    --success-bg: #e4f6ed;
    --success-text: #14563a;
    --error-bg: #fde8e7;
    --error-text: #8a1f17;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.form-panel {
    width: min(100%, 620px);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 16px 40px rgba(31, 42, 46, 0.08);
}

.top-banner {
    display: block;
    width: calc(100% + 56px);
    max-width: none;
    height: auto;
    margin: -28px -28px 24px;
    border-radius: 8px 8px 0 0;
}

h1 {
    margin: 0;
    font-size: 1.65rem;
    line-height: 1.2;
}

.intro-text {
    margin: -10px 0 22px;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.45;
}

.report-form {
    display: grid;
    gap: 10px;
}

label {
    font-weight: 700;
    margin-top: 8px;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 13px 14px;
    font: inherit;
    color: var(--text);
    background: #ffffff;
}

select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: 3px solid rgba(23, 107, 87, 0.16);
    border-color: var(--primary);
}

input[readonly] {
    background: #f6f9fa;
    color: #435258;
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.optional-box {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px 16px;
    margin: 10px 0 0;
    background: #f5f7f8;
}

.optional-box h2 {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.25;
}

.section-kicker {
    margin: 0 0 -4px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
}

.optional-intro {
    margin: -4px 0 6px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.35;
}

.optional-box label {
    margin-top: 8px;
    font-weight: 600;
}

.field-title {
    margin: 0 0 10px;
    font-weight: 600;
}

.hint {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.field-error {
    display: none;
    border-radius: 6px;
    padding: 10px 12px;
    background: var(--error-bg);
    color: var(--error-text);
    font-size: 0.92rem;
    line-height: 1.4;
}

.field-error.is-visible {
    display: block;
}

button {
    min-height: 48px;
    border: 0;
    border-radius: 6px;
    margin-top: 8px;
    padding: 13px 18px;
    background: var(--primary);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    background: var(--primary-dark);
}

button:disabled {
    opacity: 0.72;
    cursor: wait;
}

.secondary-button {
    width: auto;
    min-height: 42px;
    margin: 0 0 8px;
    padding: 10px 14px;
    border: 1px solid var(--primary);
    background: #ffffff;
    color: var(--primary);
}

.secondary-button:hover {
    background: #eef8f4;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 10px;
}

.preview-item {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
}

.preview-item img,
.preview-placeholder {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #edf2f4;
}

.preview-placeholder {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.preview-item span {
    display: block;
    padding: 8px;
    color: var(--muted);
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remove-photo-button {
    width: calc(100% - 16px);
    min-height: 34px;
    margin: 0 8px 8px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--error-text);
    font-size: 0.86rem;
    font-weight: 700;
}

.remove-photo-button:hover {
    background: var(--error-bg);
}

.ticket-box {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 16px;
    margin: 18px 0;
    background: #f6f9fa;
}

.ticket-box span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.92rem;
}

.ticket-box strong {
    display: block;
    font-size: 1.25rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.button-link {
    display: inline-grid;
    place-items: center;
    min-height: 46px;
    border-radius: 6px;
    padding: 12px 16px;
    background: var(--primary);
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
}

.button-link:hover {
    background: var(--primary-dark);
}

.alert {
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 18px;
    line-height: 1.45;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.alert-error {
    background: var(--error-bg);
    color: var(--error-text);
}

@media (max-width: 520px) {
    .page {
        padding: 14px;
        align-items: start;
    }

    .form-panel {
        padding: 20px;
    }

    .top-banner {
        width: calc(100% + 40px);
        margin: -20px -20px 20px;
    }

    h1 {
        font-size: 1.35rem;
    }

}
