:root {
    --brand: #2b65b3;
    --brand-dark: #1f4f91;
    --ink: #1f2933;
    --muted: #6b7280;
    --line: #e6e8ec;
    --danger: #f3212d;
    --green: #2e7d32;
    --highlight: #ffe066;
    --radius: 10px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 1rem;
    line-height: 1.4;
    margin: 0;
    color: var(--ink);
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
}

.main-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* fallback for older browsers */
    /* dynamic viewport height: accounts for the mobile browser bar so the
       footer logo stays visible without scrolling */
    min-height: 100svh;
    min-height: 100dvh;
}

/* ---------- Header ---------- */
.fixed-header {
    padding: 16px 14px;
    background-color: #fff;
    font-weight: 700;
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid var(--line);
}

.header-title {
    font-size: 1.35em;
    letter-spacing: -0.01em;
    text-align: center;
    /* leave room for the globe so the title never sits under it */
    padding: 0 40px;
}

/* ---------- Language picker (globe) ---------- */
.lang-picker {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.15s;
}

.lang-picker:hover {
    background-color: rgba(43, 101, 179, 0.1);
}

.globe-icon {
    width: 24px;
    height: 24px;
    color: var(--brand);
    pointer-events: none;
}

/* native select sits invisibly on top of the globe so the OS picker
   opens on tap — ideal on mobile, and it never overlaps the title */
.lang-select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: none;
    opacity: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

/* ---------- Layout ---------- */
.content-wrapper {
    flex: 1;
    display: flex;
    min-height: 0;
}

.overflow-container {
    flex: 1;
    overflow: auto;
    padding: 1em 1.1em;
    display: flex;
}

#occurrenceReportForm {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}

.file-list {
    max-width: 100%;
}

#eventData {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#eventData.hidden {
    display: none !important;
}

#eventDescGroup {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* let the textarea grow to fill the available height */
#eventDescription {
    flex: 1;
    min-height: 140px;
}

h2 {
    text-align: center;
    margin: 1.1em 0 0.7em;
    font-size: 1.15em;
    font-weight: 700;
    color: var(--brand);
}

/* ---------- Report type buttons ---------- */
.report-type-buttons {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 1em;
}

.report-type-buttons button {
    background-color: #3a4250;
    color: white;
    padding: 1em 0;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    flex: 1;
    text-align: center;
    transition: background-color 0.15s, transform 0.05s;
}

.report-type-buttons button:hover {
    background-color: #4b5563;
}

.report-type-buttons button:active {
    transform: translateY(1px);
}

.report-type-buttons .selected,
.report-type-buttons .selected:hover {
    background-color: var(--green);
}

/* ---------- Messages / disclaimers ---------- */
.message {
    margin-bottom: 1em;
    padding: 0.9em;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background-color: #f7f9fc;
    text-align: center;
}

.disclaimer {
    margin: 0.5em 0 0;
    font-size: 0.85em;
    color: var(--muted);
}

.privacy {
    margin: 0.75em 0 0.25em;
    font-size: 0.78em;
    line-height: 1.5;
    color: var(--muted);
    text-align: justify;
    border-top: 1px solid var(--line);
    padding-top: 0.85em;
}

/* ---------- Form groups ---------- */
.form-group {
    width: 100%;
    margin-bottom: 1em;
}

.form-group label {
    display: block;
    margin-bottom: 0.4em;
    font-weight: 600;
}

.attach-hint {
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.65em 0.75em;
    font-size: 1em;
    border: 1px solid #d4d8de;
    border-radius: var(--radius);
    font-family: inherit;
    background-color: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group textarea {
    resize: vertical;
    min-height: 140px;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(43, 101, 179, 0.15);
}

.required {
    box-shadow: 0 0 0 2px rgba(243, 33, 45, 0.6);
}

.wrongData {
    border-color: var(--danger);
    box-shadow: 0 0 0 2px rgba(243, 33, 45, 0.4);
}

/* ---------- File list ---------- */
.file-list {
    margin-top: 0.75em;
}

.file-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 0.9em;
    background-color: #fafbfc;
    max-width: 100%;
}

.file-item .file-name {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.file-item .file-size {
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.file-item button {
    flex-shrink: 0;
    background-color: #fff;
    color: var(--danger);
    border: 1px solid var(--danger);
    border-radius: 6px;
    padding: 2px 9px;
    cursor: pointer;
    font-size: 0.9em;
    line-height: 1.4;
}

.file-item button:hover {
    background-color: var(--danger);
    color: #fff;
}

.removeAll {
    background-color: #fff;
    color: var(--danger);
    border: 1px solid var(--danger);
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    margin-top: 4px;
}

.removeAll:hover {
    background-color: var(--danger);
    color: #fff;
}

/* ---------- Send action ---------- */
.fixed-nav {
    padding: 12px;
    text-align: center;
}

.fixed-nav button {
    background-color: var(--brand);
    color: white;
    padding: 0.8em 2.5em;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1.05em;
    font-weight: 600;
    min-width: 160px;
    box-shadow: 0 2px 8px rgba(43, 101, 179, 0.25);
    transition: background-color 0.15s, transform 0.05s;
}

.fixed-nav button:hover {
    background-color: var(--brand-dark);
}

.fixed-nav button:active {
    transform: translateY(1px);
}

.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.disabled:hover {
    background-color: var(--brand);
}

/* ---------- Footer ---------- */
.fixed-footer {
    text-align: center;
}

.footer-content {
    padding: 14px;
    background-color: #fff;
    border-top: 1px solid var(--line);
}

.hidden {
    display: none !important;
}

/* Honeypot field — visually hidden from humans, still present for bots */
.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- Overlays ---------- */
.overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(17, 24, 39, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.loading-box {
    background-color: #fff;
    border-radius: 16px;
    padding: 2em 2.2em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.4em;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    width: 86%;
    max-width: 320px;
}

.spinner {
    border: 8px solid #eef1f5;
    border-top: 8px solid var(--brand);
    border-radius: 50%;
    width: 72px;
    height: 72px;
    animation: spin 1.1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* progress shown inside the spinner popup */
.progress-bar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e6e8ec;
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar-inner {
    height: 100%;
    width: 0%;
    background-color: var(--brand);
    border-radius: 6px;
    transition: width 0.3s;
}

.progress-label {
    font-size: 0.85em;
    color: var(--muted);
    margin-top: 8px;
    text-align: center;
    min-height: 1.2em;
}

.success-box {
    background-color: #fff;
    border-radius: 16px;
    padding: 2em;
    text-align: center;
    max-width: 320px;
    width: 85%;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.success-box p {
    font-size: 1.2em;
    color: var(--green);
    font-weight: 600;
    margin: 0 0 1.2em;
}

.success-box button {
    background-color: var(--brand);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 0.6em 2.5em;
    font-size: 1em;
    cursor: pointer;
}

.success-box button:hover {
    background-color: var(--brand-dark);
}

@media only screen and (min-width: 800px) {
    .main-container {
        width: 800px;
        margin: 0 auto;
    }
}

/* Feedback: message textarea fills the available viewport space */
#feedbackForm {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}
#messageData {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
#messageGroup {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
#message {
    flex: 1;
    min-height: 140px;
}
