/* The two data sets sit side by side rather than stacked: the geospatial form
   is four fields shorter than the fenceline one and left a screen of empty
   space under it. Columns are uneven because the forms are - the fenceline one
   carries a 24em field width plus a captcha.

   align-items: start keeps the shorter column at its natural height instead of
   stretching its border down to match the taller one. */
.download-columns {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    align-items: start;
    gap: 1em 3em;
}

/* One column below the width where the fenceline form's 24em fields would start
   compressing. Stacked, this is the original layout. */
@media (max-width: 60em) {
    .download-columns {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }
}

/* The heading belongs to its column, so the underline stops at the column edge
   rather than running the full page width. */
.download-column > .underlined-header {
    margin-top: 0;
}

/* A class rather than an ID because the page carries more than one of these -
   the fenceline download and the monitoring-locations download. The ID stays on
   the fenceline one alone, since its loading wheel is what the JS targets. */
.download-form-container {
    display: flex;
    align-items: flex-start;
    gap: 1.5em;
    min-height: 11em;
}

/* A flex item defaults to min-width: auto, so the form refused to shrink below
   its widest field and pushed past its column instead. */
.download-form {
    flex: 1;
    min-width: 0;
}

/* Override the global .form-group flex/right-label-column layout (style.css)
   with a clean stacked layout for these forms. */
.download-form-container .form-group {
    display: block;
    margin: 0 0 1.2em 0;
}

.download-form .form-group label {
    display: block;
    width: auto;
    margin: 0 0 0.45em 0;
    text-align: left;
    font-weight: 600;
}

.download-form .form-group label .label-hint {
    margin-left: 0.35em;
    font-weight: normal;
    font-size: 0.85em;
    color: #666;
}

/* Fluid up to 24em rather than a flat 24em: the monitoring-locations column is
   narrower than that, and a fixed width overflowed it and gave the whole page a
   horizontal scrollbar. */
.download-form .form-group select,
.download-form .datetime-range-input,
.download-form #captcha-phrase {
    width: 100%;
    max-width: 24em;
    box-sizing: border-box;
}

.download-form .form-group select,
.download-form .datetime-range-input input,
.download-form #captcha-phrase {
    padding: 0.55em 0.75em;
    border: 1px solid #ccc;
    border-radius: 0.4em;
    font-size: 1em;
    box-sizing: border-box;
}

.download-form .site-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    width: 100%;
    max-width: 24em;
}

/* Override the .form-group label block/bold styling above - these labels
   wrap individual radios, not the field group itself. */
.download-form .site-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4em;
    margin: 0;
    padding: 0.4em 0.8em;
    border: 1px solid #ccc;
    border-radius: 1.2em;
    font-weight: normal;
    font-size: 0.92em;
    cursor: pointer;
    user-select: none;
}

.download-form .site-checkbox:hover {
    border-color: var(--primary);
}

.download-form .site-checkbox input {
    margin: 0;
    accent-color: var(--primary);
}

.download-form .datetime-range-input {
    position: relative;
    display: inline-block;
}

.download-form .datetime-range-input input {
    width: 100%;
    padding-right: 2.4em;
    cursor: pointer;
}

.download-form .datetime-range-input i {
    position: absolute;
    top: 50%;
    right: 0.85em;
    transform: translateY(-50%);
    color: var(--primary);
    pointer-events: none;
}

.download-form input.button {
    display: inline-block;
    margin-top: 0.3em;
    padding: 0.6em 1.4em;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.4em;
    font-size: 1em;
    cursor: pointer;
}

.download-form input.button:hover {
    background: var(--lighter-primary);
}

#download-csv-form-container .loading-wheel {
    display: none;
}

.form-note {
    max-width: 30em;
    margin: -0.5em 0 1.2em;
    font-size: 0.9em;
    line-height: 1.5;
    opacity: 0.85;
}

/* Inline within the note's own sentence, not its own line - only "click here"
   is the link. Coloured and underlined explicitly: the global rule is
   a { color: inherit; text-decoration: none }, so a link here is otherwise
   indistinguishable from the note text around it. */
.form-note-link {
    color: var(--primary);
    text-decoration: underline;
}

/* Drops the underline rather than shifting colour: --lighter-primary is a
   background tint and would be near-invisible as text on white. */
.form-note-link:hover {
    text-decoration: none;
}

/* Date Range Picker overrides */

.daterangepicker td.active, .daterangepicker td.active:hover {
    background: var(--primary) !important;
}

.daterangepicker td.in-range {
    background: var(--lighter-primary);
}

#download-csv-form .captcha {
    display: flex;
    align-items: center;
    gap: 1em;
    margin-bottom: 0.6em;
}

#download-csv-form .captcha img {
    margin: 0;
}
