/* GRS Upload — iframe-optimized styles */

:root {
    --grs-primary: #004a7c;
    --grs-primary-dark: #003257;
    --grs-accent: #c9a44c;
    --grs-text: #222;
    --grs-muted: #666;
    --grs-error: #b3261e;
    --grs-success: #1e7a3c;
    --grs-border: #d0d5dc;
    --grs-bg: #ffffff;
    --grs-field-bg: #f7f9fb;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--grs-bg);
    color: var(--grs-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

.grs-upload {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

.instructions h1 {
    color: var(--grs-primary);
    font-size: 1.4rem;
    margin: 0 0 8px;
}

.instructions p {
    margin: 4px 0;
    color: var(--grs-muted);
}

.instructions .warn {
    color: var(--grs-error);
    font-size: 0.95rem;
}

form {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.field { display: flex; flex-direction: column; gap: 6px; }

/* [hidden] must actually hide even on flex containers — UA `[hidden] { display: none }`
   is overridden by `.field { display: flex }` without this targeted rule. */
.field[hidden], [data-conditional][hidden] { display: none !important; }

.field.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

label {
    font-weight: 600;
    color: var(--grs-text);
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="file"],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--grs-border);
    border-radius: 6px;
    background: var(--grs-field-bg);
    font-size: 15px;
    font-family: inherit;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--grs-primary);
    box-shadow: 0 0 0 3px rgba(0, 74, 124, 0.15);
}

.hint { color: var(--grs-muted); font-size: 0.9rem; margin: 0 0 6px; }
.hint.acc-arb-note { color: var(--grs-primary-dark); font-weight: 500; }

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}
.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    cursor: pointer;
}
.radio-option input[type="radio"] { width: auto; margin: 0; }

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px 12px;
    margin-top: 4px;
}
@media (max-width: 520px) {
    .checkbox-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.checkbox-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    cursor: pointer;
}
.checkbox-cell input[type="checkbox"] { width: auto; margin: 0; }

.batch-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 24px;
    font-size: 0.92rem;
    table-layout: fixed;
}
.batch-table th, .batch-table td {
    border-bottom: 1px solid var(--grs-border);
    padding: 8px 6px;
    text-align: left;
    vertical-align: top;
}
.batch-table th { color: var(--grs-muted); font-weight: 600; }

/* Filenames are long unbreakable strings — let them wrap mid-word.
   Period and Status are short and should stay on one line. */
.batch-col-period   { width: 18%; }
.batch-col-filename { width: 34%; }
.batch-col-status   { width: 14%; }
.batch-table td:nth-child(2),
.batch-table td:nth-child(3) {
    word-break: break-all;
    font-family: var(--grs-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    font-size: 0.88rem;
}
.batch-table th:first-child,
.batch-table td:first-child,
.batch-table th:last-child,
.batch-table td:last-child {
    white-space: nowrap;
}
.batch-status-success { color: var(--grs-success); font-weight: 600; }
.batch-status-failed  { color: var(--grs-error); font-weight: 600; }

.error {
    color: var(--grs-error);
    font-size: 0.9rem;
}

/* Drag-and-drop file upload zone. Replaces the bare <input type="file">.
   The native input is hidden and synthesized via dropZone click/drop. */
.drop-zone {
    border: 2px dashed var(--grs-border);
    border-radius: 8px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    background-color: var(--grs-field-bg);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.drop-zone:hover,
.drop-zone:focus {
    border-color: #2d5016;
    background-color: #f0f4ec;
    outline: none;
}
.drop-zone.drag-over {
    border-color: #2d5016;
    background-color: #e8f0e0;
    border-style: solid;
}
.drop-zone-content svg {
    color: var(--grs-muted);
    margin-bottom: 12px;
}
.drop-zone-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--grs-text);
    margin: 0 0 4px;
}
.drop-zone-subtext {
    font-size: 0.9rem;
    color: var(--grs-muted);
    margin: 0;
}
.drop-zone-filename {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d5016;
    margin: 8px 0 0;
    word-break: break-all;
}

.flashes { margin-bottom: 16px; }
.flash {
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
}
.flash-error   { background: #fde8e6; color: var(--grs-error); }
.flash-success { background: #e7f5ec; color: var(--grs-success); }
.flash-message { background: #eef3f8; color: var(--grs-primary-dark); }

.btn-primary {
    display: inline-block;
    background: var(--grs-primary);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary:hover { background: var(--grs-primary-dark); }

.submit-row { margin-top: 8px; }

.success-panel h1 {
    color: var(--grs-success);
    font-size: 1.4rem;
    margin: 0 0 8px;
}

.summary {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 16px;
    row-gap: 4px;
    margin: 16px 0 24px;
}

.summary dt { font-weight: 600; color: var(--grs-muted); }
.summary dd { margin: 0; word-break: break-all; }

.actions { margin-top: 16px; }
