/* ══ SUBMISSION FORM (shared partial) ════════════════════ */

/* Form chrome */
.form-header { text-align: center; margin-bottom: 1.5rem; }
.form-header h3 {
    font-family: 'Libre Baskerville', Georgia, sans-serif;
    font-size: 1.2rem; font-weight: 700; margin-bottom: 0.35rem;
}
.form-header p { font-size: 0.85rem; color: var(--text-muted); }
.form-row { margin-bottom: 0.9rem; }
.form-row label {
    display: block; font-size: 0.78rem; font-weight: 700;
    color: var(--text-body); margin-bottom: 0.3rem;
}
.form-row input[type="text"],
.form-row input[type="email"],
.form-row select {
    width: 100%; padding: 0.7rem 0.9rem;
    background: var(--bg-cream); border: 1px solid var(--border-warm);
    border-radius: 8px; font-size: 0.9rem;
    font-family: 'Fira Sans', Arial, sans-serif; outline: none; transition: all 0.2s;
}
.form-row input:focus, .form-row select:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(177, 110, 169, 0.12);
}
.form-row input::placeholder { color: var(--text-faint); }
.form-error {
    background: rgba(217,87,120,0.08); color: #c62828;
    font-size: 0.82rem; padding: 0.6rem 0.9rem;
    border-radius: 8px; margin-bottom: 0.9rem;
}
.name-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }

/* Upload buttons with progress states */
.upload-btn {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.75rem 0.5rem; background: var(--bg-cream);
    border: 1.5px dashed var(--border-warm); border-radius: 8px;
    cursor: pointer; transition: all 0.2s; position: relative; overflow: hidden;
    font-family: 'Fira Sans', Arial, sans-serif; font-size: 0.8rem;
    font-weight: 700; color: var(--text-body); min-height: 44px;
}
.upload-btn:hover { border-color: var(--purple); color: var(--purple); }
.upload-btn.has-file { border-color: var(--purple); border-style: solid; color: var(--purple); }
.upload-btn.uploading { border-color: var(--purple-light); border-style: solid; pointer-events: none; }
.upload-btn.upload-error { border-color: #d95778; border-style: solid; color: #d95778; }
.upload-btn .upload-content { display: flex; align-items: center; gap: 0.5rem; z-index: 1; }
.upload-btn .upload-progress {
    position: absolute; left: 0; top: 0; height: 100%;
    background: rgba(177,110,169,0.08); width: 0;
    transition: width 0.3s ease; border-radius: 6px;
}
.upload-btn .upload-spinner {
    width: 16px; height: 16px; border: 2px solid var(--purple-light);
    border-top-color: var(--purple); border-radius: 50%;
    animation: submission-form-spin 0.8s linear infinite;
}
@keyframes submission-form-spin { to { transform: rotate(360deg); } }
.upload-btn .upload-check { color: var(--purple); font-weight: 700; }
.upload-btn .upload-error-icon { color: #d95778; font-weight: 700; }
.upload-hint {
    font-size: 0.68rem; color: var(--text-faint); text-align: center;
    margin-top: 0.25rem;
}

/* Submit button full-width inside form */
#match-form .btn-primary {
    width: 100%; padding: 0.85rem;
    margin-top: 0.4rem;
}

/* Footer */
.form-footer {
    text-align: center; margin-top: 0.75rem;
    font-size: 0.72rem; color: var(--text-faint);
}

/* Success state */
.form-success {
    text-align: center; padding: 2rem 1.5rem;
}
.form-success .success-icon {
    width: 56px; height: 56px; border-radius: 50%;
    background: rgba(177,110,169,0.1); display: inline-flex;
    align-items: center; justify-content: center; margin-bottom: 1rem;
}
.form-success .success-icon svg { color: var(--purple); }
.form-success h3 {
    font-family: 'Libre Baskerville', Georgia, sans-serif;
    font-size: 1.15rem; font-weight: 700; margin-bottom: 0.5rem;
}
.form-success p {
    font-size: 0.88rem; color: var(--text-muted);
    line-height: 1.55; margin-bottom: 0.25rem;
}
.form-success .success-email {
    font-weight: 700; color: var(--purple);
}

/* Drag-over feedback */
.upload-btn.drag-over {
    border-color: var(--purple); border-style: solid;
    background: rgba(177,110,169,0.06);
}

/* File list */
.file-list { margin-top: 0.4rem; }
.file-entry {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.3rem 0.5rem; font-size: 0.75rem;
    border-radius: 6px; background: var(--bg-cream);
    margin-bottom: 0.25rem; transition: background 0.15s;
}
.file-entry:hover { background: rgba(177,110,169,0.06); }
.file-status-ok { color: #2e7d32; font-weight: 700; flex-shrink: 0; }
.file-status-err { color: #d95778; font-weight: 700; flex-shrink: 0; cursor: help; }
.file-name {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
    color: var(--text-body);
}
.file-name-text {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-char-count {
    font-size: 0.65rem; color: var(--text-faint); line-height: 1.3;
}
.file-remove {
    background: none; border: none; cursor: pointer;
    color: var(--text-faint); font-size: 1rem; line-height: 1;
    padding: 0 0.15rem; flex-shrink: 0; transition: color 0.15s;
}
.file-remove:hover { color: #d95778; }

/* Character usage bar */
.char-usage {
    display: flex; align-items: center; gap: 0.5rem;
    margin-top: 0.35rem;
}
.char-usage-bar {
    flex: 1; height: 4px; background: var(--border-warm);
    border-radius: 2px; overflow: hidden;
}
.char-usage-fill {
    height: 100%; background: var(--purple);
    border-radius: 2px; transition: width 0.3s ease;
}
.char-usage-text {
    font-size: 0.65rem; color: var(--text-faint);
    white-space: nowrap;
}
.char-usage.warn .char-usage-fill { background: #f57f17; }
.char-usage.warn .char-usage-text { color: #f57f17; }

/* Error list (for server-side validation) */
.errorlist { list-style: none; color: var(--red); font-size: 0.82rem; margin-bottom: 0.5rem; }

/* ══ RESPONSIVE ══════════════════════════════════════════ */
@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .name-grid { grid-template-columns: 1fr; }
}
